public class BaseEntityEventListener extends AbstractFlowableEventListener
FlowableEventListener to get notified when an entity is created, updated, deleted or if another entity-related event occurs.
Override the onXX(..) methods to respond to entity changes accordingly.| Modifier and Type | Field and Description |
|---|---|
protected Class<?> |
entityClass |
protected boolean |
failOnException |
onTransaction| Constructor and 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,
Class<?> entityClass) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isFailOnException() |
protected boolean |
isValidEvent(FlowableEvent event) |
protected void |
onCreate(FlowableEvent event)
Called when an entity create event is received.
|
protected void |
onDelete(FlowableEvent event)
Called when an entity delete event is received.
|
protected void |
onEntityEvent(FlowableEvent event)
Called when an event is received, which is not a create, an update or delete.
|
void |
onEvent(FlowableEvent event) |
protected void |
onInitialized(FlowableEvent event)
Called when an entity initialized event is received.
|
protected void |
onUpdate(FlowableEvent event)
Called when an entity update event is received.
|
getOnTransaction, isFireOnTransactionLifecycleEvent, setOnTransactionprotected boolean failOnException
protected Class<?> entityClass
public BaseEntityEventListener()
isFailOnException() is called.public BaseEntityEventListener(boolean failOnException)
failOnException - return value for isFailOnException().public BaseEntityEventListener(boolean failOnException,
Class<?> entityClass)
public final void onEvent(FlowableEvent event)
public boolean isFailOnException()
protected boolean isValidEvent(FlowableEvent event)
FlowableEntityEvent and (if needed) the entityClass set in this instance, is assignable from the entity class in the event.protected void onCreate(FlowableEvent event)
protected void onInitialized(FlowableEvent event)
protected void onDelete(FlowableEvent event)
protected void onUpdate(FlowableEvent event)
protected void onEntityEvent(FlowableEvent event)
Copyright © 2020 Flowable. All rights reserved.