activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1147693 - in /activemq/activemq-apollo/trunk: apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/ apollo-util/src/main/scala/org/apache/activemq/apollo/util/
Date Sun, 17 Jul 2011 18:28:29 GMT
Author: chirino
Date: Sun Jul 17 18:28:29 2011
New Revision: 1147693

URL: http://svn.apache.org/viewvc?rev=1147693&view=rev
Log:
Fixes issue where broker was not shutting down when it received a CTRL-C.

Modified:
    activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Run.scala
    activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/FileCache.scala
    activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/ServiceController.scala

Modified: activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Run.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Run.scala?rev=1147693&r1=1147692&r2=1147693&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Run.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Run.scala
Sun Jul 17 18:28:29 2011
@@ -131,10 +131,10 @@ class Run extends Action {
 
       Runtime.getRuntime.addShutdownHook(new Thread(){
         override def run: Unit = {
-          if(jul_config_monitor!=null) ServiceControl.stop(jul_config_monitor, "stopping
config monitor")
-          ServiceControl.stop(log4j_config_monitor, "stopping config monitor")
-          ServiceControl.stop(broker_config_monitor, "stopping config monitor")
-          ServiceControl.stop(broker, "stopping broker")
+          var services = List(log4j_config_monitor, broker_config_monitor, broker)
+          if(jul_config_monitor!=null)
+            services ::= jul_config_monitor
+          ServiceControl.stop(services, "stopping broker")
         }
       })
 

Modified: activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/FileCache.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/FileCache.scala?rev=1147693&r1=1147692&r2=1147693&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/FileCache.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/FileCache.scala
Sun Jul 17 18:28:29 2011
@@ -40,6 +40,7 @@ class FileMonitor(file:File, change_list
 
   protected def _stop(on_completed: Runnable) = {
     state_ver+=1
+    on_completed.run()
   }
 
   protected def _start(on_completed: Runnable) = {
@@ -47,6 +48,7 @@ class FileMonitor(file:File, change_list
     last_modified = file.lastModified()
     state_ver+=1
     update_check(state_ver)
+    on_completed.run()
   }
 
   private def update_check(ver:Int):Unit = {

Modified: activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/ServiceController.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/ServiceController.scala?rev=1147693&r1=1147692&r2=1147693&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/ServiceController.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/ServiceController.scala
Sun Jul 17 18:28:29 2011
@@ -33,17 +33,17 @@ object ServiceControl {
   }
 
   // start or stop a bunch of services in one go
-  private def controlServices(start: Boolean, services: ListBuffer[Service], action: String)
= {
+  private def controlServices(start: Boolean, services: Seq[Service], action: String) = {
     val tracker = new LoggingTracker(action)
     services.foreach(service => {if (start) tracker.start(service) else tracker.stop(service)})
     tracker.await
   }
 
-  def start(services: ListBuffer[Service], action: String) = {
+  def start(services: Seq[Service], action: String) = {
     controlServices(true, services, action)
   }
 
-  def stop(services: ListBuffer[Service], action: String) = {
+  def stop(services: Seq[Service], action: String) = {
     controlServices(false, services, action)
   }
 



Mime
View raw message