org.activiti.engine.delegate.event.impl

## Class ActivitiEventDispatcherImpl

- java.lang.Object
- - org.activiti.engine.delegate.event.impl.ActivitiEventDispatcherImpl

- All Implemented Interfaces:
    ActivitiEventDispatcher

      public class ActivitiEventDispatcherImpl
      extends Object
      implements ActivitiEventDispatcher

  Class capable of dispatching events.
  Author:
    Frederik Heremans

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected boolean` | `enabled`
    `protected ActivitiEventSupport` | `eventSupport`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ActivitiEventDispatcherImpl()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addEventListener(ActivitiEventListener listenerToAdd)` Adds an event-listener which will be notified of ALL events by the dispatcher.
    `void` | `addEventListener(ActivitiEventListener listenerToAdd, ActivitiEventType... types)` Adds an event-listener which will only be notified when an event of the given types occurs.
    `void` | `dispatchEvent(ActivitiEvent event)` Dispatches the given event to any listeners that are registered.
    `protected org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity` | `extractProcessDefinitionEntityFromEvent(ActivitiEvent event)` In case no process-context is active, this method attempts to extract a process-definition based on the event.
    `boolean` | `isEnabled()`
    `void` | `removeEventListener(ActivitiEventListener listenerToRemove)` Removes the given listener from this dispatcher.
    `void` | `setEnabled(boolean enabled)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### eventSupport

          protected ActivitiEventSupport eventSupport

    - #### enabled

          protected boolean enabled

  - ### Constructor Detail

    - #### ActivitiEventDispatcherImpl

          public ActivitiEventDispatcherImpl()

  - ### Method Detail

    - #### setEnabled

          public void setEnabled(boolean enabled)

      Specified by:
        `setEnabled` in interface `ActivitiEventDispatcher`
      Parameters:
        `enabled` - true, if event dispatching should be enabled.

    - #### isEnabled

          public boolean isEnabled()

      Specified by:
        `isEnabled` in interface `ActivitiEventDispatcher`
      Returns:
        true, if event dispatcher is enabled.

    - #### addEventListener

          public void addEventListener(ActivitiEventListener listenerToAdd)

      Description copied from interface: `ActivitiEventDispatcher`
      Adds an event-listener which will be notified of ALL events by the dispatcher.
      Specified by:
        `addEventListener` in interface `ActivitiEventDispatcher`
      Parameters:
        `listenerToAdd` - the listener to add

    - #### addEventListener

          public void addEventListener(ActivitiEventListener listenerToAdd,
                                       ActivitiEventType... types)

      Description copied from interface: `ActivitiEventDispatcher`
      Adds an event-listener which will only be notified when an event of the given types occurs.
      Specified by:
        `addEventListener` in interface `ActivitiEventDispatcher`
      Parameters:
        `listenerToAdd` - the listener to add
        `types` - types of events the listener should be notified for

    - #### removeEventListener

          public void removeEventListener(ActivitiEventListener listenerToRemove)

      Description copied from interface: `ActivitiEventDispatcher`
      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.
      Specified by:
        `removeEventListener` in interface `ActivitiEventDispatcher`
      Parameters:
        `listenerToRemove` - listener to remove

    - #### dispatchEvent

          public void dispatchEvent(ActivitiEvent event)

      Description copied from interface: `ActivitiEventDispatcher`
      Dispatches the given event to any listeners that are registered.
      Specified by:
        `dispatchEvent` in interface `ActivitiEventDispatcher`
      Parameters:
        `event` - event to dispatch.

    - #### extractProcessDefinitionEntityFromEvent

          protected org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity extractProcessDefinitionEntityFromEvent(ActivitiEvent event)

      In case no process-context is active, this method attempts to extract a process-definition based on the event. In case it's an event related to an entity, this can be deducted by inspecting the entity, without additional queries to the database. If not an entity-related event, the process-definition will be retrieved based on the processDefinitionId (if filled in). This requires an additional query to the database in case not already cached. However, queries will only occur when the definition is not yet in the cache, which is very unlikely to happen, unless evicted.
      Parameters:
        `event` -
      Returns:

Copyright © 2016 Alfresco. All rights reserved.