|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.activemq.store.howl.HowlMessageStore
An implementation of MessageStore
designed for
optimal use with Howl
as the transaction log and then checkpointing asynchronously
on a timeout with some other persistent storage.
Constructor Summary | |
HowlMessageStore(HowlPersistenceAdapter adapter,
MessageStore checkpointStore,
org.objectweb.howl.log.Logger transactionLog,
WireFormat wireFormat)
|
Method Summary | |
MessageIdentity |
addMessage(ActiveMQMessage message)
This method is synchronized to ensure that only 1 thread can write to the log and cache and possibly checkpoint at once, to preserve order across the transaction log, cache and checkpointStore. |
protected boolean |
addMessageToCache(ActiveMQMessage message)
Adds the given message to the cache if there is spare capacity |
void |
checkpoint()
Writes the current RAM cache to the long term, checkpoint store so that the transaction log can be truncated. |
protected void |
checkpoint(ActiveMQMessage message)
Writes the current RAM image of the transaction log to stable, checkpoint store |
protected JMSException |
createRecoveryFailedException(Exception e)
|
protected JMSException |
createWriteException(Packet packet,
Exception e)
|
int |
getMaximumCacheSize()
|
ActiveMQMessage |
getMessage(MessageIdentity identity)
Lets ensure that readers don't block writers so there only synchronization on the cache and checkpointStore. |
protected void |
readPacket(org.objectweb.howl.log.LogRecord logRecord,
QueueMessageContainer container)
|
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)
Removes can be done in any order so we only synchronize on the cache and checkpointStore |
void |
setMaximumCacheSize(int maximumCacheSize)
|
void |
start()
Called to start the service |
void |
stop()
Called to shutdown the service |
protected void |
writePacket(Packet packet)
Writes a message to the transaction log using the current sync mode |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public HowlMessageStore(HowlPersistenceAdapter adapter, MessageStore checkpointStore, org.objectweb.howl.log.Logger transactionLog, WireFormat wireFormat)
Method Detail |
public MessageIdentity addMessage(ActiveMQMessage message) throws JMSException
addMessage
in interface MessageStore
JMSException
public ActiveMQMessage getMessage(MessageIdentity identity) throws JMSException
getMessage
in interface MessageStore
identity
- which contains either the messageID or the messageNumber
JMSException
public void removeMessage(MessageIdentity identity, MessageAck ack) throws JMSException
removeMessage
in interface MessageStore
JMSException
public void recover(QueueMessageContainer container) throws JMSException
recover
in interface MessageStore
container
-
JMSException
public void start() throws JMSException
Service
start
in interface Service
JMSException
public void stop() throws JMSException
Service
stop
in interface Service
JMSException
public void checkpoint() throws JMSException
JMSException
public int getMaximumCacheSize()
public void setMaximumCacheSize(int maximumCacheSize)
protected void checkpoint(ActiveMQMessage message) throws JMSException
message
- is an optional message. This is null for timer based
checkpoints or is the message which cannot fit into the cache if cache-exhaustion
based checkpoints
JMSException
protected boolean addMessageToCache(ActiveMQMessage message)
message
-
protected void readPacket(org.objectweb.howl.log.LogRecord logRecord, QueueMessageContainer container)
protected void writePacket(Packet packet) throws JMSException
JMSException
protected JMSException createRecoveryFailedException(Exception e)
protected JMSException createWriteException(Packet packet, Exception e)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |