|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.integration.aggregator.AbstractMessageBarrierHandler
org.springframework.integration.aggregator.AggregatingMessageHandler
public class AggregatingMessageHandler
An AbstractMessageBarrierHandler that waits for a complete
group of Messages to arrive and then delegates to an
Aggregator to combine them 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 | |
|---|---|
private Aggregator |
aggregator
|
private CompletionStrategy |
completionStrategy
|
| Fields inherited from class org.springframework.integration.aggregator.AbstractMessageBarrierHandler |
|---|
barriers, DEFAULT_REAPER_INTERVAL, DEFAULT_SEND_TIMEOUT, DEFAULT_TIMEOUT, DEFAULT_TRACKED_CORRRELATION_ID_CAPACITY, executor, logger, outputChannel, sendTimeout, trackedCorrelationIds |
| Constructor Summary | |
|---|---|
AggregatingMessageHandler(Aggregator aggregator)
|
|
AggregatingMessageHandler(Aggregator aggregator,
java.util.concurrent.ScheduledExecutorService executor)
Create a handler that delegates to the provided aggregator to combine a group of messages into a single message. |
|
| Method Summary | |
|---|---|
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 done 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, handle, resolveReplyTargetFromMessage, setDiscardChannel, setOutputChannel, setReaperInterval, setSendPartialResultOnTimeout, setSendTimeout, setTimeout, setTrackedCorrelationIdCapacity |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final Aggregator aggregator
private volatile CompletionStrategy completionStrategy
| Constructor Detail |
|---|
public AggregatingMessageHandler(Aggregator aggregator,
java.util.concurrent.ScheduledExecutorService executor)
null, a new
single-threaded executor will be created.
public AggregatingMessageHandler(Aggregator aggregator)
| 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
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||