Top Description Fields Constructors Methods
org.eclipse.persistence.descriptors

public Class DescriptorEventManager

extends CoreDescriptorEventManager<DescriptorEvent>
implements Cloneable, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, java.lang.Cloneable
Imports
java.io.Serializable, java.lang.reflect.InvocationTargetException, .Method, java.util.ArrayList, .List, java.util.concurrent.CopyOnWriteArrayList, java.util.concurrent.atomic.AtomicReferenceArray, org.eclipse.persistence.core.descriptors.CoreDescriptorEventManager, org.eclipse.persistence.exceptions.DescriptorException, org.eclipse.persistence.internal.helper.ClassConstants, .Helper, org.eclipse.persistence.internal.security.PrivilegedAccessHelper, org.eclipse.persistence.internal.sessions.AbstractSession, org.eclipse.persistence.sessions.SessionProfiler

Purpose: The event manager allows for a descriptor to specify that an object should be notified when a EclipseLink event occurs. It also determines how the object will be notified. To specify an event a method name can be registered to be called on the object when the event occurs. Events can be used to extend the EclipseLink reading and writing behavior.

These events include:

See Also
ClassDescriptor

Field Summary

Modifier and TypeField and Description
public static final int
public static final int
public static final int
protected transient List<DescriptorEventListener>
protected ClassDescriptor
protected List<SerializableDescriptorEventHolder>
protected transient DescriptorEventListener
protected transient List<DescriptorEventManager>
protected transient List<DescriptorEventListener>
protected transient List<DescriptorEventManager>
protected transient List<DescriptorEventListener>
protected transient AtomicReferenceArray<Method>
protected AtomicReferenceArray<String>
protected boolean
protected boolean
protected boolean
hasAnyEventListeners

PERF: Cache if any events listener exist.

protected transient List<DescriptorEventListener>
internalListeners

Listeners that are fired after all other listeners are fired

protected static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int

Constructor Summary

AccessConstructor and Description
public
DescriptorEventManager()

INTERNAL: Returns a new DescriptorEventManager for the specified ClassDescriptor.

Method Summary

Modifier and TypeMethod and Description
public void
addDefaultEventListener(DescriptorEventListener listener)

PUBLIC: EJB 3.0 support for default listeners.

public void
addEntityListenerEventListener(DescriptorEventListener listener)

PUBLIC: EJB 3.0 support for lifecycle callback events defined on an entity listener class.

public void
public void
public void
addListener(DescriptorEventListener listener)

PUBLIC: Listener objects can be registered with the event manager to be notified when an event occurs on any instance of the descriptor's class.

public Object
clone()

Overrides java.lang.Object.clone.

INTERNAL: Clone the manager and its private parts.
public boolean
excludeDefaultListeners()

INTERNAL: EJB 3.0 support.

public boolean
excludeSuperclassListeners()

INTERNAL: EJB 3.0 support.

public void
executeEvent(DescriptorEvent event)

Implements abstract org.eclipse.persistence.core.descriptors.CoreDescriptorEventManager.executeEvent.

INTERNAL: Execute the given selector with the event as argument.
protected Method
findMethod(int selector)

Find the method corresponding to the event selector.

public String
getAboutToDeleteSelector()

INTERNAL: bug 251180 - Missing method org.eclipse.persistence.descriptors.DescriptorEventManager#setAboutToDeleteSelector

public String
public String
public List<DescriptorEventListener>
getDefaultEventListeners()

INTERNAL: EJB 3.0 support.

protected ClassDescriptor
getDescriptor()

INTERNAL:

public List<SerializableDescriptorEventHolder>
getDescriptorEventHolders()

INTERNAL: used by JPA project caching to store DescriptorEventListener representations that can build the underlying DescriptorEventListener and add it to the EventManager.

public DescriptorEventListener
getEntityEventListener()

INTERNAL: EJB 3.0 support.

public List<DescriptorEventListener>
getEntityListenerEventListeners()

INTERNAL: EJB 3.0 support.

public List<DescriptorEventListener>
getEventListeners()

PUBLIC: Returns the Listener objects that have been added.

protected AtomicReferenceArray<Method>
protected AtomicReferenceArray<String>
public String
getPostBuildSelector()

PUBLIC: The name of the method called after an object is built

public String
getPostCloneSelector()

PUBLIC: The name of the method called after an object is cloned

public String
getPostDeleteSelector()

PUBLIC: The name of the method called after an object is deleted

public String
getPostInsertSelector()

PUBLIC: The name of the method called after an object is inserted

public String
getPostMergeSelector()

PUBLIC: The name of the method called after an object is merged

public String
getPostRefreshSelector()

PUBLIC: The name of the method called after an object is refreshed

public String
getPostUpdateSelector()

PUBLIC: The name of the method called after an object is updated

public String
getPostWriteSelector()

PUBLIC: The name of the method called after an object is written

public String
getPreDeleteSelector()

PUBLIC: The name of the method called before an object is deleted

public String
getPreInsertSelector()

PUBLIC: The name of the method called before an object is inserted

public String
getPrePersistSelector()

PUBLIC: The name of the method called before the create operation is applied to an object

public String
getPreRemoveSelector()

PUBLIC: The name of the method called before the remove operation is applied to an object

public String
getPreUpdateSelector()

PUBLIC: The name of the method called before an object is updated

public String
getPreWriteSelector()

PUBLIC: The name of the method called before an object is written

public boolean
hasAnyEventListeners()

Implements abstract org.eclipse.persistence.core.descriptors.CoreDescriptorEventManager.hasAnyEventListeners.

INTERNAL: Return if the event manager has any event listeners, or event methods.
protected boolean
public boolean
hasDefaultEventListeners()

INTERNAL: This method will return true, if this event manager has default listeners and does not exclude them.

public boolean
hasEntityEventListener()

INTERNAL: EJB 3.0 support.

public boolean
hasEntityListenerEventListeners()

INTERNAL: EJB 3.0 support.

public boolean
hasInternalEventListeners()

INTERNAL: Internal event support.

public void
initialize(AbstractSession session)

INTERNAL: Configure inherited selectors.

protected void
initializeEJB30EventManagers()

INTERNAL: EJB 3.0 support.

private static <T> AtomicReferenceArray<T>

Returns:

initialized instance of java.util.concurrent.atomic.AtomicIntegerArray
newAtomicReferenceArray
(final int
length of the array.
length
)

Create an instance of java.util.concurrent.atomic.AtomicIntegerArray initialized with NullEvent values.

private static <T> AtomicReferenceArray<T>

Returns:

initialized instance of java.util.concurrent.atomic.AtomicIntegerArray
newAtomicReferenceArray
(final AtomicReferenceArray<T>
source array.
src
)

Create an instance of java.util.concurrent.atomic.AtomicIntegerArray initialized with content of provided array.

protected void
notifyEJB30Listeners(DescriptorEvent event)

INTERNAL: Notify the EJB 3.0 event listeners.

protected void
notifyListener(DescriptorEventListener listener, DescriptorEvent event)

INTERNAL: Big ugly case statement to notify listeners.

public void
notifyListeners(DescriptorEvent event)

INTERNAL: Notify the event listeners.

public void
processDescriptorEventHolders(AbstractSession session, ClassLoader classLoader)

INTERNAL: This method was added to allow JPA project caching so that DescriptorEventListeners could be serialized and re-added to the EventManager using a SerializableDescriptorEventHolder.

public void
remoteInitialization(AbstractSession session)

INTERNAL: Used to initialize a remote DescriptorEventManager.

public void
removeListener(DescriptorEventListener listener)

PUBLIC: Remove a event listener.

public void
setAboutToDeleteSelector(String aboutToDeleteSelector)

PUBLIC: A method can be registered to be called when an object's row it about to be inserted.

public void
setAboutToInsertSelector(String aboutToInsertSelector)

PUBLIC: A method can be registered to be called when an object's row it about to be inserted.

public void
setAboutToUpdateSelector(String aboutToUpdateSelector)

PUBLIC: A method can be registered to be called when an object's row it about to be updated.

public void
setDescriptor(ClassDescriptor descriptor)

INTERNAL: Set the descriptor.

public void
setDescriptorEventHolders(List<SerializableDescriptorEventHolder> descriptorEventHolders)

INTERNAL: used by JPA project caching to store DescriptorEventListener representations that can build the underlying DescriptorEventListener and add it to the EventManager.

public void
setEntityEventListener(DescriptorEventListener listener)

PUBLIC: EJB 3.0 support for lifecycle callback events defined on an entity class.

protected void
protected void
protected void
public void
setExcludeDefaultListeners(boolean excludeDefaultListeners)

INTERNAL: EJB 3.0 support.

public void
setExcludeSuperclassListeners(boolean excludeSuperclassListeners)

INTERNAL: EJB 3.0 support.

protected void
setHasAnyEventListeners(boolean hasAnyEventListeners)

INTERNAL: Set if the event manager has any event listeners, or event methods.

public void
setPostBuildSelector(String postBuildSelector)

PUBLIC: A method can be registered to be called on a object that has just been built from the database.

public void
setPostCloneSelector(String postCloneSelector)

PUBLIC: A method can be registered to be called on a object that has just been cloned into a unit of work.

public void
setPostDeleteSelector(String postDeleteSelector)

PUBLIC: A method can be registered to be called on a object that has just been deleted from the database.

public void
setPostInsertSelector(String postInsertSelector)

PUBLIC: A method can be registered to be called on a object that has just been inserted into the database.

public void
setPostMergeSelector(String postMergeSelector)

PUBLIC: A method can be registered to be called on a object that has just been merge from a unit of work.

public void
setPostRefreshSelector(String postRefreshSelector)

PUBLIC: A method can be registered to be called on a object that has just been refreshed from the database.

public void
setPostUpdateSelector(String postUpdateSelector)

PUBLIC: A method can be registered to be called on a object that has just been updated into the database.

public void
setPostWriteSelector(String postWriteSelector)

PUBLIC: A method can be registered to be called on a object that has just been written to the database.

public void
setPreDeleteSelector(String preDeleteSelector)

PUBLIC: A method can be registered to be called on a object that is going to be deleted from the database.

public void
setPreInsertSelector(String preInsertSelector)

PUBLIC: A method can be registered to be called on a object that is going to be inserted into the database.

public void
setPrePersistSelector(String prePersistSelector)

PUBLIC: A method can be registered to be called on a object when that object has the create operation applied to it.

public void
setPreRemoveSelector(String preRemoveSelector)

PUBLIC: A method can be registered to be called on a object when that object has the remove operation applied to it.

public void
setPreUpdateSelector(String preUpdateSelector)

PUBLIC: A method can be registered to be called on a object that is going to be updated into the database.

public void
setPreWriteSelector(String preWriteSelector)

PUBLIC: A method can be registered to be called on a object that is going to be written to the database.

Field Detail

AboutToDeleteEventback to summary
public static final int AboutToDeleteEvent
AboutToInsertEventback to summary
public static final int AboutToInsertEvent
AboutToUpdateEventback to summary
public static final int AboutToUpdateEvent
defaultEventListenersback to summary
protected transient List<DescriptorEventListener> defaultEventListeners
descriptorback to summary
protected ClassDescriptor descriptor
descriptorEventHoldersback to summary
protected List<SerializableDescriptorEventHolder> descriptorEventHolders
entityEventListenerback to summary
protected transient DescriptorEventListener entityEventListener
entityEventManagersback to summary
protected transient List<DescriptorEventManager> entityEventManagers
entityListenerEventListenersback to summary
protected transient List<DescriptorEventListener> entityListenerEventListeners
entityListenerEventManagersback to summary
protected transient List<DescriptorEventManager> entityListenerEventManagers
eventListenersback to summary
protected transient List<DescriptorEventListener> eventListeners
eventMethodsback to summary
protected transient AtomicReferenceArray<Method> eventMethods
eventSelectorsback to summary
protected AtomicReferenceArray<String> eventSelectors
excludeDefaultListenersback to summary
protected boolean excludeDefaultListeners
excludeSuperclassListenersback to summary
protected boolean excludeSuperclassListeners
hasAnyEventListenersback to summary
protected boolean hasAnyEventListeners

PERF: Cache if any events listener exist.

internalListenersback to summary
protected transient List<DescriptorEventListener> internalListeners

Listeners that are fired after all other listeners are fired

NumberOfEventsback to summary
protected static final int NumberOfEvents
PostBuildEventback to summary
public static final int PostBuildEvent
PostCloneEventback to summary
public static final int PostCloneEvent
PostDeleteEventback to summary
public static final int PostDeleteEvent
PostInsertEventback to summary
public static final int PostInsertEvent
PostMergeEventback to summary
public static final int PostMergeEvent
PostRefreshEventback to summary
public static final int PostRefreshEvent
PostUpdateEventback to summary
public static final int PostUpdateEvent
PostWriteEventback to summary
public static final int PostWriteEvent
PreDeleteEventback to summary
public static final int PreDeleteEvent
PreInsertEventback to summary
public static final int PreInsertEvent
PrePersistEventback to summary
public static final int PrePersistEvent
PreRemoveEventback to summary
public static final int PreRemoveEvent
PreUpdateEventback to summary
public static final int PreUpdateEvent
PreUpdateWithChangesEventback to summary
public static final int PreUpdateWithChangesEvent
PreWriteEventback to summary
public static final int PreWriteEvent

Constructor Detail

DescriptorEventManagerback to summary
public DescriptorEventManager()

INTERNAL: Returns a new DescriptorEventManager for the specified ClassDescriptor.

Method Detail

addDefaultEventListenerback to summary
public void addDefaultEventListener(DescriptorEventListener listener)

PUBLIC: EJB 3.0 support for default listeners.

addEntityListenerEventListenerback to summary
public void addEntityListenerEventListener(DescriptorEventListener listener)

PUBLIC: EJB 3.0 support for lifecycle callback events defined on an entity listener class.

addEntityListenerHolderback to summary
public void addEntityListenerHolder(SerializableDescriptorEventHolder holder)

INTERNAL:

addInternalListenerback to summary
public void addInternalListener(DescriptorEventListener listener)

INTERNAL:

addListenerback to summary
public void addListener(DescriptorEventListener listener)

PUBLIC: Listener objects can be registered with the event manager to be notified when an event occurs on any instance of the descriptor's class.

cloneback to summary
public Object clone()

Overrides java.lang.Object.clone.

INTERNAL: Clone the manager and its private parts.

Returns:Object

Doc from java.lang.Object.clone.

a clone of this instance.

Annotations
@Override
excludeDefaultListenersback to summary
public boolean excludeDefaultListeners()

INTERNAL: EJB 3.0 support. Returns true if this event manager should exclude the invocation of the default listeners for this descriptor.

excludeSuperclassListenersback to summary
public boolean excludeSuperclassListeners()

INTERNAL: EJB 3.0 support. Returns true is this event manager should exclude the invocation of the listeners defined by the entity listener classes for the superclasses of this descriptor.

executeEventback to summary
public void executeEvent(DescriptorEvent event) throws DescriptorException

Implements abstract org.eclipse.persistence.core.descriptors.CoreDescriptorEventManager.executeEvent.

INTERNAL: Execute the given selector with the event as argument.

Annotations
@Override
Exceptions
DescriptorException:
- the method cannot be found or executed
findMethodback to summary
protected Method findMethod(int selector) throws DescriptorException

Find the method corresponding to the event selector. The method MUST take DescriptorEvent as argument, Session is also supported as argument for backward compatibility.

getAboutToDeleteSelectorback to summary
public String getAboutToDeleteSelector()

INTERNAL: bug 251180 - Missing method org.eclipse.persistence.descriptors.DescriptorEventManager#setAboutToDeleteSelector

getAboutToInsertSelectorback to summary
public String getAboutToInsertSelector()

INTERNAL:

getAboutToUpdateSelectorback to summary
public String getAboutToUpdateSelector()

INTERNAL:

getDefaultEventListenersback to summary
public List<DescriptorEventListener> getDefaultEventListeners()

INTERNAL: EJB 3.0 support. Returns the default listeners.

getDescriptorback to summary
protected ClassDescriptor getDescriptor()

INTERNAL:

getDescriptorEventHoldersback to summary
public List<SerializableDescriptorEventHolder> getDescriptorEventHolders()

INTERNAL: used by JPA project caching to store DescriptorEventListener representations that can build the underlying DescriptorEventListener and add it to the EventManager.

getEntityEventListenerback to summary
public DescriptorEventListener getEntityEventListener()

INTERNAL: EJB 3.0 support. Returns the entity event listener.

getEntityListenerEventListenersback to summary
public List<DescriptorEventListener> getEntityListenerEventListeners()

INTERNAL: EJB 3.0 support. Returns the entity listener event listeners.

getEventListenersback to summary
public List<DescriptorEventListener> getEventListeners()

PUBLIC: Returns the Listener objects that have been added.

See Also
addListener(DescriptorEventListener)
getEventMethodsback to summary
protected AtomicReferenceArray<Method> getEventMethods()
getEventSelectorsback to summary
protected AtomicReferenceArray<String> getEventSelectors()
getPostBuildSelectorback to summary
public String getPostBuildSelector()

PUBLIC: The name of the method called after an object is built

getPostCloneSelectorback to summary
public String getPostCloneSelector()

PUBLIC: The name of the method called after an object is cloned

getPostDeleteSelectorback to summary
public String getPostDeleteSelector()

PUBLIC: The name of the method called after an object is deleted

getPostInsertSelectorback to summary
public String getPostInsertSelector()

PUBLIC: The name of the method called after an object is inserted

getPostMergeSelectorback to summary
public String getPostMergeSelector()

PUBLIC: The name of the method called after an object is merged

getPostRefreshSelectorback to summary
public String getPostRefreshSelector()

PUBLIC: The name of the method called after an object is refreshed

getPostUpdateSelectorback to summary
public String getPostUpdateSelector()

PUBLIC: The name of the method called after an object is updated

getPostWriteSelectorback to summary
public String getPostWriteSelector()

PUBLIC: The name of the method called after an object is written

getPreDeleteSelectorback to summary
public String getPreDeleteSelector()

PUBLIC: The name of the method called before an object is deleted

getPreInsertSelectorback to summary
public String getPreInsertSelector()

PUBLIC: The name of the method called before an object is inserted

getPrePersistSelectorback to summary
public String getPrePersistSelector()

PUBLIC: The name of the method called before the create operation is applied to an object

getPreRemoveSelectorback to summary
public String getPreRemoveSelector()

PUBLIC: The name of the method called before the remove operation is applied to an object

getPreUpdateSelectorback to summary
public String getPreUpdateSelector()

PUBLIC: The name of the method called before an object is updated

getPreWriteSelectorback to summary
public String getPreWriteSelector()

PUBLIC: The name of the method called before an object is written

hasAnyEventListenersback to summary
public boolean hasAnyEventListeners()

Implements abstract org.eclipse.persistence.core.descriptors.CoreDescriptorEventManager.hasAnyEventListeners.

INTERNAL: Return if the event manager has any event listeners, or event methods. If nothing is listening to event they can be avoided.

Annotations
@Override
hasAnyListenersback to summary
protected boolean hasAnyListeners()
hasDefaultEventListenersback to summary
public boolean hasDefaultEventListeners()

INTERNAL: This method will return true, if this event manager has default listeners and does not exclude them. Default listeners are always added to every event manager to allow users to turn them on a later time if so desired.

hasEntityEventListenerback to summary
public boolean hasEntityEventListener()

INTERNAL: EJB 3.0 support. Return true if this event manager has any entity event listeners.

hasEntityListenerEventListenersback to summary
public boolean hasEntityListenerEventListeners()

INTERNAL: EJB 3.0 support. Return true if this event manager has any entity listener event listeners.

hasInternalEventListenersback to summary
public boolean hasInternalEventListeners()

INTERNAL: Internal event support. Return true if this event manager has any internal listener event listeners.

initializeback to summary
public void initialize(AbstractSession session)

INTERNAL: Configure inherited selectors.

initializeEJB30EventManagersback to summary
protected void initializeEJB30EventManagers()

INTERNAL: EJB 3.0 support. Builds our chains of descriptor event managers that will need to be notified. The chains are cache so we only need to build them once.

newAtomicReferenceArrayback to summary
private static <T> AtomicReferenceArray<T> newAtomicReferenceArray(final int length)

Create an instance of java.util.concurrent.atomic.AtomicIntegerArray initialized with NullEvent values.

Parameters
length:int

length of the array.

Returns:AtomicReferenceArray<T>

initialized instance of java.util.concurrent.atomic.AtomicIntegerArray

newAtomicReferenceArrayback to summary
private static <T> AtomicReferenceArray<T> newAtomicReferenceArray(final AtomicReferenceArray<T> src)

Create an instance of java.util.concurrent.atomic.AtomicIntegerArray initialized with content of provided array.

Parameters
src:AtomicReferenceArray<T>

source array.

Returns:AtomicReferenceArray<T>

initialized instance of java.util.concurrent.atomic.AtomicIntegerArray

notifyEJB30Listenersback to summary
protected void notifyEJB30Listeners(DescriptorEvent event)

INTERNAL: Notify the EJB 3.0 event listeners.

notifyListenerback to summary
protected void notifyListener(DescriptorEventListener listener, DescriptorEvent event) throws DescriptorException

INTERNAL: Big ugly case statement to notify listeners.

notifyListenersback to summary
public void notifyListeners(DescriptorEvent event)

INTERNAL: Notify the event listeners.

processDescriptorEventHoldersback to summary
public void processDescriptorEventHolders(AbstractSession session, ClassLoader classLoader)

INTERNAL: This method was added to allow JPA project caching so that DescriptorEventListeners could be serialized and re-added to the EventManager using a SerializableDescriptorEventHolder.

remoteInitializationback to summary
public void remoteInitialization(AbstractSession session)

INTERNAL: Used to initialize a remote DescriptorEventManager.

removeListenerback to summary
public void removeListener(DescriptorEventListener listener)

PUBLIC: Remove a event listener.

setAboutToDeleteSelectorback to summary
public void setAboutToDeleteSelector(String aboutToDeleteSelector)

PUBLIC: A method can be registered to be called when an object's row it about to be inserted. This uses the optional event argument of the DatabaseRow. This is different from pre/postInsert because it occurs after the row has already been built. This event can be used to modify the row before insert, such as adding a user inserted by.

setAboutToInsertSelectorback to summary
public void setAboutToInsertSelector(String aboutToInsertSelector)

PUBLIC: A method can be registered to be called when an object's row it about to be inserted. This uses the optional event argument of the DatabaseRow. This is different from pre/postInsert because it occurs after the row has already been built. This event can be used to modify the row before insert, such as adding a user inserted by.

setAboutToUpdateSelectorback to summary
public void setAboutToUpdateSelector(String aboutToUpdateSelector)

PUBLIC: A method can be registered to be called when an object's row it about to be updated. This uses the optional event argument of the DatabaseRow. This is different from pre/postUpdate because it occurs after the row has already been built, and it ONLY called if the update is required (changed within a unit of work), as the other occur ALWAYS. This event can be used to modify the row before insert, such as adding a user inserted by.

setDescriptorback to summary
public void setDescriptor(ClassDescriptor descriptor)

INTERNAL: Set the descriptor.

setDescriptorEventHoldersback to summary
public void setDescriptorEventHolders(List<SerializableDescriptorEventHolder> descriptorEventHolders)

INTERNAL: used by JPA project caching to store DescriptorEventListener representations that can build the underlying DescriptorEventListener and add it to the EventManager.

setEntityEventListenerback to summary
public void setEntityEventListener(DescriptorEventListener listener)

PUBLIC: EJB 3.0 support for lifecycle callback events defined on an entity class.

setEventListenersback to summary
protected void setEventListeners(List<DescriptorEventListener> eventListeners)
setEventMethodsback to summary
protected void setEventMethods(AtomicReferenceArray<Method> eventMethods)
setEventSelectorsback to summary
protected void setEventSelectors(AtomicReferenceArray<String> eventSelectors)
setExcludeDefaultListenersback to summary
public void setExcludeDefaultListeners(boolean excludeDefaultListeners)

INTERNAL: EJB 3.0 support. Default listeners apply to all entities in a persistence unit. Set this flag to true to exclude the invocation of the default listeners for this descriptor.

setExcludeSuperclassListenersback to summary
public void setExcludeSuperclassListeners(boolean excludeSuperclassListeners)

INTERNAL: EJB 3.0 support. If multiple entity classes in an inheritance hierarchy define entity listeners, the listeners defined for a superclass are invoked before the listeners defined for its subclasses. Set this flag to true to exclude the invocation of the listeners defined by the entity listener classes for the superclasses of this descriptor.

setHasAnyEventListenersback to summary
protected void setHasAnyEventListeners(boolean hasAnyEventListeners)

INTERNAL: Set if the event manager has any event listeners, or event methods. If nothing is listening to event they can be avoided.

setPostBuildSelectorback to summary
public void setPostBuildSelector(String postBuildSelector)

PUBLIC: A method can be registered to be called on a object that has just been built from the database. This uses the optional event argument for the DatabaseRow. This event can be used to correctly initialize an object's non-persistent attributes or to perform complex optimizations or mappings. This event is called whenever an object is built.

setPostCloneSelectorback to summary
public void setPostCloneSelector(String postCloneSelector)

PUBLIC: A method can be registered to be called on a object that has just been cloned into a unit of work. This uses the optional event argument for the original object (the source object is the clone). This event can be used to correctly initialize an object's non-persistent attributes.

setPostDeleteSelectorback to summary
public void setPostDeleteSelector(String postDeleteSelector)

PUBLIC: A method can be registered to be called on a object that has just been deleted from the database. This event can notify/remove any dependents on the object.

setPostInsertSelectorback to summary
public void setPostInsertSelector(String postInsertSelector)

PUBLIC: A method can be registered to be called on a object that has just been inserted into the database. This event can be used to notify any dependent on the object, or to update information not accessible until the object has been inserted.

setPostMergeSelectorback to summary
public void setPostMergeSelector(String postMergeSelector)

PUBLIC: A method can be registered to be called on a object that has just been merge from a unit of work. This uses the optional event argument of the original object which is the object being merged from, the source object is the object being merged into. This event can be used to correctly initialize an object's non-persistent attributes.

setPostRefreshSelectorback to summary
public void setPostRefreshSelector(String postRefreshSelector)

PUBLIC: A method can be registered to be called on a object that has just been refreshed from the database. This uses the optional event argument of the DatabaseRow. This event can be used to correctly initialize an object's non-persistent attributes or to perform complex optimizations or mappings. This event is only called on refreshes of existing objects.

setPostUpdateSelectorback to summary
public void setPostUpdateSelector(String postUpdateSelector)

PUBLIC: A method can be registered to be called on a object that has just been updated into the database.

setPostWriteSelectorback to summary
public void setPostWriteSelector(String postWriteSelector)

PUBLIC: A method can be registered to be called on a object that has just been written to the database. This event is raised on any registered object in a unit of work, even if it has not changed, refer to the "aboutToUpdate" selector if it is required for the event to be raised only when the object has been changed. This will be called on all inserts and updates, after the "postInsert/Update" event has been raised. This event can be used to notify any dependent on the object.

setPreDeleteSelectorback to summary
public void setPreDeleteSelector(String preDeleteSelector)

PUBLIC: A method can be registered to be called on a object that is going to be deleted from the database. This event can notify/remove any dependents on the object.

setPreInsertSelectorback to summary
public void setPreInsertSelector(String preInsertSelector)

PUBLIC: A method can be registered to be called on a object that is going to be inserted into the database. This event can be used to notify any dependent on the object or acquire the object's id through a custom mechanism.

setPrePersistSelectorback to summary
public void setPrePersistSelector(String prePersistSelector)

PUBLIC: A method can be registered to be called on a object when that object has the create operation applied to it.

setPreRemoveSelectorback to summary
public void setPreRemoveSelector(String preRemoveSelector)

PUBLIC: A method can be registered to be called on a object when that object has the remove operation applied to it.

setPreUpdateSelectorback to summary
public void setPreUpdateSelector(String preUpdateSelector)

PUBLIC: A method can be registered to be called on a object that is going to be updated into the database. This event is raised on any registered object in a unit of work, even if it has not changed, refer to the "aboutToUpdate" selector if it is required for the event to be raised only when the object has been changed. This event can be used to notify any dependent on the object.

setPreWriteSelectorback to summary
public void setPreWriteSelector(String preWriteSelector)

PUBLIC: A method can be registered to be called on a object that is going to be written to the database. This event is raised on any registered object in a unit of work, even if it has not changed, refer to the "aboutToUpdate" selector if it is required for the event to be raised only when the object has been changed. This will be called on all inserts and updates, before the "preInsert/Update" event has been raised. This event can be used to notify any dependent on the object.