org.apache.activemq.store.kahadaptor
Class KahaMessageStore

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

public class KahaMessageStore
extends Object
implements MessageStore

An implementation of MessageStore which uses a JPS Container

Version:
$Revision: 1.7 $

Field Summary
protected  ActiveMQDestination destination
           
protected  MapContainer messageContainer
           
 
Constructor Summary
KahaMessageStore(MapContainer container, ActiveMQDestination destination)
           
 
Method Summary
 void addMessage(ConnectionContext context, Message message)
          Adds a message to the message store
 void addMessageReference(ConnectionContext context, MessageId messageId, long expirationTime, String messageRef)
          Adds a message reference to the message store
 void delete()
           
 ActiveMQDestination getDestination()
          The destination that the message store is holding messages for.
 Object getId()
           
 Message getMessage(MessageId identity)
          Looks up a message using either the String messageID or the messageNumber.
 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 removeMessage(MessageId msgId)
           
 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
 

Field Detail

destination

protected final ActiveMQDestination destination

messageContainer

protected final MapContainer messageContainer
Constructor Detail

KahaMessageStore

public KahaMessageStore(MapContainer container,
                        ActiveMQDestination destination)
                 throws IOException
Throws:
IOException
Method Detail

getId

public Object getId()

addMessage

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

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

addMessageReference

public void addMessageReference(ConnectionContext context,
                                MessageId messageId,
                                long expirationTime,
                                String messageRef)
                         throws 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:
IOException

getMessage

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

getMessageReference

public String getMessageReference(MessageId identity)
                           throws 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:
IOException

removeMessage

public void removeMessage(ConnectionContext context,
                          MessageAck ack)
                   throws 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:
IOException

removeMessage

public void removeMessage(MessageId msgId)
                   throws IOException
Throws:
IOException

recover

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

Specified by:
recover in interface MessageStore
Throws:
Exception

start

public void start()
Specified by:
start in interface Service

stop

public void stop()
Specified by:
stop in interface Service

removeAllMessages

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

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

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:

delete

public void delete()

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 © 2011 Apache Software Foundation. All Rights Reserved.