public abstract class AbstractMessageGroupStore extends java.lang.Object implements MessageGroupStore, java.lang.Iterable<MessageGroup>
MessageGroupStore.MessageGroupCallback| Modifier and Type | Field and Description |
|---|---|
protected org.apache.commons.logging.Log |
logger |
| Constructor and Description |
|---|
AbstractMessageGroupStore() |
| Modifier and Type | Method and Description |
|---|---|
int |
expireMessageGroups(long timeout)
Extract all expired groups (whose timestamp is older than the current time less the threshold provided) and call
each of the registered callbacks on them in turn.
|
int |
getMessageCountForAllMessageGroups()
Optional attribute giving the number of messages in the store over all groups.
|
int |
getMessageGroupCount()
Optional attribute giving the number of message groups.
|
boolean |
isTimeoutOnIdle() |
void |
registerMessageGroupExpiryCallback(MessageGroupStore.MessageGroupCallback callback)
Register a callback for when a message group is expired through
MessageGroupStore.expireMessageGroups(long). |
void |
setExpiryCallbacks(java.util.Collection<MessageGroupStore.MessageGroupCallback> expiryCallbacks)
Convenient injection point for expiry callbacks in the message store.
|
void |
setTimeoutOnIdle(boolean timeoutOnIdle)
Allows you to override the rule for the timeout calculation.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddMessageToGroup, completeGroup, getMessageGroup, iterator, messageGroupSize, pollMessageFromGroup, removeMessageFromGroup, removeMessageGroup, setLastReleasedSequenceNumberForGrouppublic void setExpiryCallbacks(java.util.Collection<MessageGroupStore.MessageGroupCallback> expiryCallbacks)
MessageGroupStore.registerMessageGroupExpiryCallback(MessageGroupCallback).expiryCallbacks - the expiry callbacks to addpublic boolean isTimeoutOnIdle()
public void setTimeoutOnIdle(boolean timeoutOnIdle)
MessageGroup was created. If you want the timeout to be based on the time
the MessageGroup was idling (e.g., inactive from the last update) invoke this method with 'true'.
Default is 'false'.public void registerMessageGroupExpiryCallback(MessageGroupStore.MessageGroupCallback callback)
MessageGroupStoreMessageGroupStore.expireMessageGroups(long).registerMessageGroupExpiryCallback in interface MessageGroupStorecallback - a callback to execute when a message group is cleaned uppublic int expireMessageGroups(long timeout)
MessageGroupStoreexpireMessageGroups in interface MessageGroupStoretimeout - the timeout threshold to useMessageGroupStore.registerMessageGroupExpiryCallback(MessageGroupCallback)@ManagedAttribute public int getMessageCountForAllMessageGroups()
MessageGroupStoregetMessageCountForAllMessageGroups in interface MessageGroupStore@ManagedAttribute public int getMessageGroupCount()
MessageGroupStoregetMessageGroupCount in interface MessageGroupStore