Package org.apache.activemq.store.kahadb
Class TempKahaDBStore.KahaDBMessageStore
- java.lang.Object
-
- org.apache.activemq.store.AbstractMessageStore
-
- org.apache.activemq.store.kahadb.TempKahaDBStore.KahaDBMessageStore
-
- All Implemented Interfaces:
Service
,MessageStore
- Enclosing class:
- TempKahaDBStore
public class TempKahaDBStore.KahaDBMessageStore extends AbstractMessageStore
-
-
Field Summary
Fields Modifier and Type Field Description protected KahaDestination
dest
-
Fields inherited from class org.apache.activemq.store.AbstractMessageStore
destination, FUTURE, indexListener, messageStoreStatistics, prioritizedMessages
-
-
Constructor Summary
Constructors Constructor Description KahaDBMessageStore(ActiveMQDestination destination)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addMessage(ConnectionContext context, Message message)
Adds a message to the message storeActiveMQDestination
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.void
recover(MessageRecoveryListener listener)
Recover any messages to be delivered.void
recoverMessageStoreStatistics()
void
recoverNextMessages(int maxReturned, MessageRecoveryListener listener)
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
resetBatching()
A hint to the Store to reset any batching state for the Destinationvoid
setBatch(MessageId identity)
allow caching cursors to set the current batch offset when cache is exhaustedvoid
setMemoryUsage(MemoryUsage memoryUsage)
void
start()
void
stop()
-
Methods inherited from class org.apache.activemq.store.AbstractMessageStore
addMessage, asyncAddQueueMessage, asyncAddQueueMessage, asyncAddTopicMessage, asyncAddTopicMessage, dispose, getIndexListener, getMessageCount, getMessageSize, getMessageStoreStatistics, isEmpty, isPrioritizedMessages, registerIndexListener, removeAsyncMessage, setPrioritizedMessages, updateMessage
-
-
-
-
Field Detail
-
dest
protected KahaDestination dest
-
-
Constructor Detail
-
KahaDBMessageStore
public 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 interfaceMessageStore
- Overrides:
getDestination
in classAbstractMessageStore
- Returns:
- the destination
-
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
-
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 interfaceMessageStore
- Overrides:
setBatch
in classAbstractMessageStore
- Throws:
IOException
-
setMemoryUsage
public void setMemoryUsage(MemoryUsage memoryUsage)
- Specified by:
setMemoryUsage
in interfaceMessageStore
- Overrides:
setMemoryUsage
in classAbstractMessageStore
- Parameters:
memoryUsage
- The SystemUsage that is controlling the destination's memory usage.
-
start
public void start() throws Exception
- Specified by:
start
in interfaceService
- Overrides:
start
in classAbstractMessageStore
- Throws:
Exception
-
stop
public void stop() throws Exception
- Specified by:
stop
in interfaceService
- Overrides:
stop
in classAbstractMessageStore
- Throws:
Exception
-
recoverMessageStoreStatistics
public void recoverMessageStoreStatistics() throws IOException
- Overrides:
recoverMessageStoreStatistics
in classAbstractMessageStore
- Throws:
IOException
-
-