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:
Robert Davies 2006-02-13 16:31:37 +00:00
parent f787e20139
commit debd0cc241
6 changed files with 33 additions and 1 deletions

View File

@ -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();
}

View File

@ -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();
}
}

View File

@ -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;
}
}

View File

@ -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);
}
}

View File

@ -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();
}
}

View File

@ -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();
}
}