Class BaseEntityEventListener
- java.lang.Object
-
- org.activiti.engine.delegate.event.BaseEntityEventListener
-
- All Implemented Interfaces:
ActivitiEventListener
- Direct Known Subclasses:
DebugInfoEntityEventListener
public class BaseEntityEventListener extends java.lang.Object implements ActivitiEventListener
Base event listener that can be used when implementing anActivitiEventListenerto get notified when an entity is created, updated, deleted or if another entity-related event occurs. Override theonXX(..)methods to respond to entity changes accordingly.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Class<?>entityClassprotected booleanfailOnException
-
Constructor Summary
Constructors Constructor Description BaseEntityEventListener()Create a new BaseEntityEventListener, notified when an event that targets any type of entity is received.BaseEntityEventListener(boolean failOnException)Create a new BaseEntityEventListener.BaseEntityEventListener(boolean failOnException, java.lang.Class<?> entityClass)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisFailOnException()protected booleanisValidEvent(ActivitiEvent event)protected voidonCreate(ActivitiEvent event)Called when an entity create event is received.protected voidonDelete(ActivitiEvent event)Called when an entity delete event is received.protected voidonEntityEvent(ActivitiEvent event)Called when an event is received, which is not a create, an update or delete.voidonEvent(ActivitiEvent event)Called when an event has been firedprotected voidonInitialized(ActivitiEvent event)Called when an entity initialized event is received.protected voidonUpdate(ActivitiEvent event)Called when an entity update event is received.
-
-
-
Constructor Detail
-
BaseEntityEventListener
public BaseEntityEventListener()
Create a new BaseEntityEventListener, notified when an event that targets any type of entity is received. Returning true whenisFailOnException()is called.
-
BaseEntityEventListener
public BaseEntityEventListener(boolean failOnException)
Create a new BaseEntityEventListener.- Parameters:
failOnException- return value forisFailOnException().
-
BaseEntityEventListener
public BaseEntityEventListener(boolean failOnException, java.lang.Class<?> entityClass)
-
-
Method Detail
-
onEvent
public final void onEvent(ActivitiEvent event)
Description copied from interface:ActivitiEventListenerCalled when an event has been fired- Specified by:
onEventin interfaceActivitiEventListener- Parameters:
event- the event
-
isFailOnException
public boolean isFailOnException()
- Specified by:
isFailOnExceptionin interfaceActivitiEventListener- Returns:
- whether or not the current operation should fail when this listeners execution throws an exception.
-
isValidEvent
protected boolean isValidEvent(ActivitiEvent event)
- Returns:
- true, if the event is an
ActivitiEntityEventand (if needed) the entityClass set in this instance, is assignable from the entity class in the event.
-
onCreate
protected void onCreate(ActivitiEvent event)
Called when an entity create event is received.
-
onInitialized
protected void onInitialized(ActivitiEvent event)
Called when an entity initialized event is received.
-
onDelete
protected void onDelete(ActivitiEvent event)
Called when an entity delete event is received.
-
onUpdate
protected void onUpdate(ActivitiEvent event)
Called when an entity update event is received.
-
onEntityEvent
protected void onEntityEvent(ActivitiEvent event)
Called when an event is received, which is not a create, an update or delete.
-
-