|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.integration.handler.AbstractMessageHandler
org.springframework.integration.aggregator.AbstractMessageBarrierHandler
org.springframework.integration.aggregator.AbstractMessageAggregator
public abstract class AbstractMessageAggregator
A base class for aggregating a group of Messages into a single Message.
Extends AbstractMessageBarrierHandler
and waits for a
complete group of Messages
to arrive. Subclasses
must provide the implementation of the aggregateMessages(List)
method to combine the group of Messages into a single Message
.
The default strategy for determining whether a group is complete is based
on the 'sequenceSize
' property of the header. Alternatively, a
custom implementation of the CompletionStrategy
may be provided.
All considerations regarding timeout
and grouping by
correlationId
from AbstractMessageBarrierHandler
apply here as well.
Field Summary |
---|
Fields inherited from class org.springframework.integration.aggregator.AbstractMessageBarrierHandler |
---|
barriers, DEFAULT_REAPER_INTERVAL, DEFAULT_SEND_TIMEOUT, DEFAULT_TIMEOUT, DEFAULT_TRACKED_CORRRELATION_ID_CAPACITY, logger, trackedCorrelationIds |
Constructor Summary | |
---|---|
AbstractMessageAggregator()
|
Method Summary | |
---|---|
protected abstract Message<?> |
aggregateMessages(java.util.List<Message<?>> messages)
|
protected MessageBarrier |
createMessageBarrier()
Factory method for creating a suitable MessageBarrier implementation. |
protected boolean |
isBarrierRemovable(java.lang.Object correlationId,
java.util.List<Message<?>> releasedMessages)
Implements the logic for deciding whether, based on what the MessageBarrier has released so far, work for the correlationId can be considered complete and the barrier can be released. |
protected Message<?>[] |
processReleasedMessages(java.lang.Object correlationId,
java.util.List<Message<?>> messages)
Implements the logic for transforming the released Messages. |
void |
setCompletionStrategy(CompletionStrategy completionStrategy)
Strategy to determine whether the group of messages is complete. |
Methods inherited from class org.springframework.integration.aggregator.AbstractMessageBarrierHandler |
---|
afterPropertiesSet, handleMessageInternal, isRunning, resolveReplyChannelFromMessage, setDiscardChannel, setOutputChannel, setReaperInterval, setSendPartialResultOnTimeout, setSendTimeout, setTaskScheduler, setTimeout, setTrackedCorrelationIdCapacity, start, stop |
Methods inherited from class org.springframework.integration.handler.AbstractMessageHandler |
---|
handleMessage |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractMessageAggregator()
Method Detail |
---|
public void setCompletionStrategy(CompletionStrategy completionStrategy)
protected MessageBarrier createMessageBarrier()
AbstractMessageBarrierHandler
createMessageBarrier
in class AbstractMessageBarrierHandler
protected boolean isBarrierRemovable(java.lang.Object correlationId, java.util.List<Message<?>> releasedMessages)
AbstractMessageBarrierHandler
isBarrierRemovable
in class AbstractMessageBarrierHandler
protected Message<?>[] processReleasedMessages(java.lang.Object correlationId, java.util.List<Message<?>> messages)
AbstractMessageBarrierHandler
processReleasedMessages
in class AbstractMessageBarrierHandler
protected abstract Message<?> aggregateMessages(java.util.List<Message<?>> messages)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |