mirror of https://github.com/apache/activemq.git
This commit is contained in:
parent
55da9bc821
commit
713250f5f0
|
@ -583,6 +583,8 @@ public abstract class AbstractRegion implements Region {
|
|||
}
|
||||
|
||||
public void reapplyInterceptor() {
|
||||
destinationsLock.writeLock().lock();
|
||||
try {
|
||||
DestinationInterceptor destinationInterceptor = broker.getDestinationInterceptor();
|
||||
Map<ActiveMQDestination, Destination> map = getDestinationMap();
|
||||
for (ActiveMQDestination key : map.keySet()) {
|
||||
|
@ -590,9 +592,14 @@ public abstract class AbstractRegion implements Region {
|
|||
if (destination instanceof CompositeDestinationFilter) {
|
||||
destination = ((CompositeDestinationFilter) destination).next;
|
||||
}
|
||||
if (destinationInterceptor != null) {
|
||||
destination = destinationInterceptor.intercept(destination);
|
||||
}
|
||||
getDestinationMap().put(key, destination);
|
||||
destinations.put(key, destination);
|
||||
}
|
||||
} finally {
|
||||
destinationsLock.writeLock().unlock();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -552,6 +552,7 @@ public class RuntimeConfigurationBroker extends BrokerFilter {
|
|||
public void run() {
|
||||
|
||||
boolean updatedExistingInterceptor = false;
|
||||
RegionBroker regionBroker = (RegionBroker) getBrokerService().getRegionBroker();
|
||||
|
||||
for (DestinationInterceptor destinationInterceptor : getBrokerService().getDestinationInterceptors()) {
|
||||
if (destinationInterceptor instanceof VirtualDestinationInterceptor) {
|
||||
|
@ -577,11 +578,11 @@ public class RuntimeConfigurationBroker extends BrokerFilter {
|
|||
|
||||
DestinationInterceptor[] destinationInterceptors = interceptorsList.toArray(new DestinationInterceptor[]{});
|
||||
getBrokerService().setDestinationInterceptors(destinationInterceptors);
|
||||
RegionBroker regionBroker = (RegionBroker) getBrokerService().getRegionBroker();
|
||||
|
||||
((CompositeDestinationInterceptor) regionBroker.getDestinationInterceptor()).setInterceptors(destinationInterceptors);
|
||||
info("applied new: " + interceptorsList);
|
||||
regionBroker.reapplyInterceptor();
|
||||
}
|
||||
regionBroker.reapplyInterceptor();
|
||||
}
|
||||
});
|
||||
} else if (o instanceof DtoPolicyEntry) {
|
||||
|
|
Loading…
Reference in New Issue