[
https://issues.apache.org/jira/browse/OFBIZ-6747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16508717#comment-16508717 ]
Taher Alkhateeb commented on OFBIZ-6747:
----------------------------------------
Thank you Ben, this is indeed quite informative.
So I see two places where the specific implementation is used explicitly in the code:
* org.apache.ofbiz.service.ServiceDispatcher:
{code:java}
protected static final Map<RunningService, ServiceDispatcher> runLog = new ConcurrentLinkedHashMap.Builder<RunningService, ServiceDispatcher>().maximumWeightedCapacity(lruLogSize).build();
{code}
* org.apache.ofbiz.base.util.cache.UtilCache
{code:java}
public void setMaxInMemory(int newInMemory) {
this.maxInMemory = newInMemory;
Map<Object, CacheLine<V>> oldmap = this.memoryTable;
if (newInMemory > 0) {
if (this.memoryTable instanceof ConcurrentLinkedHashMap<?, ?>) {
((ConcurrentLinkedHashMap<?, ?>) this.memoryTable).setCapacity(newInMemory);
return;
}
this.memoryTable =new Builder<Object, CacheLine<V>>()
.maximumWeightedCapacity(newInMemory)
.build();
} else {
this.memoryTable = new ConcurrentHashMap<>();
}
this.memoryTable.putAll(oldmap);
}
{code}
So the question on my mind is, what is the simplest way to switch out. I guess we need to replace the builder logic along with the other specific methods that are being called.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)