servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From egl...@apache.org
Subject svn commit: r886174 - /servicemix/smx4/nmr/trunk/jbi/cluster/requestor/src/main/java/org/apache/servicemix/jbi/cluster/requestor/AbstractJmsRequestorPool.java
Date Wed, 02 Dec 2009 15:28:44 GMT
Author: eglynn
Date: Wed Dec  2 15:28:43 2009
New Revision: 886174

URL: http://svn.apache.org/viewvc?rev=886174&view=rev
Log:
Fix for [SMX4NMR-173] [clustering] Replicated messages not received by other cluster members

Modified:
    servicemix/smx4/nmr/trunk/jbi/cluster/requestor/src/main/java/org/apache/servicemix/jbi/cluster/requestor/AbstractJmsRequestorPool.java

Modified: servicemix/smx4/nmr/trunk/jbi/cluster/requestor/src/main/java/org/apache/servicemix/jbi/cluster/requestor/AbstractJmsRequestorPool.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/jbi/cluster/requestor/src/main/java/org/apache/servicemix/jbi/cluster/requestor/AbstractJmsRequestorPool.java?rev=886174&r1=886173&r2=886174&view=diff
==============================================================================
--- servicemix/smx4/nmr/trunk/jbi/cluster/requestor/src/main/java/org/apache/servicemix/jbi/cluster/requestor/AbstractJmsRequestorPool.java
(original)
+++ servicemix/smx4/nmr/trunk/jbi/cluster/requestor/src/main/java/org/apache/servicemix/jbi/cluster/requestor/AbstractJmsRequestorPool.java
Wed Dec  2 15:28:43 2009
@@ -75,9 +75,21 @@
      * @see org.springframework.scheduling.commonj.WorkManagerTaskExecutor
      */
     public void setTaskExecutor(TaskExecutor taskExecutor) {
-        this.taskExecutor = taskExecutor;
+        synchronized (this.lifecycleMonitor) {
+            this.taskExecutor = taskExecutor;
+        }
+    }
+    
+    public TaskExecutor getTaskExecutor() {
+        synchronized (this.lifecycleMonitor) {
+            if (this.taskExecutor == null) {
+                this.taskExecutor = createDefaultTaskExecutor();
+            }
+        }
+        return this.taskExecutor;
     }
 
+
     /**
      * Specify the interval between recovery attempts, in <b>milliseconds</b>.
      * The default is 5000 ms, that is, 5 seconds.
@@ -93,11 +105,7 @@
 
     public void initialize() {
         // Prepare taskExecutor and maxMessagesPerTask.
-        synchronized (this.lifecycleMonitor) {
-            if (this.taskExecutor == null) {
-                this.taskExecutor = createDefaultTaskExecutor();
-            }
-        }
+    	getTaskExecutor();
 
         // Proceed with actual listener initialization.
         super.initialize();
@@ -120,7 +128,7 @@
      * @see #setTaskExecutor
      */
     protected void doRescheduleTask(Object task) {
-        this.taskExecutor.execute((Runnable) task);
+    	getTaskExecutor().execute((Runnable) task);
     }
 
     //-------------------------------------------------------------------------



Mime
View raw message