Interface TriggerHandlerCallback

All Superinterfaces:
ModuleHandlerCallback
All Known Subinterfaces:
SimpleTriggerHandlerCallback

@NonNullByDefault public interface TriggerHandlerCallback extends ModuleHandlerCallback
This is a callback interface to RuleManager which is used by the TriggerHandler to notify the RuleManager about firing of the Trigger. These calls from Triggers must be stored in a queue and applied to the RuleAngine in order of their appearance. Each Rule has to create its own instance of TriggerHandlerCallback.
Author:
Yordan Mihaylov - Initial contribution, Kai Kreuzer - made it a sub-interface of ModuleHandlerCallback, Fabian Wolter - Add method for retrieving the handler's scheduler
  • Method Details

    • triggered

      default void triggered(Trigger trigger)
      This method is used by the TriggerHandler to notify the RuleManager when the linked Trigger instance was fired.
      Parameters:
      trigger - instance of trigger which was fired. When one TriggerHandler serve more then one Trigger instances, this parameter defines which trigger was fired.
    • triggered

      void triggered(Trigger trigger, Map<String,?> context)
      This method is used by the TriggerHandler to notify the RuleManager when the linked Trigger instance was fired.
      Parameters:
      trigger - instance of trigger which was fired. When one TriggerHandler serve more then one Trigger instances, this parameter defines which trigger was fired.
      context - is a Map of output values of the triggered Trigger. Each entry of the map contains:
    • getScheduler

      ScheduledExecutorService getScheduler()
      Returns:
      the scheduler of this rule