activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r746330 - in /activemq/sandbox/activemq-flow: pom.xml src/main/java/org/apache/activemq/dispatch/IDispatcher.java src/main/java/org/apache/activemq/dispatch/PriorityDispatcher.java
Date Fri, 20 Feb 2009 18:36:30 GMT
Author: chirino
Date: Fri Feb 20 18:36:30 2009
New Revision: 746330

URL: http://svn.apache.org/viewvc?rev=746330&view=rev
Log:
Support extending RunnableAdapter to provide the runable impl.

Modified:
    activemq/sandbox/activemq-flow/pom.xml
    activemq/sandbox/activemq-flow/src/main/java/org/apache/activemq/dispatch/IDispatcher.java
    activemq/sandbox/activemq-flow/src/main/java/org/apache/activemq/dispatch/PriorityDispatcher.java

Modified: activemq/sandbox/activemq-flow/pom.xml
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/pom.xml?rev=746330&r1=746329&r2=746330&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/pom.xml (original)
+++ activemq/sandbox/activemq-flow/pom.xml Fri Feb 20 18:36:30 2009
@@ -49,7 +49,8 @@
       <artifactId>log4j</artifactId>
       <scope>test</scope>
     </dependency>
-    
+  
+<!--   In case we want to look at mina..
     <dependency>
       <groupId>org.apache.mina</groupId>
       <artifactId>mina-core</artifactId>
@@ -63,6 +64,7 @@
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-jcl</artifactId>
     </dependency>
+-->
     
   </dependencies>
 

Modified: activemq/sandbox/activemq-flow/src/main/java/org/apache/activemq/dispatch/IDispatcher.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/src/main/java/org/apache/activemq/dispatch/IDispatcher.java?rev=746330&r1=746329&r2=746330&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/src/main/java/org/apache/activemq/dispatch/IDispatcher.java
(original)
+++ activemq/sandbox/activemq-flow/src/main/java/org/apache/activemq/dispatch/IDispatcher.java
Fri Feb 20 18:36:30 2009
@@ -79,9 +79,12 @@
         public void close();
     }
 
-    public class RunnableAdapter implements Dispatchable {
-        final Runnable runnable;
+    public class RunnableAdapter implements Dispatchable, Runnable {
+        private Runnable runnable;
 
+        public RunnableAdapter() {
+            runnable = this;
+        }
         public RunnableAdapter(Runnable runnable) {
             this.runnable = runnable;
         }
@@ -90,6 +93,9 @@
             runnable.run();
             return true;
         }
+
+        public void run() {
+        }
     }
 
     /**

Modified: activemq/sandbox/activemq-flow/src/main/java/org/apache/activemq/dispatch/PriorityDispatcher.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/src/main/java/org/apache/activemq/dispatch/PriorityDispatcher.java?rev=746330&r1=746329&r2=746330&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/src/main/java/org/apache/activemq/dispatch/PriorityDispatcher.java
(original)
+++ activemq/sandbox/activemq-flow/src/main/java/org/apache/activemq/dispatch/PriorityDispatcher.java
Fri Feb 20 18:36:30 2009
@@ -158,11 +158,11 @@
      */
     public synchronized void shutdown() throws InterruptedException {
         if (thread != null) {
-            dispatch(new RunnableAdapter(new Runnable() {
+            dispatch(new RunnableAdapter() {
                 public void run() {
                     running = false;
                 }
-            }), MAX_USER_PRIORITY + 1);
+            }, MAX_USER_PRIORITY + 1);
             // thread.interrupt();
             thread.join();
             thread = null;
@@ -358,7 +358,7 @@
      */
     protected class PriorityDispatchContext extends LinkedNode<PriorityDispatchContext>
implements PooledDispatchContext<D> {
         // The dispatchable target:
-        final Dispatchable dispatchable;
+        private final Dispatchable dispatchable;
         // The name of this context:
         final String name;
         // list prio can only be updated in the thread of of the owning



Mime
View raw message