org.apache.activemq.store
Interface MessageStore

All Superinterfaces:
Service
All Known Subinterfaces:
TopicMessageStore
All Known Implementing Classes:
JDBCMessageStore, JDBCTopicMessageStore, JournalMessageStore, JournalTopicMessageStore, KahaMessageStore, KahaTopicMessageStore, MemoryMessageStore, MemoryTopicMessageStore, ProxyMessageStore, ProxyTopicMessageStore, QuickJournalMessageStore, QuickJournalTopicMessageStore, RapidMessageStore, RapidTopicMessageStore

public interface MessageStore
extends Service

Represents a message store which is used by the persistent org.apache.activemq.service.MessageContainer implementations

Version:
$Revision: 1.5 $

Method Summary
 void addMessage(ConnectionContext context, Message message)
          Adds a message to the message store
 void addMessageReference(ConnectionContext context, MessageId messageId, long expirationTime, java.lang.String messageRef)
          Adds a message reference to the message store
 ActiveMQDestination getDestination()
          The destination that the message store is holding messages for.
 Message getMessage(MessageId identity)
          Looks up a message using either the String messageID or the messageNumber.
 java.lang.String getMessageReference(MessageId identity)
          Looks up a message using either the String messageID or the messageNumber.
 void recover(MessageRecoveryListener container)
          Recover any messages to be delivered.
 void removeAllMessages(ConnectionContext context)
          Removes all the messages from the message store.
 void removeMessage(ConnectionContext context, MessageAck ack)
          Removes a message from the message store.
 void setUsageManager(UsageManager usageManager)
           
 
Methods inherited from interface org.apache.activemq.Service
start, stop
 

Method Detail

addMessage

void addMessage(ConnectionContext context,
                Message message)
                throws java.io.IOException
Adds a message to the message store

Parameters:
context - TODO
Throws:
java.io.IOException

addMessageReference

void addMessageReference(ConnectionContext context,
                         MessageId messageId,
                         long expirationTime,
                         java.lang.String messageRef)
                         throws java.io.IOException
Adds a message reference to the message store

Parameters:
context - TODO
messageId - TODO
expirationTime - TODO
Throws:
java.io.IOException

getMessage

Message getMessage(MessageId identity)
                   throws java.io.IOException
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:
java.io.IOException

getMessageReference

java.lang.String getMessageReference(MessageId identity)
                                     throws java.io.IOException
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:
java.io.IOException

removeMessage

void removeMessage(ConnectionContext context,
                   MessageAck ack)
                   throws java.io.IOException
Removes a message from the message store.

Parameters:
context - TODO
ack - the ack request that cause the message to be removed. It conatins the identity which contains the messageID of the message that needs to be removed.
Throws:
java.io.IOException

removeAllMessages

void removeAllMessages(ConnectionContext context)
                       throws java.io.IOException
Removes all the messages from the message store.

Parameters:
context - TODO
Throws:
java.io.IOException

recover

void recover(MessageRecoveryListener container)
             throws java.lang.Exception
Recover any messages to be delivered.

Parameters:
container -
Throws:
java.lang.Exception

getDestination

ActiveMQDestination getDestination()
The destination that the message store is holding messages for.

Returns:

setUsageManager

void setUsageManager(UsageManager usageManager)
Parameters:
usageManager - The UsageManager that is controlling the destination's memory usage.


Copyright © 2010 Apache Software Foundation. All Rights Reserved.