Package org.apache.openjpa.validation
Class ValidatingLifecycleEventManager
- java.lang.Object
-
- org.apache.openjpa.event.LifecycleEventManager
-
- org.apache.openjpa.validation.ValidatingLifecycleEventManager
-
- All Implemented Interfaces:
java.io.Serializable
,CallbackModes
,Configurable
public class ValidatingLifecycleEventManager extends LifecycleEventManager implements Configurable
An extension of LifecycleEventManager which adds validation capabilities for specific lifecycle events. Validation occurs after firing all lifecycle events and callbacks.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.openjpa.event.LifecycleEventManager
LifecycleEventManager.ListenerAdapter, LifecycleEventManager.ListenerList
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
_validationEnabled
-
Fields inherited from interface org.apache.openjpa.event.CallbackModes
CALLBACK_FAIL_FAST, CALLBACK_IGNORE, CALLBACK_LOG, CALLBACK_RETHROW, CALLBACK_ROLLBACK
-
-
Constructor Summary
Constructors Constructor Description ValidatingLifecycleEventManager()
Constructor which accepts a reference to the validator to use.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
endConfiguration()
Invoked upon completion of bean property configuration for this object.java.lang.Exception[]
fireEvent(java.lang.Object source, java.lang.Object related, ClassMetaData meta, int type)
Fire lifecycle event to all registered listeners.java.lang.Exception[]
fireEvent(java.lang.Object source, ClassMetaData meta, int type)
Fire lifecycle event to all registered listeners without an argument.boolean
hasDeleteListeners(java.lang.Object source, ClassMetaData meta)
Return whether there are listeners or callbacks for the given source.boolean
hasPersistListeners(java.lang.Object source, ClassMetaData meta)
Return whether there are listeners or callbacks for the given source.boolean
hasUpdateListeners(java.lang.Object source, ClassMetaData meta)
Return whether there are listeners or callbacks for the given source.boolean
isActive(ClassMetaData meta)
Whether this LifeCycleEventManager has had at least one listener or callback registered.boolean
isValidationEnabled()
void
setConfiguration(Configuration conf)
Invoked prior to setting bean properties.boolean
setValidationEnabled(boolean enabled)
void
startConfiguration()
Invoked before bean property configuration is begun on this object.-
Methods inherited from class org.apache.openjpa.event.LifecycleEventManager
addListener, hasAttachListeners, hasClearListeners, hasDetachListeners, hasDirtyListeners, hasLoadListeners, hasStoreListeners, isFailFast, removeListener, setFailFast
-
-
-
-
Method Detail
-
endConfiguration
public void endConfiguration()
Description copied from interface:Configurable
Invoked upon completion of bean property configuration for this object.- Specified by:
endConfiguration
in interfaceConfigurable
-
setConfiguration
public void setConfiguration(Configuration conf)
Description copied from interface:Configurable
Invoked prior to setting bean properties.- Specified by:
setConfiguration
in interfaceConfigurable
-
startConfiguration
public void startConfiguration()
Description copied from interface:Configurable
Invoked before bean property configuration is begun on this object.- Specified by:
startConfiguration
in interfaceConfigurable
-
hasUpdateListeners
public boolean hasUpdateListeners(java.lang.Object source, ClassMetaData meta)
Description copied from class:LifecycleEventManager
Return whether there are listeners or callbacks for the given source.- Overrides:
hasUpdateListeners
in classLifecycleEventManager
-
hasPersistListeners
public boolean hasPersistListeners(java.lang.Object source, ClassMetaData meta)
Description copied from class:LifecycleEventManager
Return whether there are listeners or callbacks for the given source.- Overrides:
hasPersistListeners
in classLifecycleEventManager
-
hasDeleteListeners
public boolean hasDeleteListeners(java.lang.Object source, ClassMetaData meta)
Description copied from class:LifecycleEventManager
Return whether there are listeners or callbacks for the given source.- Overrides:
hasDeleteListeners
in classLifecycleEventManager
-
fireEvent
public java.lang.Exception[] fireEvent(java.lang.Object source, ClassMetaData meta, int type)
Description copied from class:LifecycleEventManager
Fire lifecycle event to all registered listeners without an argument.- Overrides:
fireEvent
in classLifecycleEventManager
-
fireEvent
public java.lang.Exception[] fireEvent(java.lang.Object source, java.lang.Object related, ClassMetaData meta, int type)
Description copied from class:LifecycleEventManager
Fire lifecycle event to all registered listeners.- Overrides:
fireEvent
in classLifecycleEventManager
-
isActive
public boolean isActive(ClassMetaData meta)
Whether this LifeCycleEventManager has had at least one listener or callback registered. Used for a quick test when firing events.- Overrides:
isActive
in classLifecycleEventManager
- Returns:
- boolean
-
isValidationEnabled
public boolean isValidationEnabled()
-
setValidationEnabled
public boolean setValidationEnabled(boolean enabled)
-
-