activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1387325 - in /activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker: LocalRouter.scala Queue.scala Topic.scala
Date Tue, 18 Sep 2012 19:11:31 GMT
Author: chirino
Date: Tue Sep 18 19:11:30 2012
New Revision: 1387325

URL: http://svn.apache.org/viewvc?rev=1387325&view=rev
Log:
Fixes the NPEs that were occurring during the unit tests.

Modified:
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/LocalRouter.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Topic.scala

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/LocalRouter.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/LocalRouter.scala?rev=1387325&r1=1387324&r2=1387325&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/LocalRouter.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/LocalRouter.scala
Tue Sep 18 19:11:30 2012
@@ -1316,6 +1316,7 @@ class LocalRouter(val virtual_host:Virtu
   }
 
   def _destroy_queue(queue: Queue) {
+    assert(service_state.is_starting_or_started, "Can't destroy.. allready stopped")
     on_queue_destroy_start
     queue.stop(^{
       var metrics = queue.get_queue_metrics
@@ -1336,11 +1337,9 @@ class LocalRouter(val virtual_host:Virtu
 
         queues_by_store_id.remove(queue.store_id)
         if (queue.tune_persistent) {
-          queue.dispatch_queue {
-            virtual_host.store.remove_queue(queue.store_id) { x =>
-              dispatch_queue {
-                on_queue_destroy_end
-              }
+          virtual_host.store.remove_queue(queue.store_id) { x =>
+            dispatch_queue {
+              on_queue_destroy_end
             }
           }
         } else {

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala?rev=1387325&r1=1387324&r2=1387325&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala
Tue Sep 18 19:11:30 2012
@@ -439,7 +439,9 @@ class Queue(val router: LocalRouter, val
           // Have we been idle that whole time?
           if( idled_at == idled_at_start ) {
             virtual_host.dispatch_queue {
-              router._destroy_queue(this)
+              if( virtual_host.service_state.is_started ) {
+                router._destroy_queue(this)
+              }
             }
           }
         }

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Topic.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Topic.scala?rev=1387325&r1=1387324&r2=1387325&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Topic.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Topic.scala
Tue Sep 18 19:11:30 2012
@@ -488,7 +488,9 @@ class Topic(val router:LocalRouter, val 
             if( queue.all_subscriptions.isEmpty ) {
               val metrics = queue.get_queue_metrics
               router.dispatch_queue {
-                router._destroy_queue(queue)
+                if(router.service_state.is_started) {
+                  router._destroy_queue(queue)
+                }
               }
               dispatch_queue {
                 topic_metrics.dequeue_item_counter += metrics.dequeue_item_counter



Mime
View raw message