public class EntityListener<T> extends DescriptorEventAdapter
| Modifier and Type | Field and Description |
|---|---|
static String |
POST_BUILD |
static String |
POST_CLONE |
static String |
POST_DELETE |
static String |
POST_INSERT |
static String |
POST_REFRESH |
static String |
POST_UPDATE |
static String |
PRE_PERSIST |
static String |
PRE_REMOVE |
static String |
PRE_UPDATE_WITH_CHANGES |
| Modifier | Constructor and Description |
|---|---|
protected |
EntityListener(Class entityClass)
INTERNAL:
|
|
EntityListener(Class<T> listenerClass,
Class entityClass) |
| Modifier and Type | Method and Description |
|---|---|
void |
addEventMethod(String event,
Method method)
INTERNAL:
You can have multiple event methods for the same event, however, only
one event method per class is permitted.
|
protected T |
constructListenerInstance()
Construct an instance of the wrapped entity listener
This method will attempt to create the listener in a CDI injection
friendly manner and if that fails, reflectively instantiate the class
|
protected T |
createEntityListenerAndInjectDependencies(Class<T> entityListenerClass)
Create the wrapped listener and trigger CDI injection.
|
Map<String,List<Method>> |
getAllEventMethods()
INTERNAL:
|
Class |
getEntityClass()
INTERNAL:
|
protected List<Method> |
getEventMethods(int eventCode)
INTERNAL:
|
protected List<Method> |
getEventMethods(String event)
INTERNAL:
|
protected Method |
getLastEventMethod(String event)
INTERNAL:
Assumes a check for event methods for the given event has been called
beforehand.
|
T |
getListener() |
Class |
getListenerClass()
INTERNAL:
|
AbstractSession |
getOwningSession()
INTERNAL:
|
boolean |
hasCallbackMethods()
INTERNAL:
|
protected boolean |
hasEventMethods(int eventCode)
INTERNAL:
|
protected boolean |
hasEventMethods(String event)
INTERNAL:
|
protected boolean |
hasOverriddenEventMethod(List<Method> eventMethods,
Method eventMethod)
INTERNAL:
|
protected boolean |
hasOverriddenEventMethod(Method eventMethod,
int eventCode)
INTERNAL:
|
protected boolean |
hasOverriddenEventMethod(Method eventMethod,
String eventCode)
INTERNAL:
|
boolean |
isOverriddenEvent(DescriptorEvent event,
List<DescriptorEventManager> eventManagers)
INTERNAL:
Return true if listener has a lifecycle callback method that is
overridden in a subclass.
|
void |
postBuild(DescriptorEvent event)
INTERNAL:
|
void |
postClone(DescriptorEvent event)
INTERNAL:
|
void |
postDelete(DescriptorEvent event)
INTERNAL:
|
void |
postInsert(DescriptorEvent event)
INTERNAL:
|
void |
postRefresh(DescriptorEvent event)
INTERNAL:
|
void |
postUpdate(DescriptorEvent event)
INTERNAL:
|
void |
prePersist(DescriptorEvent event)
INTERNAL:
|
void |
preRemove(DescriptorEvent event)
INTERNAL:
|
void |
preUpdateWithChanges(DescriptorEvent event)
INTERNAL:
|
void |
setAllEventMethods(Map<String,List<Method>> methods)
INTERNAL:
|
void |
setOwningSession(AbstractSession owningSession)
INTERNAL:
|
void |
setPostBuildMethod(Method method)
INTERNAL:
|
void |
setPostCloneMethod(Method method)
INTERNAL:
|
void |
setPostDeleteMethod(Method method)
INTERNAL:
|
void |
setPostInsertMethod(Method method)
INTERNAL:
|
void |
setPostRefreshMethod(Method method)
INTERNAL:
|
void |
setPostUpdateMethod(Method method)
INTERNAL:
|
void |
setPrePersistMethod(Method method)
INTERNAL:
|
void |
setPreRemoveMethod(Method method)
INTERNAL:
|
void |
setPreUpdateWithChangesMethod(Method method)
INTERNAL:
|
String |
toString()
INTERNAL:
Used in the debugger.
|
protected void |
validateMethod(Method method)
INTERNAL:
|
protected void |
validateMethodModifiers(Method method)
INTERNAL:
|
aboutToDelete, aboutToInsert, aboutToUpdate, postMerge, postWrite, preDelete, preInsert, preUpdate, preWritepublic static final String POST_BUILD
public static final String POST_CLONE
public static final String POST_DELETE
public static final String POST_INSERT
public static final String POST_REFRESH
public static final String POST_UPDATE
public static final String PRE_PERSIST
public static final String PRE_REMOVE
public static final String PRE_UPDATE_WITH_CHANGES
protected EntityListener(Class entityClass)
public void addEventMethod(String event, Method method)
protected T createEntityListenerAndInjectDependencies(Class<T> entityListenerClass)
entityListenerClass - the EntityListener classprotected T constructListenerInstance()
public Class getEntityClass()
public void setOwningSession(AbstractSession owningSession)
protected Method getLastEventMethod(String event)
public T getListener()
public Class getListenerClass()
public AbstractSession getOwningSession()
public boolean hasCallbackMethods()
protected boolean hasEventMethods(int eventCode)
protected boolean hasEventMethods(String event)
protected boolean hasOverriddenEventMethod(List<Method> eventMethods, Method eventMethod)
protected boolean hasOverriddenEventMethod(Method eventMethod, int eventCode)
protected boolean hasOverriddenEventMethod(Method eventMethod, String eventCode)
public boolean isOverriddenEvent(DescriptorEvent event, List<DescriptorEventManager> eventManagers)
isOverriddenEvent in interface DescriptorEventListenerisOverriddenEvent in class DescriptorEventAdapterpublic void postBuild(DescriptorEvent event)
postBuild in interface DescriptorEventListenerpostBuild in class DescriptorEventAdapterpublic void postClone(DescriptorEvent event)
postClone in interface DescriptorEventListenerpostClone in class DescriptorEventAdapterpublic void postDelete(DescriptorEvent event)
postDelete in interface DescriptorEventListenerpostDelete in class DescriptorEventAdapterpublic void postInsert(DescriptorEvent event)
postInsert in interface DescriptorEventListenerpostInsert in class DescriptorEventAdapterpublic void postRefresh(DescriptorEvent event)
postRefresh in interface DescriptorEventListenerpostRefresh in class DescriptorEventAdapterpublic void postUpdate(DescriptorEvent event)
postUpdate in interface DescriptorEventListenerpostUpdate in class DescriptorEventAdapterpublic void prePersist(DescriptorEvent event)
prePersist in interface DescriptorEventListenerprePersist in class DescriptorEventAdapterpublic void preRemove(DescriptorEvent event)
preRemove in interface DescriptorEventListenerpreRemove in class DescriptorEventAdapterpublic void preUpdateWithChanges(DescriptorEvent event)
preUpdateWithChanges in interface DescriptorEventListenerpreUpdateWithChanges in class DescriptorEventAdapterpublic void setPostBuildMethod(Method method)
public void setPostCloneMethod(Method method)
public void setPostDeleteMethod(Method method)
public void setPostInsertMethod(Method method)
public void setPostRefreshMethod(Method method)
public void setPostUpdateMethod(Method method)
public void setPrePersistMethod(Method method)
public void setPreRemoveMethod(Method method)
public void setPreUpdateWithChangesMethod(Method method)
public String toString()
protected void validateMethod(Method method)
protected void validateMethodModifiers(Method method)
Copyright © 2007–2021 Eclipse.org - EclipseLink Project. All rights reserved.