Class EventTrigger<S,E>

java.lang.Object
org.springframework.statemachine.trigger.EventTrigger<S,E>
All Implemented Interfaces:
Trigger<S,E>

public class EventTrigger<S,E> extends Object implements Trigger<S,E>
  • Constructor Details

    • EventTrigger

      public EventTrigger(E event)
  • Method Details

    • evaluate

      public reactor.core.publisher.Mono<Boolean> evaluate(TriggerContext<S,E> context)
      Description copied from interface: Trigger
      Evaluate trigger.
      Specified by:
      evaluate in interface Trigger<S,E>
      Parameters:
      context - the context
      Returns:
      Mono for completion with true, if trigger is fired, false otherwise
    • addTriggerListener

      public void addTriggerListener(TriggerListener listener)
      Description copied from interface: Trigger
      Adds the trigger listener.
      Specified by:
      addTriggerListener in interface Trigger<S,E>
      Parameters:
      listener - the listener
    • getEvent

      public E getEvent()
      Description copied from interface: Trigger
      Gets the event associated with this trigger. It is possible that there are no event association.
      Specified by:
      getEvent in interface Trigger<S,E>
      Returns:
      the event
    • arm

      public void arm()
      Description copied from interface: Trigger
      Arm a trigger. After trigger has been armed a TriggerListener may receive events.
      Specified by:
      arm in interface Trigger<S,E>
    • disarm

      public void disarm()
      Description copied from interface: Trigger
      Disarm a trigger. After trigger has been disarmed a TriggerListener will not receive events.
      Specified by:
      disarm in interface Trigger<S,E>