org.codehaus.activemq.store
Interface MessageStore

All Superinterfaces:
Service
All Known Subinterfaces:
TopicMessageStore
All Known Implementing Classes:
CacheMessageStore, CacheTopicMessageStore, VMMessageStore, VMTopicMessageStore

public interface MessageStore
extends Service

Represents a message store which is used by the persistent MessageContainer implementations

Version:
$Revision: 1.2 $

Method Summary
 MessageIdentity addMessage(ActiveMQMessage message)
          Adds a message to the message store
 ActiveMQMessage getMessage(MessageIdentity identity)
          Looks up a message using either the String messageID or the messageNumber.
 void recover(QueueMessageContainer container)
          Recover any messages to be delivered onto the dispatch queue.
 void removeAllMessages()
          Removes all the messages from the message store.
 void removeMessage(MessageIdentity identity, MessageAck ack)
          Removes a message from the message store.
 
Methods inherited from interface org.codehaus.activemq.service.Service
start, stop
 

Method Detail

addMessage

public MessageIdentity addMessage(ActiveMQMessage message)
                           throws JMSException
Adds a message to the message store

Throws:
JMSException

getMessage

public ActiveMQMessage getMessage(MessageIdentity identity)
                           throws JMSException
Looks up a message using either the String messageID or the messageNumber. Implementations are encouraged to fill in the missing key if its easy to do so.

Parameters:
identity - which contains either the messageID or the messageNumber
Returns:
the message or null if it does not exist
Throws:
JMSException

removeMessage

public void removeMessage(MessageIdentity identity,
                          MessageAck ack)
                   throws JMSException
Removes a message from the message store.

Parameters:
identity - which contains either the messageID or the messageNumber
ack - the ack request that cause the message to be removed.
Throws:
JMSException

removeAllMessages

public void removeAllMessages()
                       throws JMSException
Removes all the messages from the message store.

Throws:
JMSException

recover

public void recover(QueueMessageContainer container)
             throws JMSException
Recover any messages to be delivered onto the dispatch queue.

Only called when this store is used for durable queues.

Parameters:
container -
Throws:
JMSException


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