From commits-return-15369-apmail-activemq-commits-archive=activemq.apache.org@activemq.apache.org Thu Jan 13 17:18:35 2011 Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 77132 invoked from network); 13 Jan 2011 17:18:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 13 Jan 2011 17:18:34 -0000 Received: (qmail 37296 invoked by uid 500); 13 Jan 2011 17:18:34 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 37231 invoked by uid 500); 13 Jan 2011 17:18:34 -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 37224 invoked by uid 99); 13 Jan 2011 17:18:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Jan 2011 17:18:34 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.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; Thu, 13 Jan 2011 17:18:33 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 4D8FF23888EC; Thu, 13 Jan 2011 17:18:07 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1058671 - in /activemq/activemq-apollo/trunk: apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/ apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/ apollo-web/src/main/scala/org/apache/activemq/apollo/web/ Date: Thu, 13 Jan 2011 17:18:07 -0000 To: commits@activemq.apache.org From: chirino@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110113171807.4D8FF23888EC@eris.apache.org> Author: chirino Date: Thu Jan 13 17:18:06 2011 New Revision: 1058671 URL: http://svn.apache.org/viewvc?rev=1058671&view=rev Log: Have the broker self register in the broker registry. Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Run.scala activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/ApolloListener.scala Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala?rev=1058671&r1=1058670&r2=1058671&view=diff ============================================================================== --- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala (original) +++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala Thu Jan 13 17:18:06 2011 @@ -243,6 +243,8 @@ class Broker() extends BaseService { } } + BrokerRegistry.add(this) + // Start up the virtual hosts val first_tracker = new LoggingTracker("broker startup", dispatch_queue) val second_tracker = new LoggingTracker("broker startup", dispatch_queue) @@ -284,6 +286,8 @@ class Broker() extends BaseService { if( web_server!=null ) { tracker.stop(web_server) } + + BrokerRegistry.remove(this) tracker.callback(on_completed) } 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=1058671&r1=1058670&r2=1058671&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 Thu Jan 13 17:18:06 2011 @@ -114,8 +114,7 @@ class Run extends Action with Logging { debug("Starting broker"); val broker = new Broker() - broker.config = config - BrokerRegistry.add(broker) + broker.configure(config, LoggingReporter(log)) broker.start(^{ info("Broker started"); }) Modified: activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/ApolloListener.scala URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/ApolloListener.scala?rev=1058671&r1=1058670&r2=1058671&view=diff ============================================================================== --- activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/ApolloListener.scala (original) +++ activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/ApolloListener.scala Thu Jan 13 17:18:06 2011 @@ -45,8 +45,7 @@ class ApolloListener extends ServletCont // Only start the broker up if it's enabled.. info("starting broker"); broker = new Broker() - broker.config = config - BrokerRegistry.add(broker) + broker.configure(config, LoggingReporter(ApolloListener)) broker.start() } } catch { @@ -58,7 +57,6 @@ class ApolloListener extends ServletCont def contextDestroyed(sce: ServletContextEvent) = { if( configStore!=null ) { if( broker!=null ) { - BrokerRegistry.remove(broker); ServiceControl.stop(broker, "broker") } configStore.stop