camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jans...@apache.org
Subject svn commit: r1393411 - /camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/component/seda/SedaConsumer.java
Date Wed, 03 Oct 2012 11:04:42 GMT
Author: janstey
Date: Wed Oct  3 11:04:42 2012
New Revision: 1393411

URL: http://svn.apache.org/viewvc?rev=1393411&view=rev
Log:
Polish shutdown code

Modified:
    camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/component/seda/SedaConsumer.java

Modified: camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/component/seda/SedaConsumer.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/component/seda/SedaConsumer.java?rev=1393411&r1=1393410&r2=1393411&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/component/seda/SedaConsumer.java
(original)
+++ camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/component/seda/SedaConsumer.java
Wed Oct  3 11:04:42 2012
@@ -300,18 +300,16 @@ public class SedaConsumer extends Servic
     protected void doStop() throws Exception {
         endpoint.onStopped(this);
         
-        // need to shutdown executor here as well or each time this endpoint is 
-        // started a new thread will be created
-        if (executor != null) {
-            endpoint.getCamelContext().getExecutorServiceManager().shutdownNow(executor);
-            executor = null;
-        }
+        shutdownExecutor();
     }
 
     @Override
     protected void doShutdown() throws Exception {
-        // only shutdown thread pool when we shutdown
-        if (executor != null) {
+        shutdownExecutor();
+    }
+
+	private void shutdownExecutor() {
+	    if (executor != null) {
             endpoint.getCamelContext().getExecutorServiceManager().shutdownNow(executor);
             executor = null;
         }



Mime
View raw message