public abstract class AbstractMessageStore extends Object implements MessageStore
Modifier and Type | Field and Description |
---|---|
protected ActiveMQDestination |
destination |
static FutureTask<Object> |
FUTURE |
protected boolean |
prioritizedMessages |
Constructor and Description |
---|
AbstractMessageStore(ActiveMQDestination destination) |
Modifier and Type | Method and Description |
---|---|
void |
addMessage(ConnectionContext context,
Message message,
boolean canOptimizeHint)
Adds a message to the message store
|
Future<Object> |
asyncAddQueueMessage(ConnectionContext context,
Message message)
Adds a message to the message store
|
Future<Object> |
asyncAddQueueMessage(ConnectionContext context,
Message message,
boolean canOptimizeHint)
Adds a message to the message store
|
Future<Object> |
asyncAddTopicMessage(ConnectionContext context,
Message message)
Adds a message to the message store
|
Future<Object> |
asyncAddTopicMessage(ConnectionContext context,
Message message,
boolean canOptimizeHint)
Adds a message to the message store
|
void |
dispose(ConnectionContext context) |
ActiveMQDestination |
getDestination()
The destination that the message store is holding messages for.
|
boolean |
isEmpty()
flag to indicate if the store is empty
|
boolean |
isPrioritizedMessages() |
void |
removeAsyncMessage(ConnectionContext context,
MessageAck ack) |
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() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addMessage, getMessage, getMessageCount, recover, recoverNextMessages, removeAllMessages, removeMessage, resetBatching
public static final FutureTask<Object> FUTURE
protected final ActiveMQDestination destination
protected boolean prioritizedMessages
public AbstractMessageStore(ActiveMQDestination destination)
public void dispose(ConnectionContext context)
dispose
in interface MessageStore
public void start() throws Exception
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 void setBatch(MessageId messageId) throws IOException, Exception
MessageStore
setBatch
in interface MessageStore
Exception
IOException
public boolean isEmpty() throws Exception
isEmpty
in interface MessageStore
Exception
public void setPrioritizedMessages(boolean prioritizedMessages)
MessageStore
setPrioritizedMessages
in interface MessageStore
public boolean isPrioritizedMessages()
isPrioritizedMessages
in interface MessageStore
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 Future<Object> asyncAddQueueMessage(ConnectionContext context, Message message) throws IOException
MessageStore
asyncAddQueueMessage
in interface MessageStore
context
- contextIOException
public Future<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 Future<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 Future<Object> asyncAddTopicMessage(ConnectionContext context, Message message) throws IOException
MessageStore
asyncAddTopicMessage
in interface MessageStore
context
- contextIOException
public void removeAsyncMessage(ConnectionContext context, MessageAck ack) throws IOException
removeAsyncMessage
in interface MessageStore
IOException
Copyright © 2005–2016 The Apache Software Foundation. All rights reserved.