public class ProxyMessageStore extends Object implements MessageStore
Constructor and Description |
---|
ProxyMessageStore(MessageStore delegate) |
Modifier and Type | Method and Description |
---|---|
void |
addMessage(ConnectionContext context,
Message message)
Adds a message to the message store
|
void |
addMessage(ConnectionContext context,
Message message,
boolean canOptimizeHint)
Adds a message to the message store
|
ListenableFuture<Object> |
asyncAddQueueMessage(ConnectionContext context,
Message message)
Adds a message to the message store
|
ListenableFuture<Object> |
asyncAddQueueMessage(ConnectionContext context,
Message message,
boolean canOptimizeHint)
Adds a message to the message store
|
ListenableFuture<Object> |
asyncAddTopicMessage(ConnectionContext context,
Message message)
Adds a message to the message store
|
ListenableFuture<Object> |
asyncAddTopicMessage(ConnectionContext context,
Message message,
boolean canOptimizeHint)
Adds a message to the message store
|
void |
dispose(ConnectionContext context) |
MessageStore |
getDelegate() |
ActiveMQDestination |
getDestination()
The destination that the message store is holding messages for.
|
Message |
getMessage(MessageId identity)
Looks up a message using either the String messageID or the
messageNumber.
|
int |
getMessageCount() |
long |
getMessageSize() |
MessageStoreStatistics |
getMessageStoreStatistics() |
boolean |
isEmpty()
flag to indicate if the store is empty
|
boolean |
isPrioritizedMessages() |
void |
recover(MessageRecoveryListener listener)
Recover any messages to be delivered.
|
void |
recoverNextMessages(int maxReturned,
MessageRecoveryListener listener) |
void |
registerIndexListener(IndexListener indexListener) |
void |
removeAllMessages(ConnectionContext context)
Removes all the messages from the message store.
|
void |
removeAsyncMessage(ConnectionContext context,
MessageAck ack) |
void |
removeMessage(ConnectionContext context,
MessageAck ack)
Removes a message from the message store.
|
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 |
setMemoryUsage(MemoryUsage memoryUsage) |
void |
setPrioritizedMessages(boolean prioritizedMessages)
A hint to the store to try recover messages according to priority
|
void |
start() |
void |
stop() |
String |
toString() |
void |
updateMessage(Message message) |
public ProxyMessageStore(MessageStore delegate)
public MessageStore getDelegate()
public void addMessage(ConnectionContext context, Message message) throws IOException
MessageStore
addMessage
in interface MessageStore
context
- contextIOException
public void addMessage(ConnectionContext context, Message message, boolean canOptimizeHint) throws IOException
MessageStore
addMessage
in interface MessageStore
context
- contextcanOptimizeHint
- - give a hint to the store that the message may be consumed before it hits the diskIOException
public Message getMessage(MessageId identity) throws IOException
MessageStore
getMessage
in interface MessageStore
identity
- which contains either the messageID or the messageNumberIOException
public void recover(MessageRecoveryListener listener) throws Exception
MessageStore
recover
in interface MessageStore
Exception
public void removeAllMessages(ConnectionContext context) throws IOException
MessageStore
removeAllMessages
in interface MessageStore
IOException
public void removeMessage(ConnectionContext context, MessageAck ack) throws IOException
MessageStore
removeMessage
in interface 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 dispose(ConnectionContext context)
dispose
in interface MessageStore
public ActiveMQDestination getDestination()
MessageStore
getDestination
in interface MessageStore
public void setMemoryUsage(MemoryUsage memoryUsage)
setMemoryUsage
in interface MessageStore
memoryUsage
- The SystemUsage that is controlling the
destination's memory usage.public int getMessageCount() throws IOException
getMessageCount
in interface MessageStore
IOException
public long getMessageSize() throws IOException
getMessageSize
in interface MessageStore
IOException
public void recoverNextMessages(int maxReturned, MessageRecoveryListener listener) throws Exception
recoverNextMessages
in interface MessageStore
Exception
public void resetBatching()
MessageStore
resetBatching
in interface MessageStore
public void setBatch(MessageId messageId) throws Exception
MessageStore
setBatch
in interface MessageStore
Exception
public boolean isEmpty() throws Exception
MessageStore
isEmpty
in interface MessageStore
Exception
public ListenableFuture<Object> asyncAddQueueMessage(ConnectionContext context, Message message) throws IOException
MessageStore
asyncAddQueueMessage
in interface MessageStore
context
- contextIOException
public ListenableFuture<Object> asyncAddQueueMessage(ConnectionContext context, Message message, boolean canOptimizeHint) throws IOException
MessageStore
asyncAddQueueMessage
in interface MessageStore
context
- contextcanOptimizeHint
- - give a hint to the store that the message may be consumed before it hits the diskIOException
public ListenableFuture<Object> asyncAddTopicMessage(ConnectionContext context, Message message) throws IOException
MessageStore
asyncAddTopicMessage
in interface MessageStore
context
- contextIOException
public ListenableFuture<Object> asyncAddTopicMessage(ConnectionContext context, Message message, boolean canOptimizeHint) throws IOException
MessageStore
asyncAddTopicMessage
in interface MessageStore
context
- contextcanOptimizeHint
- - give a hint to the store that the message may be consumed before it hits the diskIOException
public void removeAsyncMessage(ConnectionContext context, MessageAck ack) throws IOException
removeAsyncMessage
in interface MessageStore
IOException
public void setPrioritizedMessages(boolean prioritizedMessages)
MessageStore
setPrioritizedMessages
in interface MessageStore
public boolean isPrioritizedMessages()
isPrioritizedMessages
in interface MessageStore
public void updateMessage(Message message) throws IOException
updateMessage
in interface MessageStore
IOException
public void registerIndexListener(IndexListener indexListener)
registerIndexListener
in interface MessageStore
public MessageStoreStatistics getMessageStoreStatistics()
getMessageStoreStatistics
in interface MessageStore
Copyright © 2005–2019 The Apache Software Foundation. All rights reserved.