avoid java.util.concurrent.RejectedExecutionException on shutdown by bracketing executor usage with started flag

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@832401 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary Tully 2009-11-03 12:25:38 +00:00
parent 8e42528bb2
commit 7f46be934a
1 changed files with 2 additions and 2 deletions

View File

@ -471,7 +471,7 @@ public class MulticastDiscoveryAgent implements DiscoveryAgent, Runnable {
} }
private void fireServiceRemovedEvent(RemoteBrokerData data) { private void fireServiceRemovedEvent(RemoteBrokerData data) {
if (discoveryListener != null) { if (discoveryListener != null && started.get()) {
final DiscoveryEvent event = new DiscoveryEvent(data.service); final DiscoveryEvent event = new DiscoveryEvent(data.service);
event.setBrokerName(data.brokerName); event.setBrokerName(data.brokerName);
@ -490,7 +490,7 @@ public class MulticastDiscoveryAgent implements DiscoveryAgent, Runnable {
} }
private void fireServiceAddEvent(RemoteBrokerData data) { private void fireServiceAddEvent(RemoteBrokerData data) {
if (discoveryListener != null) { if (discoveryListener != null && started.get()) {
final DiscoveryEvent event = new DiscoveryEvent(data.service); final DiscoveryEvent event = new DiscoveryEvent(data.service);
event.setBrokerName(data.brokerName); event.setBrokerName(data.brokerName);