|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.activemq.store.rapid.RapidMessageStore
public class RapidMessageStore
A MessageStore that uses a Journal to store it's messages.
Field Summary | |
---|---|
protected ActiveMQDestination |
destination
|
protected java.util.HashSet |
inFlightTxLocations
|
protected org.apache.activeio.journal.RecordLocation |
lastLocation
|
protected MapContainer |
messageContainer
|
protected RapidPersistenceAdapter |
peristenceAdapter
|
protected RapidTransactionStore |
transactionStore
|
protected TransactionTemplate |
transactionTemplate
|
Constructor Summary | |
---|---|
RapidMessageStore(RapidPersistenceAdapter adapter,
ActiveMQDestination destination,
MapContainer container)
|
Method Summary | |
---|---|
void |
addMessage(ConnectionContext context,
Message message)
Not synchronized 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,
java.lang.String messageRef)
Adds a message reference to the message store |
org.apache.activeio.journal.RecordLocation |
checkpoint()
|
ActiveMQDestination |
getDestination()
The destination that the message store is holding messages for. |
Message |
getMessage(MessageId id)
Looks up a message using either the String messageID or the messageNumber. |
java.lang.String |
getMessageReference(MessageId identity)
Looks up a message using either the String messageID or the messageNumber. |
void |
recover(MessageRecoveryListener 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(ConnectionContext context)
Removes all the messages from the message store. |
void |
removeMessage(ConnectionContext context,
MessageAck ack)
Removes a message from the message store. |
void |
replayAddMessage(ConnectionContext context,
Message message,
org.apache.activeio.journal.RecordLocation location)
|
void |
replayRemoveMessage(ConnectionContext context,
MessageAck ack)
|
void |
setUsageManager(UsageManager usageManager)
|
void |
start()
|
void |
stop()
|
protected static org.apache.activeio.journal.RecordLocation |
toRecordLocation(java.lang.String t)
|
protected static java.lang.String |
toString(org.apache.activeio.journal.RecordLocation location)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final RapidPersistenceAdapter peristenceAdapter
protected final RapidTransactionStore transactionStore
protected final MapContainer messageContainer
protected final ActiveMQDestination destination
protected final TransactionTemplate transactionTemplate
protected org.apache.activeio.journal.RecordLocation lastLocation
protected java.util.HashSet inFlightTxLocations
Constructor Detail |
---|
public RapidMessageStore(RapidPersistenceAdapter adapter, ActiveMQDestination destination, MapContainer container)
Method Detail |
---|
public void addMessage(ConnectionContext context, Message message) throws java.io.IOException
addMessage
in interface MessageStore
context
- TODO
java.io.IOException
protected static java.lang.String toString(org.apache.activeio.journal.RecordLocation location)
protected static org.apache.activeio.journal.RecordLocation toRecordLocation(java.lang.String t)
public void replayAddMessage(ConnectionContext context, Message message, org.apache.activeio.journal.RecordLocation location)
public void removeMessage(ConnectionContext context, MessageAck ack) throws java.io.IOException
MessageStore
removeMessage
in interface MessageStore
context
- TODOack
- 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.
java.io.IOException
public void replayRemoveMessage(ConnectionContext context, MessageAck ack)
public Message getMessage(MessageId id) throws java.io.IOException
MessageStore
getMessage
in interface MessageStore
id
- which contains either the messageID or the messageNumber
java.io.IOException
public void recover(MessageRecoveryListener listener) throws java.lang.Exception
recover
in interface MessageStore
listener
-
java.lang.Exception
public void start() throws java.lang.Exception
start
in interface Service
java.lang.Exception
public void stop() throws java.lang.Exception
stop
in interface Service
java.lang.Exception
public void removeAllMessages(ConnectionContext context) throws java.io.IOException
MessageStore
removeAllMessages
in interface MessageStore
context
- TODO
java.io.IOException
MessageStore.removeAllMessages(ConnectionContext)
public ActiveMQDestination getDestination()
MessageStore
getDestination
in interface MessageStore
public void addMessageReference(ConnectionContext context, MessageId messageId, long expirationTime, java.lang.String messageRef) throws java.io.IOException
MessageStore
addMessageReference
in interface MessageStore
context
- TODOmessageId
- TODOexpirationTime
- TODO
java.io.IOException
public java.lang.String getMessageReference(MessageId identity) throws java.io.IOException
MessageStore
getMessageReference
in interface MessageStore
identity
- which contains either the messageID or the messageNumber
java.io.IOException
public void setUsageManager(UsageManager usageManager)
setUsageManager
in interface MessageStore
usageManager
- The UsageManager that is controlling the destination's memory usage.public org.apache.activeio.journal.RecordLocation checkpoint() throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |