Class SequenceSizeReleaseStrategy
java.lang.Object
org.springframework.integration.aggregator.SequenceSizeReleaseStrategy
- All Implemented Interfaces:
ReleaseStrategy
An implementation of
ReleaseStrategy
that simply compares the current size of
the message list to the expected 'sequenceSize'. Supports release of partial sequences.
Correlating message handlers prevent the addition of duplicate sequences to the group.- Author:
- Mark Fisher, Marius Bogoevici, Dave Syer, Iwein Fuld, Oleg Zhurakousky, Artem Bilan, Enrique Rodriguez
-
Constructor Summary
ConstructorDescriptionConstruct an instance that does not support releasing partial sequences.SequenceSizeReleaseStrategy
(boolean releasePartialSequences) Construct an instance that supports releasing partial sequences if releasePartialSequences is true. -
Method Summary
Modifier and TypeMethodDescriptionboolean
canRelease
(MessageGroup messageGroup) void
setReleasePartialSequences
(boolean releasePartialSequences) Flag that determines if partial sequences are allowed.
-
Constructor Details
-
SequenceSizeReleaseStrategy
public SequenceSizeReleaseStrategy()Construct an instance that does not support releasing partial sequences. -
SequenceSizeReleaseStrategy
public SequenceSizeReleaseStrategy(boolean releasePartialSequences) Construct an instance that supports releasing partial sequences if releasePartialSequences is true. This can be an expensive operation on large groups.- Parameters:
releasePartialSequences
- true to allow the release of partial sequences.
-
-
Method Details
-
setReleasePartialSequences
public void setReleasePartialSequences(boolean releasePartialSequences) Flag that determines if partial sequences are allowed. If true then as soon as enough messages arrive that can be ordered they will be released, provided they all have sequence numbers greater than those already released. This can be an expensive operation for large groups.- Parameters:
releasePartialSequences
- true when partial sequences should be released.
-
canRelease
- Specified by:
canRelease
in interfaceReleaseStrategy
-