public abstract class AbstractMessageStore extends Object implements MessageStore
| Modifier and Type | Field and Description |
|---|---|
protected LinkedDataStore |
dataStore |
protected QueueDefinition |
queueDef |
| Constructor and Description |
|---|
AbstractMessageStore(QueueDefinition queueDef)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the store releasing associated system resources
|
void |
commitChanges()
Ensure everything is persisted (synchronous)
|
void |
commitChanges(SynchronizationBarrier barrier)
Ensure everything is persisted (asynchronous)
|
protected abstract LinkedDataStore |
createDataStore() |
void |
delete(int handle)
Delete message associated to the given handle from the store
|
int |
first()
Get the first message handle stored
|
int |
getAbsoluteStoreUsage()
Get the absolute store usage amount (%)
(Ratio of used space over maximum allocatable space)
|
int |
getStoreUsage()
Get the store usage amount (%)
(Ratio of used space over currently allocated space)
|
void |
init()
Initialize the message store
|
boolean |
isLocked(int handle)
Check if the message associated with a given handle is locked
|
void |
lock(int handle)
Lock the message associated to a given handle
|
int |
next(int handle)
Get the next message handle after the given one
|
int |
previous(int handle)
Get the previous message handle after the given one
|
int |
replace(int handle,
AbstractMessage message)
Replace a message in the store
|
protected abstract int |
replaceMessage(int handle,
AbstractMessage message) |
AbstractMessage |
retrieve(int handle)
Retrieve the message associated to a given handle
|
protected abstract AbstractMessage |
retrieveMessage(int handle)
Retrieve the message with the given handle
|
protected abstract int |
retrieveMessagePriority(int handle)
Retrieve the priority of the message with the given handle
|
int |
size()
Get the number of messages in the store
|
int |
store(AbstractMessage message)
Put some message under in the store after the last message with the same priority
|
protected abstract int |
storeMessage(AbstractMessage message,
int previousHandle)
Store a message right after the given handle
|
String |
toString() |
void |
unlock(int handle)
Unlock the message associated to a given handle
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdelete, getDeliveryMode, isFailSafeprotected QueueDefinition queueDef
protected LinkedDataStore dataStore
public AbstractMessageStore(QueueDefinition queueDef)
protected abstract LinkedDataStore createDataStore()
public void init()
throws javax.jms.JMSException
MessageStoreinit in interface MessageStorejavax.jms.JMSExceptionpublic final int getStoreUsage()
MessageStoregetStoreUsage in interface MessageStorepublic final int getAbsoluteStoreUsage()
MessageStoregetAbsoluteStoreUsage in interface MessageStorepublic final int previous(int handle)
throws javax.jms.JMSException
MessageStoreprevious in interface MessageStorehandle - message handlejavax.jms.JMSExceptionpublic final void delete(int handle)
throws javax.jms.JMSException
MessageStoredelete in interface MessageStorejavax.jms.JMSException - on storage error or invalid handlepublic final int first()
throws javax.jms.JMSException
MessageStorefirst in interface MessageStorejavax.jms.JMSExceptionpublic final int next(int handle)
throws javax.jms.JMSException
MessageStorenext in interface MessageStorehandle - block handlejavax.jms.JMSExceptionpublic final int size()
MessageStoresize in interface MessageStorepublic final void commitChanges(SynchronizationBarrier barrier) throws javax.jms.JMSException
MessageStorecommitChanges in interface MessageStorejavax.jms.JMSExceptionpublic final void commitChanges()
throws javax.jms.JMSException
MessageStorecommitChanges in interface MessageStorejavax.jms.JMSExceptionpublic final void close()
MessageStoreclose in interface MessageStoreprotected abstract AbstractMessage retrieveMessage(int handle) throws javax.jms.JMSException
javax.jms.JMSExceptionprotected abstract int retrieveMessagePriority(int handle)
throws javax.jms.JMSException
javax.jms.JMSExceptionprotected abstract int storeMessage(AbstractMessage message, int previousHandle) throws javax.jms.JMSException
javax.jms.JMSExceptionpublic final AbstractMessage retrieve(int handle) throws javax.jms.JMSException
MessageStoreretrieve in interface MessageStorejavax.jms.JMSException - on storage error or invalid handlepublic final int replace(int handle,
AbstractMessage message)
throws javax.jms.JMSException
MessageStorereplace in interface MessageStorehandle - message handlemessage - the message to storejavax.jms.JMSExceptionprotected abstract int replaceMessage(int handle,
AbstractMessage message)
throws javax.jms.JMSException
javax.jms.JMSExceptionpublic final int store(AbstractMessage message) throws javax.jms.JMSException
MessageStorestore in interface MessageStoremessage - the message to storejavax.jms.JMSExceptionpublic final boolean isLocked(int handle)
throws javax.jms.JMSException
MessageStoreisLocked in interface MessageStorejavax.jms.JMSException - on storage error or invalid handlepublic final void lock(int handle)
throws javax.jms.JMSException
MessageStorelock in interface MessageStorejavax.jms.JMSException - on storage error or invalid handlepublic final void unlock(int handle)
throws javax.jms.JMSException
MessageStoreunlock in interface MessageStorejavax.jms.JMSException - on storage error or invalid handleCopyright © 2019. All rights reserved.