Return-Path: X-Original-To: apmail-activemq-users-archive@www.apache.org Delivered-To: apmail-activemq-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C5BA982CC for ; Mon, 5 Sep 2011 04:14:02 +0000 (UTC) Received: (qmail 80420 invoked by uid 500); 5 Sep 2011 04:14:01 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 79977 invoked by uid 500); 5 Sep 2011 04:13:51 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 79938 invoked by uid 99); 5 Sep 2011 04:13:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Sep 2011 04:13:43 +0000 X-ASF-Spam-Status: No, hits=1.3 required=5.0 tests=SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of neek@nickfenwick.com designates 216.139.236.26 as permitted sender) Received: from [216.139.236.26] (HELO sam.nabble.com) (216.139.236.26) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Sep 2011 04:13:35 +0000 Received: from joe.nabble.com ([192.168.236.139]) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1R0QYc-0008Uc-Je for users@activemq.apache.org; Sun, 04 Sep 2011 21:13:14 -0700 Date: Sun, 4 Sep 2011 21:13:14 -0700 (PDT) From: neek To: users@activemq.apache.org Message-ID: <1315195994597-3790341.post@n4.nabble.com> In-Reply-To: References: <1314942074625-3785326.post@n4.nabble.com> Subject: Re: Stopping an embedded Broker (due to webapp reload) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Thanks Dejan. So just to clarify: private BrokerService service = BrokerFactory.createBroker("xbean:activemq.xml"); public void init(ServletConfig config) throws ServletException { service = BrokerFactory.createBroker("xbean:activemq.xml"); service.start(); service.waitUntilStarted(); } public void destroy() { service.stop(); service.waitUntilStopped(); service = null; } Might be worth setting to null in destroy() just in case the finalization or garbage collection of the servlet isn't prompt. Cheers Nick -- View this message in context: http://activemq.2283324.n4.nabble.com/Stopping-an-embedded-Broker-due-to-webapp-reload-tp3785326p3790341.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.