activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From neek <n...@nickfenwick.com>
Subject Re: Stopping an embedded Broker (due to webapp reload)
Date Mon, 05 Sep 2011 04:13:14 GMT
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.

Mime
View raw message