camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [1/2] camel git commit: CAMEL-9330 : Main - enableHangupSupport should be default enabled
Date Fri, 15 Jan 2016 12:29:14 GMT
Repository: camel
Updated Branches:
  refs/heads/master 812417744 -> d3d75d287


CAMEL-9330 : Main - enableHangupSupport should be default enabled


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/f56df5ee
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/f56df5ee
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/f56df5ee

Branch: refs/heads/master
Commit: f56df5eeaafc11c148c10ab67d21b1f1918e7c0f
Parents: 8124177
Author: lburgazzoli <lburgazzoli@gmail.com>
Authored: Wed Jan 13 17:34:59 2016 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Fri Jan 15 13:27:33 2016 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/camel/main/Main.java   |  1 -
 .../java/org/apache/camel/main/MainSupport.java | 22 ++++++++---------
 .../java/org/apache/camel/main/MainExample.java |  2 --
 .../java/org/apache/camel/main/MainTest.java    | 25 ++++++++++++++++++++
 .../main/java/org/apache/camel/cdi/Main.java    |  1 -
 .../main/java/org/apache/camel/guice/Main.java  |  1 -
 .../component/mail/MapMailMessagesBugRoute.java |  1 -
 .../apache/camel/pgevent/IntegrationTest.java   |  1 -
 .../CamelSpringBootApplicationController.java   |  1 -
 .../apache/camel/spring/javaconfig/Main.java    |  1 -
 .../main/java/org/apache/camel/spring/Main.java |  1 -
 .../org/apache/camel/test/blueprint/Main.java   |  1 -
 .../camel/test/blueprint/MyMainAppTest.java     |  1 -
 .../camel/example/console/CamelConsoleMain.java |  2 --
 .../apache/camel/example/ftp/MyFtpClient.java   |  1 -
 .../apache/camel/example/ftp/MyFtpServer.java   |  1 -
 .../webservice/version/LoanBroker.java          |  1 -
 .../example/splunk/SplunkSavedSearchClient.java |  1 -
 .../example/splunk/SplunkSearchClient.java      |  1 -
 .../websocket/CamelTwitterWebSocketMain.java    |  3 ---
 .../apache/camel/example/widget/WidgetMain.java |  3 ---
 .../src/main/java/MainApp.java                  |  1 -
 .../src/main/java/MainApp.java                  |  1 -
 .../src/main/scala/MyRouteMain.scala            |  2 --
 24 files changed, 36 insertions(+), 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/f56df5ee/camel-core/src/main/java/org/apache/camel/main/Main.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/main/Main.java b/camel-core/src/main/java/org/apache/camel/main/Main.java
index 1a7d74f..5a3287a 100644
--- a/camel-core/src/main/java/org/apache/camel/main/Main.java
+++ b/camel-core/src/main/java/org/apache/camel/main/Main.java
@@ -42,7 +42,6 @@ public class Main extends MainSupport {
     public static void main(String... args) throws Exception {
         Main main = new Main();
         instance = main;
-        main.enableHangupSupport();
         main.run(args);
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/f56df5ee/camel-core/src/main/java/org/apache/camel/main/MainSupport.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/main/MainSupport.java b/camel-core/src/main/java/org/apache/camel/main/MainSupport.java
index 8b42a03..2112444 100644
--- a/camel-core/src/main/java/org/apache/camel/main/MainSupport.java
+++ b/camel-core/src/main/java/org/apache/camel/main/MainSupport.java
@@ -50,6 +50,7 @@ public abstract class MainSupport extends ServiceSupport {
     protected final List<Option> options = new ArrayList<Option>();
     protected final CountDownLatch latch = new CountDownLatch(1);
     protected final AtomicBoolean completed = new AtomicBoolean(false);
+    protected final HangupInterceptor hangupInterceptor = new HangupInterceptor();
     protected long duration = -1;
     protected TimeUnit timeUnit = TimeUnit.MILLISECONDS;
     protected boolean trace;
@@ -61,19 +62,14 @@ public abstract class MainSupport extends ServiceSupport {
     /**
      * A class for intercepting the hang up signal and do a graceful shutdown of the Camel.
      */
-    private static final class HangupInterceptor extends Thread {
+    private final class HangupInterceptor extends Thread {
         Logger log = LoggerFactory.getLogger(this.getClass());
-        MainSupport mainInstance;
-
-        public HangupInterceptor(MainSupport main) {
-            mainInstance = main;
-        }
 
         @Override
         public void run() {
             log.info("Received hang up - stopping the main instance.");
             try {
-                mainInstance.stop();
+                MainSupport.this.stop();
             } catch (Exception ex) {
                 log.warn("Error during stopping the main instance.", ex);
             }
@@ -112,6 +108,8 @@ public abstract class MainSupport extends ServiceSupport {
                 enableTrace();
             }
         });
+
+        Runtime.getRuntime().addShutdownHook(hangupInterceptor);
     }
 
     /**
@@ -137,12 +135,14 @@ public abstract class MainSupport extends ServiceSupport {
     }
 
     /**
-     * Enables the hangup support. Gracefully stops by calling stop() on a
+     * Disable the hangup support. No graceful stop by calling stop() on a
      * Hangup signal.
      */
-    public void enableHangupSupport() {
-        HangupInterceptor interceptor = new HangupInterceptor(this);
-        Runtime.getRuntime().addShutdownHook(interceptor);
+    public void disableHangupSupport() {
+        boolean result = Runtime.getRuntime().removeShutdownHook(hangupInterceptor);
+        if (LOG.isDebugEnabled() && result) {
+            LOG.debug("HangupInterceptor ({}) successfully removed", hangupInterceptor);
+        }
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/camel/blob/f56df5ee/camel-core/src/test/java/org/apache/camel/main/MainExample.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/main/MainExample.java b/camel-core/src/test/java/org/apache/camel/main/MainExample.java
index d5160a9..e4c7303 100644
--- a/camel-core/src/test/java/org/apache/camel/main/MainExample.java
+++ b/camel-core/src/test/java/org/apache/camel/main/MainExample.java
@@ -38,8 +38,6 @@ public class MainExample {
     public void boot() throws Exception {
         // create a Main instance
         main = new Main();
-        // enable hangup support so you can press ctrl + c to terminate the JVM
-        main.enableHangupSupport();
         // bind MyBean into the registry
         main.bind("foo", new MyBean());
         // add routes

http://git-wip-us.apache.org/repos/asf/camel/blob/f56df5ee/camel-core/src/test/java/org/apache/camel/main/MainTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/main/MainTest.java b/camel-core/src/test/java/org/apache/camel/main/MainTest.java
index 132c5dc..b548efc 100644
--- a/camel-core/src/test/java/org/apache/camel/main/MainTest.java
+++ b/camel-core/src/test/java/org/apache/camel/main/MainTest.java
@@ -51,6 +51,31 @@ public class MainTest extends TestCase {
 
         main.stop();
     }
+
+    public void testDisableHangupSupport() throws Exception {
+        // lets make a simple route
+        Main main = new Main();
+        main.addRouteBuilder(new MyRouteBuilder());
+        main.disableHangupSupport();
+        main.enableTrace();
+        main.bind("foo", new Integer(31));
+        main.start();
+
+        List<CamelContext> contextList = main.getCamelContexts();
+        assertNotNull(contextList);
+        assertEquals("Did not get the expected count of Camel contexts", 1, contextList.size());
+        CamelContext camelContext = contextList.get(0);
+        assertEquals("Could not find the registry bound object", 31, camelContext.getRegistry().lookupByName("foo"));
+
+        MockEndpoint endpoint = camelContext.getEndpoint("mock:results", MockEndpoint.class);
+        endpoint.expectedMinimumMessageCount(1);
+
+        main.getCamelTemplate().sendBody("direct:start", "<message>1</message>");
+
+        endpoint.assertIsSatisfied();
+
+        main.stop();
+    }
     
     public void testLoadingRouteFromCommand() throws Exception {
         Main main = new Main();

http://git-wip-us.apache.org/repos/asf/camel/blob/f56df5ee/components/camel-cdi/src/main/java/org/apache/camel/cdi/Main.java
----------------------------------------------------------------------
diff --git a/components/camel-cdi/src/main/java/org/apache/camel/cdi/Main.java b/components/camel-cdi/src/main/java/org/apache/camel/cdi/Main.java
index 61148ac..0532870 100644
--- a/components/camel-cdi/src/main/java/org/apache/camel/cdi/Main.java
+++ b/components/camel-cdi/src/main/java/org/apache/camel/cdi/Main.java
@@ -43,7 +43,6 @@ public abstract class Main extends MainSupport { // abstract to prevent
cdi mana
     public static void main(String... args) throws Exception {
         Main main = new Main() { };
         instance = main;
-        main.enableHangupSupport();
         main.run(args);
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/f56df5ee/components/camel-guice/src/main/java/org/apache/camel/guice/Main.java
----------------------------------------------------------------------
diff --git a/components/camel-guice/src/main/java/org/apache/camel/guice/Main.java b/components/camel-guice/src/main/java/org/apache/camel/guice/Main.java
index d336227..2f9d161 100644
--- a/components/camel-guice/src/main/java/org/apache/camel/guice/Main.java
+++ b/components/camel-guice/src/main/java/org/apache/camel/guice/Main.java
@@ -70,7 +70,6 @@ public class Main extends MainSupport {
     public static void main(String... args) throws Exception {
         Main main = new Main();
         instance = main;
-        main.enableHangupSupport();
         main.run(args);
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/f56df5ee/components/camel-mail/src/test/java/org/apache/camel/component/mail/MapMailMessagesBugRoute.java
----------------------------------------------------------------------
diff --git a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MapMailMessagesBugRoute.java
b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MapMailMessagesBugRoute.java
index b7d9c75..a2ba1af 100644
--- a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MapMailMessagesBugRoute.java
+++ b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MapMailMessagesBugRoute.java
@@ -30,7 +30,6 @@ public class MapMailMessagesBugRoute extends RouteBuilder {
 
     public static void main(String... args) throws Exception {
         Main main = new Main();
-        main.enableHangupSupport();
         main.addRouteBuilder(new MapMailMessagesBugRoute());
         main.run(args);
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/f56df5ee/components/camel-pgevent/src/test/java/org/apache/camel/pgevent/IntegrationTest.java
----------------------------------------------------------------------
diff --git a/components/camel-pgevent/src/test/java/org/apache/camel/pgevent/IntegrationTest.java
b/components/camel-pgevent/src/test/java/org/apache/camel/pgevent/IntegrationTest.java
index 9e6f8d8..7f525ba 100644
--- a/components/camel-pgevent/src/test/java/org/apache/camel/pgevent/IntegrationTest.java
+++ b/components/camel-pgevent/src/test/java/org/apache/camel/pgevent/IntegrationTest.java
@@ -53,7 +53,6 @@ public class IntegrationTest {
         }
 
         main = new Main();
-        main.enableHangupSupport();
         main.bind("test", ds);
         main.addRouteBuilder(buildConsumer());
         main.addRouteBuilder(buildProducer());

http://git-wip-us.apache.org/repos/asf/camel/blob/f56df5ee/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelSpringBootApplicationController.java
----------------------------------------------------------------------
diff --git a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelSpringBootApplicationController.java
b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelSpringBootApplicationController.java
index 067edc9..abafd8a 100644
--- a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelSpringBootApplicationController.java
+++ b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelSpringBootApplicationController.java
@@ -46,7 +46,6 @@ public class CamelSpringBootApplicationController {
 
     public void blockMainThread() {
         try {
-            mainSupport.enableHangupSupport();
             mainSupport.run();
         } catch (Exception e) {
             throw new RuntimeException(e);

http://git-wip-us.apache.org/repos/asf/camel/blob/f56df5ee/components/camel-spring-javaconfig/src/main/java/org/apache/camel/spring/javaconfig/Main.java
----------------------------------------------------------------------
diff --git a/components/camel-spring-javaconfig/src/main/java/org/apache/camel/spring/javaconfig/Main.java
b/components/camel-spring-javaconfig/src/main/java/org/apache/camel/spring/javaconfig/Main.java
index 6a73c1f..0d63c4e 100644
--- a/components/camel-spring-javaconfig/src/main/java/org/apache/camel/spring/javaconfig/Main.java
+++ b/components/camel-spring-javaconfig/src/main/java/org/apache/camel/spring/javaconfig/Main.java
@@ -54,7 +54,6 @@ public class Main extends org.apache.camel.spring.Main {
     public static void main(String... args) throws Exception {
         Main main = new Main();
         instance = main;
-        main.enableHangupSupport();
         main.run(args);
     }
     

http://git-wip-us.apache.org/repos/asf/camel/blob/f56df5ee/components/camel-spring/src/main/java/org/apache/camel/spring/Main.java
----------------------------------------------------------------------
diff --git a/components/camel-spring/src/main/java/org/apache/camel/spring/Main.java b/components/camel-spring/src/main/java/org/apache/camel/spring/Main.java
index a24e3f9..1b45e8d 100644
--- a/components/camel-spring/src/main/java/org/apache/camel/spring/Main.java
+++ b/components/camel-spring/src/main/java/org/apache/camel/spring/Main.java
@@ -83,7 +83,6 @@ public class Main extends MainSupport {
     public static void main(String... args) throws Exception {
         Main main = new Main();
         instance = main;
-        main.enableHangupSupport();
         main.run(args);
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/f56df5ee/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/Main.java
----------------------------------------------------------------------
diff --git a/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/Main.java
b/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/Main.java
index 15f16be..a0be881 100644
--- a/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/Main.java
+++ b/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/Main.java
@@ -76,7 +76,6 @@ public class Main extends MainSupport {
 
     public static void main(String... args) throws Exception {
         Main main = new Main();
-        main.enableHangupSupport();
         main.run(args);
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/f56df5ee/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/MyMainAppTest.java
----------------------------------------------------------------------
diff --git a/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/MyMainAppTest.java
b/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/MyMainAppTest.java
index f417dd4..b3fe091 100644
--- a/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/MyMainAppTest.java
+++ b/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/MyMainAppTest.java
@@ -52,7 +52,6 @@ public class MyMainAppTest {
         main.setIncludeSelfAsBundle(true);
         // we support *.xml to find any blueprint xml files
         main.setDescriptors("org/apache/camel/test/blueprint/xpath/*.xml");
-        main.enableHangupSupport();
 
         // run for 1 second and then stop automatic
         main.setDuration(1000);

http://git-wip-us.apache.org/repos/asf/camel/blob/f56df5ee/examples/camel-example-console/src/main/java/org/apache/camel/example/console/CamelConsoleMain.java
----------------------------------------------------------------------
diff --git a/examples/camel-example-console/src/main/java/org/apache/camel/example/console/CamelConsoleMain.java
b/examples/camel-example-console/src/main/java/org/apache/camel/example/console/CamelConsoleMain.java
index 527950a..98f6298 100644
--- a/examples/camel-example-console/src/main/java/org/apache/camel/example/console/CamelConsoleMain.java
+++ b/examples/camel-example-console/src/main/java/org/apache/camel/example/console/CamelConsoleMain.java
@@ -31,8 +31,6 @@ public final class CamelConsoleMain {
         Main main = new Main();
         // configure the location of the Spring XML file
         main.setApplicationContextUri("META-INF/spring/camel-context.xml");
-        // enable hangup support allows Camel to detect when the JVM is terminated
-        main.enableHangupSupport();
         // run and block until Camel is stopped (or JVM terminated)
         main.run();
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/f56df5ee/examples/camel-example-ftp/src/main/java/org/apache/camel/example/ftp/MyFtpClient.java
----------------------------------------------------------------------
diff --git a/examples/camel-example-ftp/src/main/java/org/apache/camel/example/ftp/MyFtpClient.java
b/examples/camel-example-ftp/src/main/java/org/apache/camel/example/ftp/MyFtpClient.java
index 41ffca9..5902d32 100644
--- a/examples/camel-example-ftp/src/main/java/org/apache/camel/example/ftp/MyFtpClient.java
+++ b/examples/camel-example-ftp/src/main/java/org/apache/camel/example/ftp/MyFtpClient.java
@@ -29,7 +29,6 @@ public final class MyFtpClient {
     public static void main(String[] args) throws Exception {
         Main main = new Main();
         main.addRouteBuilder(new MyFtpClientRouteBuilder());
-        main.enableHangupSupport();
         main.run();
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/f56df5ee/examples/camel-example-ftp/src/main/java/org/apache/camel/example/ftp/MyFtpServer.java
----------------------------------------------------------------------
diff --git a/examples/camel-example-ftp/src/main/java/org/apache/camel/example/ftp/MyFtpServer.java
b/examples/camel-example-ftp/src/main/java/org/apache/camel/example/ftp/MyFtpServer.java
index 8ad29ed..976d1bc 100644
--- a/examples/camel-example-ftp/src/main/java/org/apache/camel/example/ftp/MyFtpServer.java
+++ b/examples/camel-example-ftp/src/main/java/org/apache/camel/example/ftp/MyFtpServer.java
@@ -29,7 +29,6 @@ public final class MyFtpServer {
     public static void main(String[] args) throws Exception {
         Main main = new Main();
         main.addRouteBuilder(new MyFtpServerRouteBuilder());
-        main.enableHangupSupport();
         main.run();
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/f56df5ee/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/LoanBroker.java
----------------------------------------------------------------------
diff --git a/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/LoanBroker.java
b/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/LoanBroker.java
index e406ede..ac2cfd8 100644
--- a/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/LoanBroker.java
+++ b/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/LoanBroker.java
@@ -31,7 +31,6 @@ public final class LoanBroker {
         // create a new main which will boot the Spring XML file
         Main main = new Main();
         main.setApplicationContext(new ClassPathXmlApplicationContext("META-INF/spring/webServiceCamelContext.xml"));
-        main.enableHangupSupport();
         main.run();
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/f56df5ee/examples/camel-example-splunk/src/main/java/org/apache/camel/example/splunk/SplunkSavedSearchClient.java
----------------------------------------------------------------------
diff --git a/examples/camel-example-splunk/src/main/java/org/apache/camel/example/splunk/SplunkSavedSearchClient.java
b/examples/camel-example-splunk/src/main/java/org/apache/camel/example/splunk/SplunkSavedSearchClient.java
index 8ad629d..9fe1ea2 100644
--- a/examples/camel-example-splunk/src/main/java/org/apache/camel/example/splunk/SplunkSavedSearchClient.java
+++ b/examples/camel-example-splunk/src/main/java/org/apache/camel/example/splunk/SplunkSavedSearchClient.java
@@ -30,7 +30,6 @@ public final class SplunkSavedSearchClient {
         LOG.info("About to run splunk-camel integration...");
         Main main = new Main();
         main.addRouteBuilder(new SplunkSavedSearchRouteBuilder());
-        main.enableHangupSupport();
         main.run();
     }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/f56df5ee/examples/camel-example-splunk/src/main/java/org/apache/camel/example/splunk/SplunkSearchClient.java
----------------------------------------------------------------------
diff --git a/examples/camel-example-splunk/src/main/java/org/apache/camel/example/splunk/SplunkSearchClient.java
b/examples/camel-example-splunk/src/main/java/org/apache/camel/example/splunk/SplunkSearchClient.java
index 763ea3d..c13c8e2 100644
--- a/examples/camel-example-splunk/src/main/java/org/apache/camel/example/splunk/SplunkSearchClient.java
+++ b/examples/camel-example-splunk/src/main/java/org/apache/camel/example/splunk/SplunkSearchClient.java
@@ -30,7 +30,6 @@ public final class SplunkSearchClient {
         LOG.info("About to run splunk-camel integration...");
         Main main = new Main();
         main.addRouteBuilder(new SplunkSearchRouteBuilder());
-        main.enableHangupSupport();
         main.run();
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/f56df5ee/examples/camel-example-twitter-websocket/src/main/java/org/apache/camel/example/websocket/CamelTwitterWebSocketMain.java
----------------------------------------------------------------------
diff --git a/examples/camel-example-twitter-websocket/src/main/java/org/apache/camel/example/websocket/CamelTwitterWebSocketMain.java
b/examples/camel-example-twitter-websocket/src/main/java/org/apache/camel/example/websocket/CamelTwitterWebSocketMain.java
index 827a8e9..50b2e33 100644
--- a/examples/camel-example-twitter-websocket/src/main/java/org/apache/camel/example/websocket/CamelTwitterWebSocketMain.java
+++ b/examples/camel-example-twitter-websocket/src/main/java/org/apache/camel/example/websocket/CamelTwitterWebSocketMain.java
@@ -50,9 +50,6 @@ public final class CamelTwitterWebSocketMain {
         // create a new Camel Main so we can easily start Camel
         Main main = new Main();
 
-        // enable hangup support which mean we detect when the JVM terminates, and stop Camel
graceful
-        main.enableHangupSupport();
-
         TwitterWebSocketRoute route = new TwitterWebSocketRoute();
 
         // setup twitter application authentication

http://git-wip-us.apache.org/repos/asf/camel/blob/f56df5ee/examples/camel-example-widget-gadget-java/src/main/java/org/apache/camel/example/widget/WidgetMain.java
----------------------------------------------------------------------
diff --git a/examples/camel-example-widget-gadget-java/src/main/java/org/apache/camel/example/widget/WidgetMain.java
b/examples/camel-example-widget-gadget-java/src/main/java/org/apache/camel/example/widget/WidgetMain.java
index 02404ea..420e483 100644
--- a/examples/camel-example-widget-gadget-java/src/main/java/org/apache/camel/example/widget/WidgetMain.java
+++ b/examples/camel-example-widget-gadget-java/src/main/java/org/apache/camel/example/widget/WidgetMain.java
@@ -37,9 +37,6 @@ public class WidgetMain {
         // add a 2nd route that routes files from src/main/data to the order queue
         main.addRouteBuilder(new CreateOrderRoute());
 
-        // allow to graceful shutdown when the JVM is terminated
-        main.enableHangupSupport();
-
         // start and run Camel (block)
         main.run();
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/f56df5ee/tooling/archetypes/camel-archetype-groovy/src/main/resources/archetype-resources/src/main/java/MainApp.java
----------------------------------------------------------------------
diff --git a/tooling/archetypes/camel-archetype-groovy/src/main/resources/archetype-resources/src/main/java/MainApp.java
b/tooling/archetypes/camel-archetype-groovy/src/main/resources/archetype-resources/src/main/java/MainApp.java
index 8fa1a51..238b91c 100644
--- a/tooling/archetypes/camel-archetype-groovy/src/main/resources/archetype-resources/src/main/java/MainApp.java
+++ b/tooling/archetypes/camel-archetype-groovy/src/main/resources/archetype-resources/src/main/java/MainApp.java
@@ -36,7 +36,6 @@ public class MainApp {
         System.out.println("\n\n\n\n");
 
         Main main = new Main();
-        main.enableHangupSupport();
         main.addRouteBuilder(new MyRouteBuilder());
         main.run(args);
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/f56df5ee/tooling/archetypes/camel-archetype-java/src/main/resources/archetype-resources/src/main/java/MainApp.java
----------------------------------------------------------------------
diff --git a/tooling/archetypes/camel-archetype-java/src/main/resources/archetype-resources/src/main/java/MainApp.java
b/tooling/archetypes/camel-archetype-java/src/main/resources/archetype-resources/src/main/java/MainApp.java
index 0df78da..45c54e2 100644
--- a/tooling/archetypes/camel-archetype-java/src/main/resources/archetype-resources/src/main/java/MainApp.java
+++ b/tooling/archetypes/camel-archetype-java/src/main/resources/archetype-resources/src/main/java/MainApp.java
@@ -28,7 +28,6 @@ public class MainApp {
      */
     public static void main(String... args) throws Exception {
         Main main = new Main();
-        main.enableHangupSupport();
         main.addRouteBuilder(new MyRouteBuilder());
         main.run(args);
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/f56df5ee/tooling/archetypes/camel-archetype-scala/src/main/resources/archetype-resources/src/main/scala/MyRouteMain.scala
----------------------------------------------------------------------
diff --git a/tooling/archetypes/camel-archetype-scala/src/main/resources/archetype-resources/src/main/scala/MyRouteMain.scala
b/tooling/archetypes/camel-archetype-scala/src/main/resources/archetype-resources/src/main/scala/MyRouteMain.scala
index 46c78c3..c872d49 100644
--- a/tooling/archetypes/camel-archetype-scala/src/main/resources/archetype-resources/src/main/scala/MyRouteMain.scala
+++ b/tooling/archetypes/camel-archetype-scala/src/main/resources/archetype-resources/src/main/scala/MyRouteMain.scala
@@ -26,8 +26,6 @@ object MyRouteMain extends RouteBuilderSupport {
 
   def main(args: Array[String]) {
     val main = new Main()
-    // enable hangup support so you need to use ctrl + c to stop the running app
-    main.enableHangupSupport()
     // create the CamelContext
     val context = main.getOrCreateCamelContext()
     // add our route using the created CamelContext


Mime
View raw message