|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.activemq.store.amq.AMQMessageStore
public class AMQMessageStore
A MessageStore that uses a Journal to store it's messages.
| Field Summary | |
|---|---|
protected TaskRunner |
asyncWriteTask
|
protected ActiveMQDestination |
destination
|
protected CountDownLatch |
flushLatch
|
protected Set<Location> |
inFlightTxLocations
|
protected Location |
lastLocation
|
protected Location |
lastWrittenLocation
|
protected Lock |
lock
|
protected AMQPersistenceAdapter |
peristenceAdapter
|
protected ReferenceStore |
referenceStore
|
protected AMQTransactionStore |
transactionStore
|
protected TransactionTemplate |
transactionTemplate
|
| Constructor Summary | |
|---|---|
AMQMessageStore(AMQPersistenceAdapter adapter,
ReferenceStore referenceStore,
ActiveMQDestination destination)
|
|
| Method Summary | |
|---|---|
void |
addMessage(ConnectionContext context,
Message message)
Not synchronize since the Journal has better throughput if you increase the number of concurrent writes that it is doing. |
void |
addMessageReference(ConnectionContext context,
MessageId messageId,
long expirationTime,
String messageRef)
|
protected Location |
doAsyncWrite()
|
void |
flush()
Waits till the lastest data has landed on the referenceStore |
ActiveMQDestination |
getDestination()
The destination that the message store is holding messages for. |
protected Location |
getLocation(MessageId messageId)
|
Location |
getMark()
|
Message |
getMessage(MessageId identity)
Looks up a message using either the String messageID or the messageNumber. |
int |
getMessageCount()
|
String |
getMessageReference(MessageId identity)
|
ReferenceStore |
getReferenceStore()
|
void |
recover(MessageRecoveryListener listener)
Replays the referenceStore first as those messages are the oldest ones, then messages are replayed from the transaction log and then the cache is updated. |
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. |
boolean |
replayAddMessage(ConnectionContext context,
Message message,
Location location)
|
boolean |
replayRemoveMessage(ConnectionContext context,
MessageAck messageAck)
|
void |
resetBatching()
A hint to the Store to reset any batching state for the Destination |
void |
setMemoryUsage(MemoryUsage memoryUsage)
|
void |
start()
|
void |
stop()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final AMQPersistenceAdapter peristenceAdapter
protected final AMQTransactionStore transactionStore
protected final ReferenceStore referenceStore
protected final ActiveMQDestination destination
protected final TransactionTemplate transactionTemplate
protected Location lastLocation
protected Location lastWrittenLocation
protected Set<Location> inFlightTxLocations
protected final TaskRunner asyncWriteTask
protected CountDownLatch flushLatch
protected final Lock lock
| Constructor Detail |
|---|
public AMQMessageStore(AMQPersistenceAdapter adapter,
ReferenceStore referenceStore,
ActiveMQDestination destination)
| Method Detail |
|---|
public void setMemoryUsage(MemoryUsage memoryUsage)
setMemoryUsage in interface MessageStorememoryUsage - The SystemUsage that is controlling the
destination's memory usage.
public final void addMessage(ConnectionContext context,
Message message)
throws IOException
addMessage in interface MessageStorecontext - context
IOException
public boolean replayAddMessage(ConnectionContext context,
Message message,
Location location)
public void removeMessage(ConnectionContext context,
MessageAck ack)
throws IOException
MessageStore
removeMessage in interface MessageStoreack - 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.
IOException
public boolean replayRemoveMessage(ConnectionContext context,
MessageAck messageAck)
public void flush()
throws InterruptedIOException
InterruptedIOException
protected Location doAsyncWrite()
throws IOException
IOException
public Message getMessage(MessageId identity)
throws IOException
MessageStore
getMessage in interface MessageStoreidentity - which contains either the messageID or the messageNumber
IOException
protected Location getLocation(MessageId messageId)
throws IOException
IOException
public void recover(MessageRecoveryListener listener)
throws Exception
recover in interface MessageStorelistener -
Exception
public void start()
throws Exception
start in interface ServiceException
public void stop()
throws Exception
stop in interface ServiceExceptionpublic ReferenceStore getReferenceStore()
public void removeAllMessages(ConnectionContext context)
throws IOException
MessageStore
removeAllMessages in interface MessageStoreIOExceptionMessageStore.removeAllMessages(ConnectionContext)public ActiveMQDestination getDestination()
MessageStore
getDestination in interface MessageStore
public void addMessageReference(ConnectionContext context,
MessageId messageId,
long expirationTime,
String messageRef)
throws IOException
IOException
public String getMessageReference(MessageId identity)
throws IOException
IOException
public int getMessageCount()
throws IOException
getMessageCount in interface MessageStoreIOExceptionMessageStore.getMessageCount()
public void recoverNextMessages(int maxReturned,
MessageRecoveryListener listener)
throws Exception
recoverNextMessages in interface MessageStoreExceptionpublic void resetBatching()
MessageStore
resetBatching in interface MessageStorepublic Location getMark()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||