Class SequenceSizeReleaseStrategy

java.lang.Object
org.springframework.integration.aggregator.SequenceSizeReleaseStrategy
All Implemented Interfaces:
ReleaseStrategy

public class SequenceSizeReleaseStrategy
extends java.lang.Object
implements 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.
  • Constructor Summary

    Constructors 
    Constructor Description
    SequenceSizeReleaseStrategy()
    Construct 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 Type Method Description
    boolean canRelease​(MessageGroup messageGroup)  
    void setReleasePartialSequences​(boolean releasePartialSequences)
    Flag that determines if partial sequences are allowed.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      public boolean canRelease​(MessageGroup messageGroup)
      Specified by:
      canRelease in interface ReleaseStrategy