org.springframework.integration.store
Class AbstractMessageGroupStore
java.lang.Object
org.springframework.integration.store.AbstractMessageGroupStore
- All Implemented Interfaces:
- Iterable<MessageGroup>, MessageGroupStore
- Direct Known Subclasses:
- JdbcMessageStore, SimpleMessageStore
public abstract class AbstractMessageGroupStore
- extends Object
- implements MessageGroupStore, Iterable<MessageGroup>
- Since:
- 2.0
- Author:
- Dave Syer
Field Summary |
protected org.apache.commons.logging.Log |
logger
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
protected final org.apache.commons.logging.Log logger
AbstractMessageGroupStore
public AbstractMessageGroupStore()
setExpiryCallbacks
public void setExpiryCallbacks(Collection<MessageGroupCallback> expiryCallbacks)
- Convenient injection point for expiry callbacks in the message store. Each of the callbacks provided will simply
be registered with the store using
registerMessageGroupExpiryCallback(MessageGroupCallback)
.
- Parameters:
expiryCallbacks
- the expiry callbacks to add
registerMessageGroupExpiryCallback
public void registerMessageGroupExpiryCallback(MessageGroupCallback callback)
- Description copied from interface:
MessageGroupStore
- Register a callback for when a message group is expired through
MessageGroupStore.expireMessageGroups(long)
.
- Specified by:
registerMessageGroupExpiryCallback
in interface MessageGroupStore
- Parameters:
callback
- a callback to execute when a message group is cleaned up
expireMessageGroups
public int expireMessageGroups(long timeout)
- Description copied from interface:
MessageGroupStore
- 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. For example: call with a timeout of 100 to expire all groups
that were created more than 100 milliseconds ago, and are not yet complete. Use a timeout of 0 (or negative to be
on the safe side) to expire all message groups.
- Specified by:
expireMessageGroups
in interface MessageGroupStore
- Parameters:
timeout
- the timeout threshold to use
- Returns:
- the number of message groups expired
- See Also:
MessageGroupStore.registerMessageGroupExpiryCallback(MessageGroupCallback)
iterator
public abstract Iterator<MessageGroup> iterator()
- Specified by:
iterator
in interface Iterable<MessageGroup>
Copyright © 2010. All Rights Reserved.