org.springframework.integration.router
Class AggregationBarrier
java.lang.Object
org.springframework.integration.router.AggregationBarrier
- All Implemented Interfaces:
- MessageBarrier
public class AggregationBarrier
- extends java.lang.Object
- implements MessageBarrier
MessageBarrier implementation for message aggregation. Delegates to a
CompletionStrategy
to determine when the group of messages is ready
for aggregation.
- Author:
- Marius Bogoevici, Mark Fisher
Method Summary |
java.util.List<Message<?>> |
addAndRelease(Message<?> message)
Adds a message to the aggregation group and releases if complete. |
java.util.List<Message<?>> |
getMessages()
|
long |
getTimestamp()
Returns the creation time of this barrier as the number of milliseconds
since January 1, 1970. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
private final org.apache.commons.logging.Log logger
messages
private final java.util.List<Message<?>> messages
completionStrategy
private final CompletionStrategy completionStrategy
complete
private volatile boolean complete
lock
private final java.util.concurrent.locks.ReentrantLock lock
timestamp
private final long timestamp
AggregationBarrier
public AggregationBarrier(CompletionStrategy completionStrategy)
- Create an AggregationBarrier with the given
CompletionStrategy
.
getTimestamp
public long getTimestamp()
- Returns the creation time of this barrier as the number of milliseconds
since January 1, 1970.
- See Also:
System.currentTimeMillis()
addAndRelease
public java.util.List<Message<?>> addAndRelease(Message<?> message)
- Adds a message to the aggregation group and releases if complete.
Otherwise, the return value will be
null
.
- Specified by:
addAndRelease
in interface MessageBarrier
getMessages
public java.util.List<Message<?>> getMessages()