mirror of https://github.com/apache/activemq.git
https://issues.apache.org/jira/browse/AMQ-4034 - osgi restart broker properly when pid properties changes
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1441435 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
88beb15763
commit
acd1eda402
|
@ -46,6 +46,10 @@ public class ActiveMQServiceFactory implements ManagedServiceFactory {
|
|||
|
||||
@Override
|
||||
synchronized public void updated(String pid, Dictionary properties) throws ConfigurationException {
|
||||
|
||||
// First stop currently running broker (if any)
|
||||
deleted(pid);
|
||||
|
||||
String config = (String)properties.get("config");
|
||||
if (config == null) {
|
||||
throw new ConfigurationException("config", "Property must be set");
|
||||
|
@ -106,13 +110,12 @@ public class ActiveMQServiceFactory implements ManagedServiceFactory {
|
|||
|
||||
@Override
|
||||
synchronized public void deleted(String pid) {
|
||||
LOG.info("Stopping broker " + pid);
|
||||
BrokerService broker = brokers.get(pid);
|
||||
if (broker == null) {
|
||||
LOG.warn("Broker " + pid + " not found");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
LOG.info("Stopping broker " + pid);
|
||||
broker.stop();
|
||||
broker.waitUntilStopped();
|
||||
} catch (Exception e) {
|
||||
|
|
Loading…
Reference in New Issue