org.activemq.service.boundedvm
Class TransientQueueBoundedMessageManager

java.lang.Object
  extended byorg.activemq.service.boundedvm.TransientQueueBoundedMessageManager
All Implemented Interfaces:
MessageContainerManager, Runnable, Service

public class TransientQueueBoundedMessageManager
extends Object
implements MessageContainerManager, Runnable

A manager of MessageContainer instances


Nested Class Summary
protected static class TransientQueueBoundedMessageManager.TransientQueueThreadFactory
           
 
Constructor Summary
TransientQueueBoundedMessageManager(MemoryBoundedQueueManager mgr, RedeliveryPolicy redeliveryPolicy, DeadLetterPolicy deadLetterPolicy)
          Constructor for TransientQueueBoundedMessageManager
 
Method Summary
 void acknowledgeMessage(BrokerClient client, MessageAck ack)
          Acknowledge a message as being read and consumed by the Consumer
 void addMessageConsumer(BrokerClient client, ConsumerInfo info)
          Add a consumer if appropiate
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.
 MessageContainer getContainer(String physicalName)
          Allows the lookup of a specific named message container
 DeadLetterPolicy getDeadLetterPolicy()
           
 Map getDestinations()
          Returns an unmodifiable map, indexed by String name, of all the Destination objects available in this container
 int getGarbageCoolectionCapacityLimit()
           
 long getInactiveTimeout()
           
 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
 Map getMessageContainerAdmins()
          Returns an unmodifiable map, indexed by ActiveMQDestination, of all the MessageContainerAdmin objects available in this container
protected  Executor getThreadPool()
           
 void poll()
          Poll for messages
 void removeMessageConsumer(BrokerClient client, ConsumerInfo info)
           
 void run()
          collect expired messages
 void sendMessage(BrokerClient client, ActiveMQMessage message)
           
 void setDeadLetterPolicy(DeadLetterPolicy policy)
          Set the DeadLetterPolicy for this Container Manager
 void setGarbageCoolectionCapacityLimit(int garbageCoolectionCapacityLimit)
           
 void setInactiveTimeout(long inactiveTimeout)
           
 void start()
          start the manager
 void stop()
          stop the manager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransientQueueBoundedMessageManager

public TransientQueueBoundedMessageManager(MemoryBoundedQueueManager mgr,
                                           RedeliveryPolicy redeliveryPolicy,
                                           DeadLetterPolicy deadLetterPolicy)
Constructor for TransientQueueBoundedMessageManager

Parameters:
mgr -
redeliveryPolicy -
deadLetterPolicy -
Method Detail

getGarbageCoolectionCapacityLimit

public int getGarbageCoolectionCapacityLimit()
Returns:
Returns the garbageCoolectionCapacityLimit.

setGarbageCoolectionCapacityLimit

public void setGarbageCoolectionCapacityLimit(int garbageCoolectionCapacityLimit)
Parameters:
garbageCoolectionCapacityLimit - The garbageCoolectionCapacityLimit to set.

getInactiveTimeout

public long getInactiveTimeout()
Returns:
Returns the inactiveTimeout.

setInactiveTimeout

public void setInactiveTimeout(long inactiveTimeout)
Parameters:
inactiveTimeout - The inactiveTimeout to set.

start

public void start()
           throws JMSException
start the manager

Specified by:
start in interface Service
Throws:
JMSException

stop

public void stop()
          throws JMSException
stop the manager

Specified by:
stop in interface Service
Throws:
JMSException

run

public void run()
collect expired messages

Specified by:
run in interface Runnable

addMessageConsumer

public void addMessageConsumer(BrokerClient client,
                               ConsumerInfo info)
                        throws JMSException
Add a consumer if appropiate

Specified by:
addMessageConsumer in interface MessageContainerManager
Parameters:
client -
info -
Throws:
JMSException

removeMessageConsumer

public void removeMessageConsumer(BrokerClient client,
                                  ConsumerInfo info)
                           throws JMSException
Specified by:
removeMessageConsumer in interface MessageContainerManager
Parameters:
client -
info -
Throws:
JMSException

deleteSubscription

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

Specified by:
deleteSubscription in interface MessageContainerManager
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
Specified by:
sendMessage in interface MessageContainerManager
Parameters:
client -
message -
Throws:
JMSException

acknowledgeMessage

public void acknowledgeMessage(BrokerClient client,
                               MessageAck ack)
                        throws JMSException
Description copied from interface: MessageContainerManager
Acknowledge a message as being read and consumed by the Consumer

Specified by:
acknowledgeMessage in interface MessageContainerManager
Parameters:
client -
ack -
Throws:
JMSException

poll

public void poll()
          throws JMSException
Description copied from interface: MessageContainerManager
Poll for messages

Specified by:
poll in interface MessageContainerManager
Throws:
JMSException

getContainer

public MessageContainer getContainer(String physicalName)
                              throws JMSException
Description copied from interface: MessageContainerManager
Allows the lookup of a specific named message container

Specified by:
getContainer in interface MessageContainerManager
Parameters:
physicalName -
Returns:
MessageContainer
Throws:
JMSException

getDestinations

public Map getDestinations()
Description copied from interface: MessageContainerManager
Returns an unmodifiable map, indexed by String name, of all the Destination objects available in this container

Specified by:
getDestinations in interface MessageContainerManager
Returns:
a map of destinations

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

Specified by:
getLocalDestinations in interface MessageContainerManager
Returns:

getDeadLetterPolicy

public DeadLetterPolicy getDeadLetterPolicy()
Specified by:
getDeadLetterPolicy in interface MessageContainerManager
Returns:
the DeadLetterPolicy for this Container Manager

setDeadLetterPolicy

public void setDeadLetterPolicy(DeadLetterPolicy policy)
Set the DeadLetterPolicy for this Container Manager

Specified by:
setDeadLetterPolicy in interface MessageContainerManager
Parameters:
policy -

createFilter

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

Parameters:
info -
Returns:
the Fitler
Throws:
JMSException

getThreadPool

protected Executor getThreadPool()

createMessageContainer

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

Specified by:
createMessageContainer in interface MessageContainerManager
Parameters:
dest -
Throws:
JMSException

destroyMessageContainer

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

Specified by:
destroyMessageContainer in interface MessageContainerManager
Parameters:
dest -
Throws:
JMSException

getMessageContainerAdmins

public Map getMessageContainerAdmins()
                              throws JMSException
Description copied from interface: MessageContainerManager
Returns an unmodifiable map, indexed by ActiveMQDestination, of all the MessageContainerAdmin objects available in this container

Specified by:
getMessageContainerAdmins in interface MessageContainerManager
Returns:
the Map
Throws:
JMSException


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