Class TopicRegion
- java.lang.Object
-
- org.apache.activemq.broker.region.AbstractRegion
-
- org.apache.activemq.broker.region.TopicRegion
-
- Direct Known Subclasses:
ManagedTopicRegion
public class TopicRegion extends AbstractRegion
-
-
Field Summary
Fields Modifier and Type Field Description protected ConcurrentMap<SubscriptionKey,DurableTopicSubscription>
durableSubscriptions
-
Fields inherited from class org.apache.activemq.broker.region.AbstractRegion
autoCreateDestinations, broker, consumerChangeMutexMap, destinationFactory, destinationMap, destinations, destinationsLock, destinationStatistics, regionStatistics, started, subscriptions, taskRunnerFactory, usageManager
-
-
Constructor Summary
Constructors Constructor Description TopicRegion(RegionBroker broker, DestinationStatistics destinationStatistics, SystemUsage memoryManager, TaskRunnerFactory taskRunnerFactory, DestinationFactory destinationFactory)
-
Method Summary
-
Methods inherited from class org.apache.activemq.broker.region.AbstractRegion
acknowledge, addDestination, addProducer, createDestination, destroySubscription, dispose, gc, getDestinationMap, getDestinations, getDurableDestinations, getSubscriptions, isAutoCreateDestinations, lookup, messagePull, processConsumerControl, processDispatchNotification, processDispatchNotificationViaDestination, reapplyInterceptor, removeDestination, removeProducer, send, setAutoCreateDestinations, start, updateRegionDestCounts, validateMaxDestinations
-
-
-
-
Field Detail
-
durableSubscriptions
protected final ConcurrentMap<SubscriptionKey,DurableTopicSubscription> durableSubscriptions
-
-
Constructor Detail
-
TopicRegion
public TopicRegion(RegionBroker broker, DestinationStatistics destinationStatistics, SystemUsage memoryManager, TaskRunnerFactory taskRunnerFactory, DestinationFactory destinationFactory)
-
-
Method Detail
-
stop
public void stop() throws Exception
- Specified by:
stop
in interfaceService
- Overrides:
stop
in classAbstractRegion
- Throws:
Exception
-
doCleanup
public void doCleanup()
-
addConsumer
public Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception
Description copied from interface:Region
Adds a consumer.- Specified by:
addConsumer
in interfaceRegion
- Overrides:
addConsumer
in classAbstractRegion
- Parameters:
context
- the environment the operation is being executed under.- Returns:
- TODO
- Throws:
Exception
- TODO
-
removeConsumer
public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception
Description copied from interface:Region
Removes a consumer.- Specified by:
removeConsumer
in interfaceRegion
- Overrides:
removeConsumer
in classAbstractRegion
- Parameters:
context
- the environment the operation is being executed under.- Throws:
Exception
- TODO
-
removeSubscription
public void removeSubscription(ConnectionContext context, RemoveSubscriptionInfo info) throws Exception
Description copied from interface:Region
Deletes a durable subscription.- Specified by:
removeSubscription
in interfaceRegion
- Overrides:
removeSubscription
in classAbstractRegion
- Parameters:
context
- the environment the operation is being executed under.info
- TODO- Throws:
Exception
- TODO
-
addSubscriptionsForDestination
protected List<Subscription> addSubscriptionsForDestination(ConnectionContext context, Destination dest) throws Exception
- Overrides:
addSubscriptionsForDestination
in classAbstractRegion
- Throws:
Exception
-
createInactiveConsumerInfo
public ConsumerInfo createInactiveConsumerInfo(SubscriptionInfo info)
-
configureTopic
protected void configureTopic(Topic topic, ActiveMQDestination destination)
-
createSubscription
protected Subscription createSubscription(ConnectionContext context, ConsumerInfo info) throws JMSException
- Specified by:
createSubscription
in classAbstractRegion
- Throws:
JMSException
-
getInactiveDestinations
protected Set<ActiveMQDestination> getInactiveDestinations()
- Overrides:
getInactiveDestinations
in classAbstractRegion
- Returns:
- all Destinations that don't have active consumers
-
lookupSubscription
public DurableTopicSubscription lookupSubscription(String subscriptionName, String clientId)
-
lookupSubscriptions
public List<DurableTopicSubscription> lookupSubscriptions(String clientId)
-
isKeepDurableSubsActive
public boolean isKeepDurableSubsActive()
-
setKeepDurableSubsActive
public void setKeepDurableSubsActive(boolean keepDurableSubsActive)
-
durableSubscriptionExists
public boolean durableSubscriptionExists(SubscriptionKey key)
-
getDurableSubscription
public DurableTopicSubscription getDurableSubscription(SubscriptionKey key)
-
getDurableSubscriptions
public Map<SubscriptionKey,DurableTopicSubscription> getDurableSubscriptions()
-
-