mirror of https://github.com/apache/activemq.git
Added getDurableDestinations() to Broker - to make accessable for NetworkConnectors
git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@377412 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f787e20139
commit
debd0cc241
|
@ -16,6 +16,7 @@
|
|||
*/
|
||||
package org.apache.activemq.broker;
|
||||
|
||||
import java.util.Set;
|
||||
import org.apache.activemq.Service;
|
||||
import org.apache.activemq.broker.region.Region;
|
||||
import org.apache.activemq.command.ActiveMQDestination;
|
||||
|
@ -206,4 +207,9 @@ public interface Broker extends Region, Service {
|
|||
*/
|
||||
public boolean isStopped();
|
||||
|
||||
/**
|
||||
* @return a Set of all durable destinations
|
||||
*/
|
||||
public Set getDurableDestinations();
|
||||
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
*/
|
||||
package org.apache.activemq.broker;
|
||||
|
||||
import java.util.Set;
|
||||
import org.apache.activemq.broker.region.Destination;
|
||||
import org.apache.activemq.command.ActiveMQDestination;
|
||||
import org.apache.activemq.command.BrokerId;
|
||||
|
@ -188,4 +189,8 @@ public class BrokerFilter implements Broker {
|
|||
return next.isStopped();
|
||||
}
|
||||
|
||||
public Set getDurableDestinations(){
|
||||
return next.getDurableDestinations();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
*/
|
||||
package org.apache.activemq.broker;
|
||||
|
||||
import java.util.Set;
|
||||
import org.apache.activemq.broker.region.Destination;
|
||||
import org.apache.activemq.command.ActiveMQDestination;
|
||||
import org.apache.activemq.command.BrokerId;
|
||||
|
@ -186,4 +187,8 @@ public class EmptyBroker implements Broker{
|
|||
return false;
|
||||
}
|
||||
|
||||
public Set getDurableDestinations(){
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
*/
|
||||
package org.apache.activemq.broker;
|
||||
|
||||
import java.util.Set;
|
||||
import org.apache.activemq.broker.region.Destination;
|
||||
import org.apache.activemq.command.ActiveMQDestination;
|
||||
import org.apache.activemq.command.BrokerId;
|
||||
|
@ -184,5 +185,9 @@ public class ErrorBroker implements Broker {
|
|||
return true;
|
||||
}
|
||||
|
||||
public Set getDurableDestinations(){
|
||||
throw new IllegalStateException(this.message);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
*/
|
||||
package org.apache.activemq.broker;
|
||||
|
||||
import java.util.Set;
|
||||
import org.apache.activemq.broker.region.Destination;
|
||||
import org.apache.activemq.command.ActiveMQDestination;
|
||||
import org.apache.activemq.command.BrokerId;
|
||||
|
@ -198,4 +199,8 @@ public class MutableBrokerFilter implements Broker {
|
|||
return getNext().isStopped();
|
||||
}
|
||||
|
||||
public Set getDurableDestinations(){
|
||||
return getNext().getDurableDestinations();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -52,6 +52,7 @@ import java.io.IOException;
|
|||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Routes Broker operations to the correct messaging regions for processing.
|
||||
|
@ -79,6 +80,7 @@ public class RegionBroker implements Broker {
|
|||
private BrokerId brokerId;
|
||||
private String brokerName;
|
||||
private Map clientIdSet = new HashMap(); // we will synchronize access
|
||||
private PersistenceAdapter adaptor;
|
||||
|
||||
public RegionBroker(BrokerService brokerService,TaskRunnerFactory taskRunnerFactory, UsageManager memoryManager, PersistenceAdapter adapter) throws IOException {
|
||||
this(brokerService,taskRunnerFactory, memoryManager, createDefaultPersistenceAdapter(memoryManager), null);
|
||||
|
@ -87,7 +89,7 @@ public class RegionBroker implements Broker {
|
|||
public RegionBroker(BrokerService brokerService,TaskRunnerFactory taskRunnerFactory, UsageManager memoryManager, PersistenceAdapter adapter, PolicyMap policyMap) throws IOException {
|
||||
this.brokerService = brokerService;
|
||||
this.sequenceGenerator.setLastSequenceId( adapter.getLastMessageBrokerSequenceId() );
|
||||
|
||||
this.adaptor = adaptor;
|
||||
queueRegion = createQueueRegion(memoryManager, taskRunnerFactory, adapter, policyMap);
|
||||
topicRegion = createTopicRegion(memoryManager, taskRunnerFactory, adapter, policyMap);
|
||||
|
||||
|
@ -453,6 +455,10 @@ public class RegionBroker implements Broker {
|
|||
return stopped;
|
||||
}
|
||||
|
||||
public Set getDurableDestinations(){
|
||||
return adaptor.getDestinations();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue