Return-Path: X-Original-To: apmail-activemq-commits-archive@www.apache.org Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 87D8BD54E for ; Tue, 18 Sep 2012 19:12:18 +0000 (UTC) Received: (qmail 38011 invoked by uid 500); 18 Sep 2012 19:12:18 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 37981 invoked by uid 500); 18 Sep 2012 19:12:18 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 37972 invoked by uid 99); 18 Sep 2012 19:12:18 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Sep 2012 19:12:18 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Sep 2012 19:12:15 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 7F4682388A56 for ; Tue, 18 Sep 2012 19:11:31 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@activemq.apache.org From: chirino@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120918191131.7F4682388A56@eris.apache.org> 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