public class BaseEntityEventListener extends Object implements ActivitiEventListener
ActivitiEventListener
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 |
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(ActivitiEvent event) |
protected void |
onCreate(ActivitiEvent event)
Called when an entity create event is received.
|
protected void |
onDelete(ActivitiEvent event)
Called when an entity delete event is received.
|
protected void |
onEntityEvent(ActivitiEvent event)
Called when an event is received, which is not a create, an update or
delete.
|
void |
onEvent(ActivitiEvent event)
Called when an event has been fired
|
protected void |
onInitialized(ActivitiEvent event)
Called when an entity initialized event is received.
|
protected void |
onUpdate(ActivitiEvent event)
Called when an entity update event is received.
|
protected 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(ActivitiEvent event)
ActivitiEventListener
onEvent
in interface ActivitiEventListener
event
- the eventpublic boolean isFailOnException()
isFailOnException
in interface ActivitiEventListener
protected boolean isValidEvent(ActivitiEvent event)
ActivitiEntityEvent
and (if needed) the entityClass
set in this instance, is assignable from the entity class in the event.protected void onCreate(ActivitiEvent event)
protected void onInitialized(ActivitiEvent event)
protected void onDelete(ActivitiEvent event)
protected void onUpdate(ActivitiEvent event)
protected void onEntityEvent(ActivitiEvent event)
Copyright © 2016 Alfresco. All rights reserved.