activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmacn...@apache.org
Subject svn commit: r886965 - /activemq/sandbox/activemq-apollo-actor/activemq-dispatcher/src/main/java/org/apache/activemq/dispatch/internal/advanced/PriorityDispatcher.java
Date Thu, 03 Dec 2009 22:39:30 GMT
Author: cmacnaug
Date: Thu Dec  3 22:39:25 2009
New Revision: 886965

URL: http://svn.apache.org/viewvc?rev=886965&view=rev
Log:
Fixing a memory leak with transient PriorityDispatchContexts.

Modified:
    activemq/sandbox/activemq-apollo-actor/activemq-dispatcher/src/main/java/org/apache/activemq/dispatch/internal/advanced/PriorityDispatcher.java

Modified: activemq/sandbox/activemq-apollo-actor/activemq-dispatcher/src/main/java/org/apache/activemq/dispatch/internal/advanced/PriorityDispatcher.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-dispatcher/src/main/java/org/apache/activemq/dispatch/internal/advanced/PriorityDispatcher.java?rev=886965&r1=886964&r2=886965&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-dispatcher/src/main/java/org/apache/activemq/dispatch/internal/advanced/PriorityDispatcher.java
(original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-dispatcher/src/main/java/org/apache/activemq/dispatch/internal/advanced/PriorityDispatcher.java
Thu Dec  3 22:39:25 2009
@@ -349,13 +349,12 @@
     }
 
     //Special dispatch method that allow high priority dispatch:
-    private final void dispatchInternal(Dispatchable dispatchable, int priority)
-    {
+    private final void dispatchInternal(Dispatchable dispatchable, int priority) {
         PriorityDispatchContext context = new PriorityDispatchContext(dispatchable, false,
name);
         context.priority = priority;
         context.requestDispatch();
     }
-    
+
     /*
      * (non-Javadoc)
      * 
@@ -463,7 +462,9 @@
             updateEvent = createUpdateEvent();
             updateEvent[0] = new UpdateEvent(this);
             updateEvent[1] = new UpdateEvent(this);
-            currentOwner.takeOwnership(this);
+            if (persistent) {
+                currentOwner.takeOwnership(this);
+            }
         }
 
         private final PriorityDispatcher.UpdateEvent[] createUpdateEvent() {
@@ -543,9 +544,9 @@
             if (closed) {
                 return;
             }
-            
+
             priority = Math.min(priority, MAX_USER_PRIORITY);
-            
+
             if (this.priority == priority) {
                 return;
             }
@@ -617,10 +618,8 @@
         /**
          * May be overriden by subclass to additional work on dispatcher switch
          * 
-         * @param oldDispatcher
-         *            The old dispatcher
-         * @param newDispatcher
-         *            The new Dispatcher
+         * @param oldDispatcher The old dispatcher
+         * @param newDispatcher The new Dispatcher
          */
         protected void switchedDispatcher(PriorityDispatcher oldDispatcher, PriorityDispatcher
newDispatcher) {
 
@@ -680,7 +679,7 @@
 
     }
 
-	public String getName() {
-		return name;
-	}
+    public String getName() {
+        return name;
+    }
 }



Mime
View raw message