org.apache.activemq.store
Class ProxyMessageStore

java.lang.Object
  extended by org.apache.activemq.store.ProxyMessageStore
All Implemented Interfaces:
Service, MessageStore

public class ProxyMessageStore
extends java.lang.Object
implements MessageStore

A simple proxy that delegates to another MessageStore.


Constructor Summary
ProxyMessageStore(MessageStore delegate)
           
 
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
 MessageStore getDelegate()
           
 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 listener)
          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)
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProxyMessageStore

public ProxyMessageStore(MessageStore delegate)
Method Detail

getDelegate

public MessageStore getDelegate()

addMessage

public void addMessage(ConnectionContext context,
                       Message message)
                throws java.io.IOException
Description copied from interface: MessageStore
Adds a message to the message store

Specified by:
addMessage in interface MessageStore
Parameters:
context - TODO
Throws:
java.io.IOException

getMessage

public Message getMessage(MessageId identity)
                   throws java.io.IOException
Description copied from interface: MessageStore
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.

Specified by:
getMessage in interface MessageStore
Parameters:
identity - which contains either the messageID or the messageNumber
Returns:
the message or null if it does not exist
Throws:
java.io.IOException

recover

public void recover(MessageRecoveryListener listener)
             throws java.lang.Exception
Description copied from interface: MessageStore
Recover any messages to be delivered.

Specified by:
recover in interface MessageStore
Throws:
java.lang.Exception

removeAllMessages

public void removeAllMessages(ConnectionContext context)
                       throws java.io.IOException
Description copied from interface: MessageStore
Removes all the messages from the message store.

Specified by:
removeAllMessages in interface MessageStore
Parameters:
context - TODO
Throws:
java.io.IOException

removeMessage

public void removeMessage(ConnectionContext context,
                          MessageAck ack)
                   throws java.io.IOException
Description copied from interface: MessageStore
Removes a message from the message store.

Specified by:
removeMessage in interface MessageStore
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

start

public void start()
           throws java.lang.Exception
Specified by:
start in interface Service
Throws:
java.lang.Exception

stop

public void stop()
          throws java.lang.Exception
Specified by:
stop in interface Service
Throws:
java.lang.Exception

getDestination

public ActiveMQDestination getDestination()
Description copied from interface: MessageStore
The destination that the message store is holding messages for.

Specified by:
getDestination in interface MessageStore
Returns:

addMessageReference

public void addMessageReference(ConnectionContext context,
                                MessageId messageId,
                                long expirationTime,
                                java.lang.String messageRef)
                         throws java.io.IOException
Description copied from interface: MessageStore
Adds a message reference to the message store

Specified by:
addMessageReference in interface MessageStore
Parameters:
context - TODO
messageId - TODO
expirationTime - TODO
Throws:
java.io.IOException

getMessageReference

public java.lang.String getMessageReference(MessageId identity)
                                     throws java.io.IOException
Description copied from interface: MessageStore
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.

Specified by:
getMessageReference in interface MessageStore
Parameters:
identity - which contains either the messageID or the messageNumber
Returns:
the message or null if it does not exist
Throws:
java.io.IOException

setUsageManager

public void setUsageManager(UsageManager usageManager)
Specified by:
setUsageManager in interface MessageStore
Parameters:
usageManager - The UsageManager that is controlling the destination's memory usage.


Copyright © 2010 Apache Software Foundation. All Rights Reserved.