org.activemq.service.impl
Class DurableTopicMessageContainerManager

java.lang.Object
  extended by org.activemq.service.impl.MessageContainerManagerSupport
      extended by org.activemq.service.impl.DurableTopicMessageContainerManager
All Implemented Interfaces:
MessageContainerManager, Service
Direct Known Subclasses:
TransientTopicMessageContainerManager

public class DurableTopicMessageContainerManager
extends MessageContainerManagerSupport

A default Broker used for Topic messages for durable consumers

Version:
$Revision: 1.1.1.1 $

Field Summary
protected  Map activeSubscriptions
           
protected  FilterFactory filterFactory
           
protected  SubscriptionContainer subscriptionContainer
           
 
Fields inherited from class org.activemq.service.impl.MessageContainerManagerSupport
dispatcher, messageContainers
 
Constructor Summary
DurableTopicMessageContainerManager(PersistenceAdapter persistenceAdapter, RedeliveryPolicy redeliveryPolicy, DeadLetterPolicy deadLetterPolicy)
           
DurableTopicMessageContainerManager(PersistenceAdapter persistenceAdapter, SubscriptionContainer subscriptionContainer, FilterFactory filterFactory, Dispatcher dispatcher)
           
 
Method Summary
 void acknowledgeMessage(BrokerClient client, MessageAck ack)
          Acknowledge a message as being read and consumed byh the Consumer
 void addMessageConsumer(BrokerClient client, ConsumerInfo info)
           
protected  MessageContainer createContainer(String destinationName)
          Factory method to create a new MessageContainer
protected  Destination createDestination(String destinationName)
          Factory method to create a new Destination
protected  Filter createFilter(ConsumerInfo info)
          Create filter for a Consumer
 void createMessageContainer(ActiveMQDestination dest)
          Creates a destination.
 void deleteSubscription(String clientId, String subscriberName)
          Delete a durable subscriber
 void destroyMessageContainer(ActiveMQDestination dest)
          Destroys a destination.
protected  void doAddMessageConsumer(BrokerClient client, ConsumerInfo info)
           
protected  boolean equal(Object o1, Object o2)
          Returns true if the two objects are null or are equal
 Map getLocalDestinations()
          Returns an unmodifiable map, indexed by String name, of all the Destination objects used by non-broker consumers directly connected to this container
 boolean isConsumerActiveOnDestination(ActiveMQDestination dest)
           
protected  void loadAllMessageContainers()
          Called when recovering a wildcard subscription where we need to load all the durable message containers (for which we have any outstanding messages to deliver) into RAM
 void poll()
          poll or messages
protected  void recoverSubscriptions(Subscription subscription)
          This method is called when a new durable subscription is started and so we need to go through each matching message container and dispatch any matching messages that may be outstanding
 void removeMessageConsumer(BrokerClient client, ConsumerInfo info)
           
 void sendMessage(BrokerClient client, ActiveMQMessage message)
           
 
Methods inherited from class org.activemq.service.impl.MessageContainerManagerSupport
getContainer, getDeadLetterPolicy, getDestinations, getMessageContainerAdmins, isMaintainDestinationStats, loadContainer, setDeadLetterPolicy, setMaintainDestinationStats, start, stop, updateAcknowledgeStats, updateSendStats
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

subscriptionContainer

protected SubscriptionContainer subscriptionContainer

filterFactory

protected FilterFactory filterFactory

activeSubscriptions

protected Map activeSubscriptions
Constructor Detail

DurableTopicMessageContainerManager

public DurableTopicMessageContainerManager(PersistenceAdapter persistenceAdapter,
                                           RedeliveryPolicy redeliveryPolicy,
                                           DeadLetterPolicy deadLetterPolicy)

DurableTopicMessageContainerManager

public DurableTopicMessageContainerManager(PersistenceAdapter persistenceAdapter,
                                           SubscriptionContainer subscriptionContainer,
                                           FilterFactory filterFactory,
                                           Dispatcher dispatcher)
Method Detail

addMessageConsumer

public void addMessageConsumer(BrokerClient client,
                               ConsumerInfo info)
                        throws JMSException
Throws:
JMSException

removeMessageConsumer

public void removeMessageConsumer(BrokerClient client,
                                  ConsumerInfo info)
                           throws JMSException
Throws:
JMSException

deleteSubscription

public void deleteSubscription(String clientId,
                               String subscriberName)
                        throws JMSException
Delete a durable subscriber

Parameters:
clientId -
subscriberName -
Throws:
JMSException - if the subscriber doesn't exist or is still active

sendMessage

public void sendMessage(BrokerClient client,
                        ActiveMQMessage message)
                 throws JMSException
Parameters:
client -
message -
Throws:
JMSException

getLocalDestinations

public Map getLocalDestinations()
Returns an unmodifiable map, indexed by String name, of all the Destination objects used by non-broker consumers directly connected to this container

Returns:

acknowledgeMessage

public void acknowledgeMessage(BrokerClient client,
                               MessageAck ack)
                        throws JMSException
Acknowledge a message as being read and consumed byh the Consumer

Parameters:
client -
ack -
Throws:
JMSException

poll

public void poll()
          throws JMSException
poll or messages

Throws:
JMSException

createContainer

protected MessageContainer createContainer(String destinationName)
                                    throws JMSException
Description copied from class: MessageContainerManagerSupport
Factory method to create a new MessageContainer

Specified by:
createContainer in class MessageContainerManagerSupport
Throws:
JMSException

createDestination

protected Destination createDestination(String destinationName)
Description copied from class: MessageContainerManagerSupport
Factory method to create a new Destination

Specified by:
createDestination in class MessageContainerManagerSupport

isConsumerActiveOnDestination

public boolean isConsumerActiveOnDestination(ActiveMQDestination dest)

doAddMessageConsumer

protected void doAddMessageConsumer(BrokerClient client,
                                    ConsumerInfo info)
                             throws JMSException
Throws:
JMSException

equal

protected final boolean equal(Object o1,
                              Object o2)
Returns true if the two objects are null or are equal


recoverSubscriptions

protected void recoverSubscriptions(Subscription subscription)
                             throws JMSException
This method is called when a new durable subscription is started and so we need to go through each matching message container and dispatch any matching messages that may be outstanding

Parameters:
subscription -
Throws:
JMSException

loadAllMessageContainers

protected void loadAllMessageContainers()
                                 throws JMSException
Called when recovering a wildcard subscription where we need to load all the durable message containers (for which we have any outstanding messages to deliver) into RAM

Throws:
JMSException

createFilter

protected Filter createFilter(ConsumerInfo info)
                       throws JMSException
Create filter for a Consumer

Parameters:
info -
Returns:
the Fitler
Throws:
JMSException

createMessageContainer

public void createMessageContainer(ActiveMQDestination dest)
                            throws JMSException
Description copied from interface: MessageContainerManager
Creates a destination.

Specified by:
createMessageContainer in interface MessageContainerManager
Overrides:
createMessageContainer in class MessageContainerManagerSupport
Throws:
JMSException

destroyMessageContainer

public void destroyMessageContainer(ActiveMQDestination dest)
                             throws JMSException
Description copied from interface: MessageContainerManager
Destroys a destination.

Specified by:
destroyMessageContainer in interface MessageContainerManager
Overrides:
destroyMessageContainer in class MessageContainerManagerSupport
Throws:
JMSException


Copyright © 2004-2008 Protique, Ltd.. All Rights Reserved.