org.apache.activemq.store.kahadb
Class KahaDBStore.KahaDBMessageStore

java.lang.Object
  extended by org.apache.activemq.store.AbstractMessageStore
      extended by org.apache.activemq.store.kahadb.KahaDBStore.KahaDBMessageStore
All Implemented Interfaces:
Service, MessageStore
Enclosing class:
KahaDBStore

public class KahaDBStore.KahaDBMessageStore
extends AbstractMessageStore


Field Summary
protected  Map<org.apache.activemq.store.kahadb.KahaDBStore.AsyncJobKey,KahaDBStore.StoreTask> asyncTaskMap
           
protected  KahaDestination dest
           
 
Fields inherited from class org.apache.activemq.store.AbstractMessageStore
destination, FUTURE, prioritizedMessages
 
Constructor Summary
KahaDBStore.KahaDBMessageStore(ActiveMQDestination destination)
           
 
Method Summary
protected  void acquireLocalAsyncLock()
           
 void addMessage(ConnectionContext context, Message message)
          Adds a message to the message store
 Future<Object> asyncAddQueueMessage(ConnectionContext context, Message message)
          Adds a message 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.
 int getMessageCount()
           
 boolean isEmpty()
          flag to indicate if the store is empty
protected  void lockAsyncJobQueue()
           
 void recover(MessageRecoveryListener listener)
          Recover any messages to be delivered.
 void recoverNextMessages(int maxReturned, MessageRecoveryListener listener)
           
protected  void releaseLocalAsyncLock()
           
 void removeAllMessages(ConnectionContext context)
          Removes all the messages from the message store.
 void removeAsyncMessage(ConnectionContext context, MessageAck ack)
           
 void removeMessage(ConnectionContext context, MessageAck ack)
          Removes a message from the message store.
 void resetBatching()
          A hint to the Store to reset any batching state for the Destination
 void setBatch(MessageId identity)
          allow caching cursors to set the current batch offset when cache is exhausted
 void setMemoryUsage(MemoryUsage memoeyUSage)
           
 void start()
           
 void stop()
           
protected  void unlockAsyncJobQueue()
           
 
Methods inherited from class org.apache.activemq.store.AbstractMessageStore
addMessage, asyncAddQueueMessage, asyncAddTopicMessage, asyncAddTopicMessage, dispose, isPrioritizedMessages, setPrioritizedMessages
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

asyncTaskMap

protected final Map<org.apache.activemq.store.kahadb.KahaDBStore.AsyncJobKey,KahaDBStore.StoreTask> asyncTaskMap

dest

protected KahaDestination dest
Constructor Detail

KahaDBStore.KahaDBMessageStore

public KahaDBStore.KahaDBMessageStore(ActiveMQDestination destination)
Method Detail

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
Overrides:
getDestination in class AbstractMessageStore
Returns:
the destination

asyncAddQueueMessage

public Future<Object> asyncAddQueueMessage(ConnectionContext context,
                                           Message message)
                                    throws IOException
Description copied from interface: MessageStore
Adds a message to the message store

Specified by:
asyncAddQueueMessage in interface MessageStore
Overrides:
asyncAddQueueMessage in class AbstractMessageStore
Parameters:
context - context
Returns:
a Future to track when this is complete
Throws:
IOException

removeAsyncMessage

public void removeAsyncMessage(ConnectionContext context,
                               MessageAck ack)
                        throws IOException
Specified by:
removeAsyncMessage in interface MessageStore
Overrides:
removeAsyncMessage in class AbstractMessageStore
Throws:
IOException

addMessage

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

Parameters:
context - context
Throws:
IOException

removeMessage

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

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

removeAllMessages

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

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.

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

getMessageCount

public int getMessageCount()
                    throws IOException
Returns:
the number of messages ready to deliver
Throws:
IOException

isEmpty

public boolean isEmpty()
                throws IOException
Description copied from class: AbstractMessageStore
flag to indicate if the store is empty

Specified by:
isEmpty in interface MessageStore
Overrides:
isEmpty in class AbstractMessageStore
Returns:
true if the message count is 0
Throws:
IOException

recover

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

Throws:
Exception

recoverNextMessages

public void recoverNextMessages(int maxReturned,
                                MessageRecoveryListener listener)
                         throws Exception
Throws:
Exception

resetBatching

public void resetBatching()
Description copied from interface: MessageStore
A hint to the Store to reset any batching state for the Destination


setBatch

public void setBatch(MessageId identity)
              throws IOException
Description copied from interface: MessageStore
allow caching cursors to set the current batch offset when cache is exhausted

Specified by:
setBatch in interface MessageStore
Overrides:
setBatch in class AbstractMessageStore
Throws:
IOException

setMemoryUsage

public void setMemoryUsage(MemoryUsage memoeyUSage)
Specified by:
setMemoryUsage in interface MessageStore
Overrides:
setMemoryUsage in class AbstractMessageStore
Parameters:
memoeyUSage - The SystemUsage that is controlling the destination's memory usage.

start

public void start()
           throws Exception
Specified by:
start in interface Service
Overrides:
start in class AbstractMessageStore
Throws:
Exception

stop

public void stop()
          throws Exception
Specified by:
stop in interface Service
Overrides:
stop in class AbstractMessageStore
Throws:
Exception

lockAsyncJobQueue

protected void lockAsyncJobQueue()

unlockAsyncJobQueue

protected void unlockAsyncJobQueue()

acquireLocalAsyncLock

protected void acquireLocalAsyncLock()

releaseLocalAsyncLock

protected void releaseLocalAsyncLock()


Copyright © 2005–2013 The Apache Software Foundation. All rights reserved.