org.codehaus.activemq.store.journal
Class JournalMessageStore

java.lang.Object
  extended byorg.codehaus.activemq.store.journal.JournalMessageStore
All Implemented Interfaces:
CacheMessageStoreAware, MessageStore, Service

public class JournalMessageStore
extends Object
implements MessageStore, CacheMessageStoreAware

A MessageStore that uses a Journal to store it's messages.

Version:
$Revision: 1.7 $

Constructor Summary
JournalMessageStore(JournalPersistenceAdapter adapter, MessageStore checkpointStore, String destinationName, boolean sync)
           
 
Method Summary
 MessageIdentity addMessage(ActiveMQMessage message)
          Not synchronized since the Journal has better throughput if you increase the number of conncurrent writes that it is doing.
 RecordLocation checkpoint()
           
 MessageStore getLongTermStore()
           
 ActiveMQMessage getMessage(MessageIdentity identity)
          Looks up a message using either the String messageID or the messageNumber.
 void recover(QueueMessageContainer container)
          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 removeMessage(MessageIdentity identity, MessageAck ack)
           
 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

JournalMessageStore

public JournalMessageStore(JournalPersistenceAdapter adapter,
                           MessageStore checkpointStore,
                           String destinationName,
                           boolean sync)
Method Detail

addMessage

public MessageIdentity addMessage(ActiveMQMessage message)
                           throws JMSException
Not synchronized since the Journal has better throughput if you increase the number of conncurrent writes that it is doing.

Specified by:
addMessage in interface MessageStore
Throws:
JMSException

removeMessage

public void removeMessage(MessageIdentity identity,
                          MessageAck ack)
                   throws JMSException
Specified by:
removeMessage in interface MessageStore
Throws:
JMSException

checkpoint

public RecordLocation checkpoint()
                          throws JMSException
Returns:
Throws:
JMSException

getMessage

public ActiveMQMessage getMessage(MessageIdentity identity)
                           throws JMSException
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:
JMSException

recover

public void recover(QueueMessageContainer container)
             throws JMSException
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.

Specified by:
recover in interface MessageStore
Parameters:
container -
Throws:
JMSException

start

public void start()
           throws JMSException
Description copied from interface: Service
Called to start the service

Specified by:
start in interface Service
Throws:
JMSException

stop

public void stop()
          throws JMSException
Description copied from interface: Service
Called to shutdown the service

Specified by:
stop in interface Service
Throws:
JMSException

getLongTermStore

public MessageStore getLongTermStore()
Returns:
Returns the longTermStore.

setCacheMessageStore

public void setCacheMessageStore(CacheMessageStore store)
Specified by:
setCacheMessageStore in interface CacheMessageStoreAware
See Also:
CacheMessageStoreAware.setCacheMessageStore(org.codehaus.activemq.store.cache.CacheMessageStore)


Copyright © 2004 Protique, Ltd.. All Rights Reserved.