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;
|
package org.apache.activemq.broker;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
import org.apache.activemq.Service;
|
import org.apache.activemq.Service;
|
||||||
import org.apache.activemq.broker.region.Region;
|
import org.apache.activemq.broker.region.Region;
|
||||||
import org.apache.activemq.command.ActiveMQDestination;
|
import org.apache.activemq.command.ActiveMQDestination;
|
||||||
|
@ -206,4 +207,9 @@ public interface Broker extends Region, Service {
|
||||||
*/
|
*/
|
||||||
public boolean isStopped();
|
public boolean isStopped();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return a Set of all durable destinations
|
||||||
|
*/
|
||||||
|
public Set getDurableDestinations();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.activemq.broker;
|
package org.apache.activemq.broker;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
import org.apache.activemq.broker.region.Destination;
|
import org.apache.activemq.broker.region.Destination;
|
||||||
import org.apache.activemq.command.ActiveMQDestination;
|
import org.apache.activemq.command.ActiveMQDestination;
|
||||||
import org.apache.activemq.command.BrokerId;
|
import org.apache.activemq.command.BrokerId;
|
||||||
|
@ -187,5 +188,9 @@ public class BrokerFilter implements Broker {
|
||||||
public boolean isStopped(){
|
public boolean isStopped(){
|
||||||
return next.isStopped();
|
return next.isStopped();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Set getDurableDestinations(){
|
||||||
|
return next.getDurableDestinations();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.activemq.broker;
|
package org.apache.activemq.broker;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
import org.apache.activemq.broker.region.Destination;
|
import org.apache.activemq.broker.region.Destination;
|
||||||
import org.apache.activemq.command.ActiveMQDestination;
|
import org.apache.activemq.command.ActiveMQDestination;
|
||||||
import org.apache.activemq.command.BrokerId;
|
import org.apache.activemq.command.BrokerId;
|
||||||
|
@ -185,5 +186,9 @@ public class EmptyBroker implements Broker{
|
||||||
public boolean isStopped(){
|
public boolean isStopped(){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Set getDurableDestinations(){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.activemq.broker;
|
package org.apache.activemq.broker;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
import org.apache.activemq.broker.region.Destination;
|
import org.apache.activemq.broker.region.Destination;
|
||||||
import org.apache.activemq.command.ActiveMQDestination;
|
import org.apache.activemq.command.ActiveMQDestination;
|
||||||
import org.apache.activemq.command.BrokerId;
|
import org.apache.activemq.command.BrokerId;
|
||||||
|
@ -184,5 +185,9 @@ public class ErrorBroker implements Broker {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Set getDurableDestinations(){
|
||||||
|
throw new IllegalStateException(this.message);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.activemq.broker;
|
package org.apache.activemq.broker;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
import org.apache.activemq.broker.region.Destination;
|
import org.apache.activemq.broker.region.Destination;
|
||||||
import org.apache.activemq.command.ActiveMQDestination;
|
import org.apache.activemq.command.ActiveMQDestination;
|
||||||
import org.apache.activemq.command.BrokerId;
|
import org.apache.activemq.command.BrokerId;
|
||||||
|
@ -197,5 +198,9 @@ public class MutableBrokerFilter implements Broker {
|
||||||
public boolean isStopped(){
|
public boolean isStopped(){
|
||||||
return getNext().isStopped();
|
return getNext().isStopped();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Set getDurableDestinations(){
|
||||||
|
return getNext().getDurableDestinations();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,6 +52,7 @@ import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Routes Broker operations to the correct messaging regions for processing.
|
* Routes Broker operations to the correct messaging regions for processing.
|
||||||
|
@ -79,6 +80,7 @@ public class RegionBroker implements Broker {
|
||||||
private BrokerId brokerId;
|
private BrokerId brokerId;
|
||||||
private String brokerName;
|
private String brokerName;
|
||||||
private Map clientIdSet = new HashMap(); // we will synchronize access
|
private Map clientIdSet = new HashMap(); // we will synchronize access
|
||||||
|
private PersistenceAdapter adaptor;
|
||||||
|
|
||||||
public RegionBroker(BrokerService brokerService,TaskRunnerFactory taskRunnerFactory, UsageManager memoryManager, PersistenceAdapter adapter) throws IOException {
|
public RegionBroker(BrokerService brokerService,TaskRunnerFactory taskRunnerFactory, UsageManager memoryManager, PersistenceAdapter adapter) throws IOException {
|
||||||
this(brokerService,taskRunnerFactory, memoryManager, createDefaultPersistenceAdapter(memoryManager), null);
|
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 {
|
public RegionBroker(BrokerService brokerService,TaskRunnerFactory taskRunnerFactory, UsageManager memoryManager, PersistenceAdapter adapter, PolicyMap policyMap) throws IOException {
|
||||||
this.brokerService = brokerService;
|
this.brokerService = brokerService;
|
||||||
this.sequenceGenerator.setLastSequenceId( adapter.getLastMessageBrokerSequenceId() );
|
this.sequenceGenerator.setLastSequenceId( adapter.getLastMessageBrokerSequenceId() );
|
||||||
|
this.adaptor = adaptor;
|
||||||
queueRegion = createQueueRegion(memoryManager, taskRunnerFactory, adapter, policyMap);
|
queueRegion = createQueueRegion(memoryManager, taskRunnerFactory, adapter, policyMap);
|
||||||
topicRegion = createTopicRegion(memoryManager, taskRunnerFactory, adapter, policyMap);
|
topicRegion = createTopicRegion(memoryManager, taskRunnerFactory, adapter, policyMap);
|
||||||
|
|
||||||
|
@ -452,6 +454,10 @@ public class RegionBroker implements Broker {
|
||||||
public boolean isStopped(){
|
public boolean isStopped(){
|
||||||
return stopped;
|
return stopped;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Set getDurableDestinations(){
|
||||||
|
return adaptor.getDestinations();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue