org.activemq.service.boundedvm
Class DurableQueueBoundedMessageContainer

java.lang.Object
  extended by org.activemq.service.boundedvm.DurableQueueBoundedMessageContainer
All Implemented Interfaces:
Runnable, MessageContainerAdmin, Service

public class DurableQueueBoundedMessageContainer
extends Object
implements Service, Runnable, MessageContainerAdmin

A MessageContainer for Durable queues

Version:
$Revision: 1.1.1.1 $

Constructor Summary
DurableQueueBoundedMessageContainer(MessageStore messageStore, Executor threadPool, MemoryBoundedQueueManager queueManager, ActiveMQDestination destination, RedeliveryPolicy redeliveryPolicy, DeadLetterPolicy deadLetterPolicy)
          Construct this beast
 
Method Summary
 DurableQueueSubscription addConsumer(Filter filter, ConsumerInfo info, BrokerClient client)
          Add a consumer to dispatch messages to
protected  void checkRunning()
           
protected  void clear()
           
 void close()
          close down this container
 void empty()
          Deletes all the messages that a container holds.
 void enqueue(ActiveMQMessage message)
          enqueue a message for dispatching
 ActiveMQDestination getDestination()
           
 String getDestinationName()
           
 long getIdleTimestamp()
           
 MessageContainerAdmin getMessageContainerAdmin()
           
 boolean isActive()
           
 boolean isEmpty()
           
 void redeliver(DurableMessagePointer message)
           
 void redeliver(List messages)
           
 void removeConsumer(ConsumerInfo info)
          Remove a consumer
protected  void removeExpiredMessages()
           
 void run()
          do some dispatching
 void start()
          start working
 void stop()
          stop working
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DurableQueueBoundedMessageContainer

public DurableQueueBoundedMessageContainer(MessageStore messageStore,
                                           Executor threadPool,
                                           MemoryBoundedQueueManager queueManager,
                                           ActiveMQDestination destination,
                                           RedeliveryPolicy redeliveryPolicy,
                                           DeadLetterPolicy deadLetterPolicy)
Construct this beast

Parameters:
threadPool -
queueManager -
destination -
redeliveryPolicy -
deadLetterPolicy -
Method Detail

isActive

public boolean isActive()
Returns:
true if there are subscribers waiting for messages

isEmpty

public boolean isEmpty()
Returns:
true if no messages are enqueued

getIdleTimestamp

public long getIdleTimestamp()
Returns:
the timestamp (ms) from the when the last active subscriber stopped

addConsumer

public DurableQueueSubscription addConsumer(Filter filter,
                                            ConsumerInfo info,
                                            BrokerClient client)
                                     throws JMSException
Add a consumer to dispatch messages to

Parameters:
filter -
info -
client -
Returns:
DurableQueueSubscription
Throws:
JMSException

removeConsumer

public void removeConsumer(ConsumerInfo info)
                    throws JMSException
Remove a consumer

Parameters:
info -
Throws:
JMSException

start

public void start()
           throws JMSException
start working

Specified by:
start in interface Service
Throws:
JMSException

enqueue

public void enqueue(ActiveMQMessage message)
             throws JMSException
enqueue a message for dispatching

Parameters:
message -
Throws:
JMSException

redeliver

public void redeliver(DurableMessagePointer message)

redeliver

public void redeliver(List messages)

stop

public void stop()
stop working

Specified by:
stop in interface Service

close

public void close()
           throws JMSException
close down this container

Throws:
JMSException

run

public void run()
do some dispatching

Specified by:
run in interface Runnable

getDestination

public ActiveMQDestination getDestination()
Returns:
the destination associated with this container

getDestinationName

public String getDestinationName()
Specified by:
getDestinationName in interface MessageContainerAdmin
Returns:
the destination name

clear

protected void clear()

removeExpiredMessages

protected void removeExpiredMessages()

checkRunning

protected void checkRunning()

getMessageContainerAdmin

public MessageContainerAdmin getMessageContainerAdmin()
See Also:
MessageContainer.getMessageContainerAdmin()

empty

public void empty()
           throws JMSException
Description copied from interface: MessageContainerAdmin
Deletes all the messages that a container holds. This is usally used when the container is being destroyed.

Specified by:
empty in interface MessageContainerAdmin
Throws:
JMSException
See Also:
MessageContainerAdmin.empty()


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