public class MemoryMessageStore extends AbstractMessageStore
MessageStore
Modifier and Type | Field and Description |
---|---|
protected MessageId |
lastBatchId |
protected Map<MessageId,Message> |
messageTable |
protected long |
sequenceId |
destination, FUTURE, indexListener, messageStoreStatistics, prioritizedMessages
Constructor and Description |
---|
MemoryMessageStore(ActiveMQDestination destination) |
MemoryMessageStore(ActiveMQDestination destination,
Map<MessageId,Message> messageTable) |
Modifier and Type | Method and Description |
---|---|
void |
addMessage(ConnectionContext context,
Message message)
Adds a message to the message store
|
protected static void |
decMessageStoreStatistics(MessageStoreStatistics stats,
Message message) |
void |
delete() |
Message |
getMessage(MessageId identity)
Looks up a message using either the String messageID or the
messageNumber.
|
protected static void |
incMessageStoreStatistics(MessageStoreStatistics stats,
Message message) |
void |
recover(MessageRecoveryListener listener)
Recover any messages to be delivered.
|
void |
recoverMessageStoreStatistics() |
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.
|
void |
removeMessage(MessageId msgId) |
void |
resetBatching()
A hint to the Store to reset any batching state for the Destination
|
void |
setBatch(MessageId messageId)
allow caching cursors to set the current batch offset when cache is exhausted
|
void |
updateMessage(Message message) |
addMessage, asyncAddQueueMessage, asyncAddQueueMessage, asyncAddTopicMessage, asyncAddTopicMessage, dispose, getDestination, getIndexListener, getMessageCount, getMessageSize, getMessageStoreStatistics, isEmpty, isPrioritizedMessages, registerIndexListener, removeAsyncMessage, setMemoryUsage, setPrioritizedMessages, start, stop
protected final Map<MessageId,Message> messageTable
protected MessageId lastBatchId
protected long sequenceId
public MemoryMessageStore(ActiveMQDestination destination)
public MemoryMessageStore(ActiveMQDestination destination, Map<MessageId,Message> messageTable)
public void addMessage(ConnectionContext context, Message message) throws IOException
MessageStore
context
- contextIOException
public Message getMessage(MessageId identity) throws IOException
MessageStore
identity
- which contains either the messageID or the messageNumberIOException
public void removeMessage(ConnectionContext context, MessageAck ack) throws IOException
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.IOException
public void removeMessage(MessageId msgId) throws IOException
IOException
public void recover(MessageRecoveryListener listener) throws Exception
MessageStore
Exception
public void removeAllMessages(ConnectionContext context) throws IOException
MessageStore
IOException
public void delete()
public void recoverNextMessages(int maxReturned, MessageRecoveryListener listener) throws Exception
Exception
public void resetBatching()
MessageStore
public void setBatch(MessageId messageId)
MessageStore
setBatch
in interface MessageStore
setBatch
in class AbstractMessageStore
public void updateMessage(Message message)
updateMessage
in interface MessageStore
updateMessage
in class AbstractMessageStore
public void recoverMessageStoreStatistics() throws IOException
recoverMessageStoreStatistics
in class AbstractMessageStore
IOException
protected static final void incMessageStoreStatistics(MessageStoreStatistics stats, Message message)
protected static final void decMessageStoreStatistics(MessageStoreStatistics stats, Message message)
Copyright © 2005–2019 The Apache Software Foundation. All rights reserved.