Interface MessageStore
-
- All Known Implementing Classes:
AbstractMessageStore,BlockFileMessageStore,InMemoryMessageStore
public interface MessageStoreMessageStore
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Close the store releasing associated system resourcesvoidcommitChanges()Ensure everything is persisted (synchronous)voidcommitChanges(SynchronizationBarrier barrier)Ensure everything is persisted (asynchronous)voiddelete()Delete the storevoiddelete(int handle)Delete message associated to the given handle from the storeintfirst()Get the first message handle storedintgetAbsoluteStoreUsage()Get the absolute store usage amount (%) (Ratio of used space over maximum allocatable space)intgetDeliveryMode()Get the delivery mode for this storeintgetStoreUsage()Get the store usage amount (%) (Ratio of used space over currently allocated space)voidinit()Initialize the message storebooleanisFailSafe()Test if the store is syncing on writebooleanisLocked(int handle)Check if the message associated with a given handle is lockedvoidlock(int handle)Lock the message associated to a given handleintnext(int handle)Get the next message handle after the given oneintprevious(int handle)Get the previous message handle after the given oneintreplace(int handle, AbstractMessage message)Replace a message in the storeAbstractMessageretrieve(int handle)Retrieve the message associated to a given handleintsize()Get the number of messages in the storeintstore(AbstractMessage message)Put some message under in the store after the last message with the same priorityvoidunlock(int handle)Unlock the message associated to a given handle
-
-
-
Method Detail
-
getStoreUsage
int getStoreUsage()
Get the store usage amount (%) (Ratio of used space over currently allocated space)
-
getAbsoluteStoreUsage
int getAbsoluteStoreUsage()
Get the absolute store usage amount (%) (Ratio of used space over maximum allocatable space)
-
first
int first() throws javax.jms.JMSException
Get the first message handle stored- Returns:
- the first entry handle or -1 if the store is empty
- Throws:
javax.jms.JMSException
-
next
int next(int handle) throws javax.jms.JMSException
Get the next message handle after the given one- Parameters:
handle- block handle- Returns:
- the next entry handle or -1 if their is no successor
- Throws:
javax.jms.JMSException
-
previous
int previous(int handle) throws javax.jms.JMSExceptionGet the previous message handle after the given one- Parameters:
handle- message handle- Returns:
- the previous entry handle or -1 if their is no successor
- Throws:
javax.jms.JMSException
-
store
int store(AbstractMessage message) throws javax.jms.JMSException
Put some message under in the store after the last message with the same priority- Parameters:
message- the message to store- Throws:
javax.jms.JMSException
-
replace
int replace(int handle, AbstractMessage message) throws javax.jms.JMSExceptionReplace a message in the store- Parameters:
handle- message handlemessage- the message to store- Throws:
javax.jms.JMSException
-
delete
void delete(int handle) throws javax.jms.JMSExceptionDelete message associated to the given handle from the store- Throws:
javax.jms.JMSException- on storage error or invalid handle
-
retrieve
AbstractMessage retrieve(int handle) throws javax.jms.JMSException
Retrieve the message associated to a given handle- Throws:
javax.jms.JMSException- on storage error or invalid handle
-
lock
void lock(int handle) throws javax.jms.JMSException
Lock the message associated to a given handle- Throws:
javax.jms.JMSException- on storage error or invalid handle
-
unlock
void unlock(int handle) throws javax.jms.JMSExceptionUnlock the message associated to a given handle- Throws:
javax.jms.JMSException- on storage error or invalid handle
-
isLocked
boolean isLocked(int handle) throws javax.jms.JMSExceptionCheck if the message associated with a given handle is locked- Throws:
javax.jms.JMSException- on storage error or invalid handle
-
size
int size()
Get the number of messages in the store
-
commitChanges
void commitChanges(SynchronizationBarrier barrier) throws javax.jms.JMSException
Ensure everything is persisted (asynchronous)- Throws:
javax.jms.JMSException
-
commitChanges
void commitChanges() throws javax.jms.JMSExceptionEnsure everything is persisted (synchronous)- Throws:
javax.jms.JMSException
-
init
void init() throws javax.jms.JMSException
Initialize the message store- Throws:
javax.jms.JMSException
-
close
void close() throws javax.jms.JMSExceptionClose the store releasing associated system resources- Throws:
javax.jms.JMSException
-
delete
void delete() throws javax.jms.JMSExceptionDelete the store- Throws:
javax.jms.JMSException
-
isFailSafe
boolean isFailSafe()
Test if the store is syncing on write
-
getDeliveryMode
int getDeliveryMode()
Get the delivery mode for this store
-
-