[jboss-cvs] JBoss Messaging SVN: r6856 - trunk/src/main/org/jboss/messaging/integration/bootstrap.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon May 18 17:42:05 EDT 2009


Author: clebert.suconic at jboss.com
Date: 2009-05-18 17:42:05 -0400 (Mon, 18 May 2009)
New Revision: 6856

Modified:
   trunk/src/main/org/jboss/messaging/integration/bootstrap/JBMBootstrapServer.java
Log:
Simple tweak. (Making addShutdownHook reusable for users who are embedding JBM also).

Modified: trunk/src/main/org/jboss/messaging/integration/bootstrap/JBMBootstrapServer.java
===================================================================
--- trunk/src/main/org/jboss/messaging/integration/bootstrap/JBMBootstrapServer.java	2009-05-18 18:52:15 UTC (rev 6855)
+++ trunk/src/main/org/jboss/messaging/integration/bootstrap/JBMBootstrapServer.java	2009-05-18 21:42:05 UTC (rev 6856)
@@ -76,6 +76,15 @@
       final JBMBootstrapServer bootstrap = new JBMBootstrapServer(args);
       
       bootstrap.run();
+      
+      bootstrap.addShutdownHook();
+   }
+   
+   /**
+    * Add a simple shutdown hook to stop the server.
+    */
+   public void addShutdownHook()
+   {
       String dirName = System.getProperty("jbm.bootsrap.bin.dir", ".");
       final File file = new File(dirName + "/KILL_ME");
       if(file.exists())
@@ -93,7 +102,7 @@
                try
                {
                   log.info("Stopping JBoss Messaging Server");
-                  bootstrap.shutDown();
+                  shutDown();
                   timer.cancel();
                }
                finally




More information about the jboss-cvs-commits mailing list