Class ActivitiEventDispatcherImpl
java.lang.Object
org.activiti.engine.delegate.event.impl.ActivitiEventDispatcherImpl
- All Implemented Interfaces:
ActivitiEventDispatcher
Class capable of dispatching events.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEventListener(ActivitiEventListener listenerToAdd) Adds an event-listener which will be notified of ALL events by the dispatcher.voidaddEventListener(ActivitiEventListener listenerToAdd, ActivitiEventType... types) Adds an event-listener which will only be notified when an event of the given types occurs.voiddispatchEvent(ActivitiEvent event) Dispatches the given event to any listeners that are registered.protected org.activiti.bpmn.model.BpmnModelIn case no process-context is active, this method attempts to extract a process-definition based on the event.booleanvoidremoveEventListener(ActivitiEventListener listenerToRemove) Removes the given listener from this dispatcher.voidsetEnabled(boolean enabled)
-
Field Details
-
eventSupport
-
enabled
protected boolean enabled
-
-
Constructor Details
-
ActivitiEventDispatcherImpl
public ActivitiEventDispatcherImpl()
-
-
Method Details
-
setEnabled
public void setEnabled(boolean enabled) - Specified by:
setEnabledin interfaceActivitiEventDispatcher- Parameters:
enabled- true, if event dispatching should be enabled.
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabledin interfaceActivitiEventDispatcher- Returns:
- true, if event dispatcher is enabled.
-
addEventListener
Description copied from interface:ActivitiEventDispatcherAdds an event-listener which will be notified of ALL events by the dispatcher.- Specified by:
addEventListenerin interfaceActivitiEventDispatcher- Parameters:
listenerToAdd- the listener to add
-
addEventListener
Description copied from interface:ActivitiEventDispatcherAdds an event-listener which will only be notified when an event of the given types occurs.- Specified by:
addEventListenerin interfaceActivitiEventDispatcher- Parameters:
listenerToAdd- the listener to addtypes- types of events the listener should be notified for
-
removeEventListener
Description copied from interface:ActivitiEventDispatcherRemoves 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:
removeEventListenerin interfaceActivitiEventDispatcher- Parameters:
listenerToRemove- listener to remove
-
dispatchEvent
Description copied from interface:ActivitiEventDispatcherDispatches the given event to any listeners that are registered.- Specified by:
dispatchEventin interfaceActivitiEventDispatcher- Parameters:
event- event to dispatch.
-
extractBpmnModelFromEvent
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:
-