|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.activemq.store.cache.CacheMessageStore
public class CacheMessageStore
A MessageStore that uses an in memory cache to speed up getMessage() method calls.
Constructor Summary | |
---|---|
CacheMessageStore(CachePersistenceAdapter adapter,
MessageStore longTermStore,
MessageCache cache)
|
Method Summary | |
---|---|
void |
addMessage(ActiveMQMessage message)
Add the meessage to the long term store and cache it. |
MessageStore |
getLongTermStore()
|
ActiveMQMessage |
getMessage(MessageIdentity identity)
Return the message from the cache or go to the longTermStore if it is not in there. |
void |
recover(RecoveryListener listener)
Replays the checkpointStore first as those messages are the oldest ones, then messages are replayed from the transaction log and then the cache is updated. |
void |
removeAllMessages()
Removes all the messages from the message store. |
void |
removeMessage(MessageAck ack)
Remove the meessage to the long term store and remove it from the cache. |
void |
setCacheMessageStore(CacheMessageStore store)
|
void |
start()
Called to start the service |
void |
stop()
Called to shutdown the service |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CacheMessageStore(CachePersistenceAdapter adapter, MessageStore longTermStore, MessageCache cache)
Method Detail |
---|
public void addMessage(ActiveMQMessage message) throws JMSException
addMessage
in interface MessageStore
JMSException
public void removeMessage(MessageAck ack) throws JMSException
removeMessage
in interface MessageStore
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.
JMSException
public ActiveMQMessage getMessage(MessageIdentity identity) throws JMSException
getMessage
in interface MessageStore
identity
- which contains either the messageID or the messageNumber
JMSException
public void recover(RecoveryListener listener) throws JMSException
recover
in interface MessageStore
listener
-
JMSException
public void start() throws JMSException
Service
start
in interface Service
JMSException
public void stop() throws JMSException
Service
stop
in interface Service
JMSException
public MessageStore getLongTermStore()
public void setCacheMessageStore(CacheMessageStore store)
setCacheMessageStore
in interface CacheMessageStoreAware
CacheMessageStoreAware.setCacheMessageStore(org.activemq.store.cache.CacheMessageStore)
public void removeAllMessages() throws JMSException
MessageStore
removeAllMessages
in interface MessageStore
JMSException
MessageStore.removeAllMessages()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |