org.apache.activemq.broker.region
Class TopicRegion

java.lang.Object
  extended by org.apache.activemq.broker.region.AbstractRegion
      extended by org.apache.activemq.broker.region.TopicRegion
All Implemented Interfaces:
Region, Service
Direct Known Subclasses:
ManagedTopicRegion

public class TopicRegion
extends AbstractRegion


Field Summary
protected  ConcurrentHashMap<SubscriptionKey,DurableTopicSubscription> durableSubscriptions
           
 
Fields inherited from class org.apache.activemq.broker.region.AbstractRegion
autoCreateDestinations, broker, consumerChangeMutexMap, destinationFactory, destinationMap, destinations, destinationsLock, destinationStatistics, started, subscriptions, taskRunnerFactory, usageManager
 
Constructor Summary
TopicRegion(RegionBroker broker, DestinationStatistics destinationStatistics, SystemUsage memoryManager, TaskRunnerFactory taskRunnerFactory, DestinationFactory destinationFactory)
           
 
Method Summary
 Subscription addConsumer(ConnectionContext context, ConsumerInfo info)
          Adds a consumer.
protected  List<Subscription> addSubscriptionsForDestination(ConnectionContext context, Destination dest)
           
protected  void configureTopic(Topic topic, ActiveMQDestination destination)
           
 ConsumerInfo createInactiveConsumerInfo(SubscriptionInfo info)
           
protected  Subscription createSubscription(ConnectionContext context, ConsumerInfo info)
           
 void doCleanup()
           
 boolean durableSubscriptionExists(SubscriptionKey key)
           
protected  Set<ActiveMQDestination> getInactiveDestinations()
           
 boolean isKeepDurableSubsActive()
           
 void removeConsumer(ConnectionContext context, ConsumerInfo info)
          Removes a consumer.
 void removeSubscription(ConnectionContext context, RemoveSubscriptionInfo info)
          Deletes a durable subscription.
 void setKeepDurableSubsActive(boolean keepDurableSubsActive)
           
 void stop()
           
 String toString()
           
 
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, removeDestination, removeProducer, send, setAutoCreateDestinations, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

durableSubscriptions

protected final ConcurrentHashMap<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 interface Service
Overrides:
stop in class AbstractRegion
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 interface Region
Overrides:
addConsumer in class AbstractRegion
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 interface Region
Overrides:
removeConsumer in class AbstractRegion
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 interface Region
Overrides:
removeSubscription in class AbstractRegion
Parameters:
context - the environment the operation is being executed under.
info - TODO
Throws:
Exception - TODO

toString

public String toString()
Overrides:
toString in class Object

addSubscriptionsForDestination

protected List<Subscription> addSubscriptionsForDestination(ConnectionContext context,
                                                            Destination dest)
                                                     throws Exception
Overrides:
addSubscriptionsForDestination in class AbstractRegion
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 class AbstractRegion
Throws:
JMSException

getInactiveDestinations

protected Set<ActiveMQDestination> getInactiveDestinations()
Overrides:
getInactiveDestinations in class AbstractRegion
Returns:
all Destinations that don't have active consumers

isKeepDurableSubsActive

public boolean isKeepDurableSubsActive()

setKeepDurableSubsActive

public void setKeepDurableSubsActive(boolean keepDurableSubsActive)

durableSubscriptionExists

public boolean durableSubscriptionExists(SubscriptionKey key)


Copyright © 2005-2012 The Apache Software Foundation. All Rights Reserved.