activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r581167 - in /activemq/trunk/activemq-core/src/main/java/org/apache/activemq: ConnectionAudit.java memory/LRUMap.java
Date Tue, 02 Oct 2007 09:25:39 GMT
Author: rajdavies
Date: Tue Oct  2 02:25:39 2007
New Revision: 581167

URL: http://svn.apache.org/viewvc?rev=581167&view=rev
Log:
some unnecessary memory allocations removed

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ConnectionAudit.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/memory/LRUMap.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ConnectionAudit.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ConnectionAudit.java?rev=581167&r1=581166&r2=581167&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ConnectionAudit.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ConnectionAudit.java Tue
Oct  2 02:25:39 2007
@@ -27,7 +27,7 @@
 class ConnectionAudit {
 
     private boolean checkForDuplicates;
-    private LinkedHashMap<ActiveMQDestination, ActiveMQMessageAudit> queues = new LRUCache<ActiveMQDestination,
ActiveMQMessageAudit>(1000);
+    private LinkedHashMap<ActiveMQDestination, ActiveMQMessageAudit> destinations =
new LRUCache<ActiveMQDestination, ActiveMQMessageAudit>(1000);
     private LinkedHashMap<ActiveMQDispatcher, ActiveMQMessageAudit> dispatchers = new
LRUCache<ActiveMQDispatcher, ActiveMQMessageAudit>(1000);
 
     synchronized void removeDispatcher(ActiveMQDispatcher dispatcher) {
@@ -39,10 +39,10 @@
             ActiveMQDestination destination = message.getDestination();
             if (destination != null) {
                 if (destination.isQueue()) {
-                    ActiveMQMessageAudit audit = queues.get(destination);
+                    ActiveMQMessageAudit audit = destinations.get(destination);
                     if (audit == null) {
                         audit = new ActiveMQMessageAudit();
-                        queues.put(destination, audit);
+                        destinations.put(destination, audit);
                     }
                     boolean result = audit.isDuplicateMessageReference(message);
                     return result;
@@ -64,7 +64,7 @@
             ActiveMQDestination destination = message.getDestination();
             if (destination != null) {
                 if (destination.isQueue()) {
-                    ActiveMQMessageAudit audit = queues.get(destination);
+                    ActiveMQMessageAudit audit = destinations.get(destination);
                     if (audit != null) {
                         audit.rollbackMessageReference(message);
                     }

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/memory/LRUMap.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/memory/LRUMap.java?rev=581167&r1=581166&r2=581167&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/memory/LRUMap.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/memory/LRUMap.java Tue
Oct  2 02:25:39 2007
@@ -24,7 +24,7 @@
  * 
  * @version $Revision:$
  */
-public class LRUMap extends LinkedHashMap {
+public class LRUMap<K,V> extends LinkedHashMap<K,V>{
 
     protected static final float DEFAULT_LOAD_FACTOR = (float) 0.75;
     protected static final int DEFAULT_INITIAL_CAPACITY = 5000;
@@ -45,7 +45,7 @@
         this.maximumSize = maximumSize;
     }
 
-    protected boolean removeEldestEntry(Map.Entry eldest) {
+    protected boolean removeEldestEntry(Map.Entry<K,V> eldest) {
         return size() > maximumSize;
     }
 }



Mime
View raw message