Enum Class AggregateCommitPolicy

java.lang.Object
java.lang.Enum<AggregateCommitPolicy>
io.fluxzero.sdk.modeling.AggregateCommitPolicy
All Implemented Interfaces:
Serializable, Comparable<AggregateCommitPolicy>, Constable

public enum AggregateCommitPolicy extends Enum<AggregateCommitPolicy>
Controls when aggregate changes are committed and whether multiple commits in the same completion phase may run concurrently.
  • Nested Class Summary

    Nested classes/interfaces inherited from class Enum

    Enum.EnumDesc<E>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Start commits at the end of the current message batch and wait for all started commits before the batch completion phase finishes.
    Start commits after every handler and wait for all started commits at the end of the handler completion phase.
    Start commits after every handler, keep the aggregate active for the rest of the current batch, and wait for all started commits at the end of the batch completion phase.
    Resolve the policy from the active Fluxzero defaults version or explicit application properties.
    Commit at the end of the current message batch and wait for each commit before continuing.
    Commit after every handler and wait for that commit before the handler completion phase finishes.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Controls whether request results wait for asynchronous aggregate commits that were started after a handler and are awaited at batch completion.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns whether this policy commits at batch completion rather than handler completion.
    boolean
    Returns whether this policy allows commits from the same completion phase to run concurrently.
    boolean
    Returns whether this policy waits for commit completion at batch completion rather than handler completion.
    boolean
    Returns whether this policy commits at batch completion rather than handler completion.
    Returns the enum constant of this class with the specified name.
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • DEFAULT

      public static final AggregateCommitPolicy DEFAULT
      Resolve the policy from the active Fluxzero defaults version or explicit application properties.
    • SYNC_AFTER_HANDLER

      public static final AggregateCommitPolicy SYNC_AFTER_HANDLER
      Commit after every handler and wait for that commit before the handler completion phase finishes.
    • ASYNC_AFTER_HANDLER

      public static final AggregateCommitPolicy ASYNC_AFTER_HANDLER
      Start commits after every handler and wait for all started commits at the end of the handler completion phase.
    • ASYNC_AFTER_HANDLER_AWAIT_AFTER_BATCH

      public static final AggregateCommitPolicy ASYNC_AFTER_HANDLER_AWAIT_AFTER_BATCH
      Start commits after every handler, keep the aggregate active for the rest of the current batch, and wait for all started commits at the end of the batch completion phase.
    • SYNC_AFTER_BATCH

      public static final AggregateCommitPolicy SYNC_AFTER_BATCH
      Commit at the end of the current message batch and wait for each commit before continuing.
    • ASYNC_AFTER_BATCH

      public static final AggregateCommitPolicy ASYNC_AFTER_BATCH
      Start commits at the end of the current message batch and wait for all started commits before the batch completion phase finishes.
  • Field Details

    • AWAIT_AFTER_HANDLER_COMMITS_BEFORE_RESULTS_PROPERTY

      public static final String AWAIT_AFTER_HANDLER_COMMITS_BEFORE_RESULTS_PROPERTY
      Controls whether request results wait for asynchronous aggregate commits that were started after a handler and are awaited at batch completion.

      This applies to ASYNC_AFTER_HANDLER_AWAIT_AFTER_BATCH. It does not delay results for SYNC_AFTER_BATCH, because those commits only start at batch completion.

      Set fluxzero.aggregate.awaitAfterHandlerCommitsBeforeResults=false to publish results immediately while preserving the aggregate commit policy's batch-completion wait. Defaults to true.

      See Also:
  • Method Details

    • values

      public static AggregateCommitPolicy[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static AggregateCommitPolicy valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • commitAfterBatch

      public boolean commitAfterBatch()
      Returns whether this policy commits at batch completion rather than handler completion.
    • afterBatch

      public boolean afterBatch()
      Returns whether this policy commits at batch completion rather than handler completion.
    • awaitAfterBatch

      public boolean awaitAfterBatch()
      Returns whether this policy waits for commit completion at batch completion rather than handler completion.

      When this is true, active thread-local aggregates are retained until batch completion as well, so later handlers in the same batch keep seeing the in-memory aggregate until pending commits have completed.

    • async

      public boolean async()
      Returns whether this policy allows commits from the same completion phase to run concurrently.