Author: janstey
Date: Wed Oct  3 11:23:07 2012
New Revision: 1393424

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


Conflicts:
        
camel-core/src/main/java/org/apache/camel/component/seda/SedaConsumer.java

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

Modified: 
camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/component/seda/SedaConsumer.java
URL: 
http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/component/seda/SedaConsumer.java?rev=1393424&r1=1393423&r2=1393424&view=diff
==============================================================================
--- 
camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/component/seda/SedaConsumer.java
 (original)
+++ 
camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/component/seda/SedaConsumer.java
 Wed Oct  3 11:23:07 2012
@@ -281,17 +281,15 @@ 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
+        shutdownExecutor();
+    }
+
+    private void shutdownExecutor() {
         if (executor != null) {
             
endpoint.getCamelContext().getExecutorServiceStrategy().shutdownNow(executor);
             executor = null;


Reply via email to