Package org.flowable.common.engine.api.delegate.event

# Interface FlowableEventDispatcher

public interface FlowableEventDispatcher
Dispatcher which allows for adding and removing `FlowableEventListener` s to the Flowable Engine as well as dispatching `FlowableEvent` to all the listeners registered.

Author:
  Frederik Heremans

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addEventListener(FlowableEventListener listenerToAdd)`
  Adds an event-listener which will be notified of ALL events by the dispatcher.
  `void`
  `addEventListener(FlowableEventListener listenerToAdd, FlowableEventType... types)`
  Adds an event-listener which will only be notified when an event of the given types occurs.
  `void`
  `dispatchEvent(FlowableEvent event, String engineType)`
  Dispatches the given event to any listeners that are registered.
  `boolean`
  `isEnabled()`
  `void`
  `removeEventListener(FlowableEventListener listenerToRemove)`
  Removes the given listener from this dispatcher.
  `void`
  `setEnabled(boolean enabled)`

- ## Method Details

  - ### addEventListener

    void addEventListener(FlowableEventListener listenerToAdd)
    Adds an event-listener which will be notified of ALL events by the dispatcher.
    Parameters:
      `listenerToAdd` - the listener to add

  - ### addEventListener

    void addEventListener(FlowableEventListener listenerToAdd, FlowableEventType... types)
    Adds an event-listener which will only be notified when an event of the given types occurs.
    Parameters:
      `listenerToAdd` - the listener to add
      `types` - types of events the listener should be notified for

  - ### removeEventListener

    void removeEventListener(FlowableEventListener listenerToRemove)
    Removes the given listener from this dispatcher. The listener will no longer be notified, regardless of the type(s) it was registered for in the first place.
    Parameters:
      `listenerToRemove` - listener to remove

  - ### dispatchEvent

    void dispatchEvent(FlowableEvent event, String engineType)
    Dispatches the given event to any listeners that are registered.
    Parameters:
      `event` - event to dispatch.
      `engineType` - type of engine to dispatch

  - ### setEnabled

    void setEnabled(boolean enabled)
    Parameters:
      `enabled` - true, if event dispatching should be enabled.

  - ### isEnabled

    boolean isEnabled()
    Returns:
      true, if event dispatcher is enabled.