mirror of https://github.com/apache/activemq.git
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1423481 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
22bc55b948
commit
14e76891e2
|
@ -80,4 +80,10 @@ public class ActiveMQMessageAudit extends ActiveMQMessageAuditNoSync {
|
|||
return super.isInOrder(id);
|
||||
}
|
||||
}
|
||||
|
||||
public void setMaximumNumberOfProducersToTrack(int maximumNumberOfProducersToTrack) {
|
||||
synchronized (this) {
|
||||
super.setMaximumNumberOfProducersToTrack(maximumNumberOfProducersToTrack);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -89,8 +89,19 @@ public class ActiveMQMessageAuditNoSync implements Serializable {
|
|||
* @param maximumNumberOfProducersToTrack the maximumNumberOfProducersToTrack to set
|
||||
*/
|
||||
public void setMaximumNumberOfProducersToTrack(int maximumNumberOfProducersToTrack) {
|
||||
this.maximumNumberOfProducersToTrack = maximumNumberOfProducersToTrack;
|
||||
|
||||
if (maximumNumberOfProducersToTrack < this.maximumNumberOfProducersToTrack){
|
||||
LRUCache<Object, BitArrayBin> newMap = new LRUCache<Object, BitArrayBin>(0,maximumNumberOfProducersToTrack,0.75f,true);
|
||||
/**
|
||||
* As putAll will access the entries in the right order,
|
||||
* this shouldn't result in wrong cache entries being removed
|
||||
*/
|
||||
newMap.putAll(this.map);
|
||||
this.map.clear();
|
||||
this.map.putAll(newMap);
|
||||
}
|
||||
this.map.setMaxCacheSize(maximumNumberOfProducersToTrack);
|
||||
this.maximumNumberOfProducersToTrack = maximumNumberOfProducersToTrack;
|
||||
this.modified = true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue