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 voidendConfiguration()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.booleanhasDeleteListeners(java.lang.Object source, ClassMetaData meta)Return whether there are listeners or callbacks for the given source.booleanhasPersistListeners(java.lang.Object source, ClassMetaData meta)Return whether there are listeners or callbacks for the given source.booleanhasUpdateListeners(java.lang.Object source, ClassMetaData meta)Return whether there are listeners or callbacks for the given source.booleanisActive(ClassMetaData meta)Whether this LifeCycleEventManager has had at least one listener or callback registered.booleanisValidationEnabled()voidsetConfiguration(Configuration conf)Invoked prior to setting bean properties.booleansetValidationEnabled(boolean enabled)voidstartConfiguration()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:ConfigurableInvoked upon completion of bean property configuration for this object.- Specified by:
endConfigurationin interfaceConfigurable
-
setConfiguration
public void setConfiguration(Configuration conf)
Description copied from interface:ConfigurableInvoked prior to setting bean properties.- Specified by:
setConfigurationin interfaceConfigurable
-
startConfiguration
public void startConfiguration()
Description copied from interface:ConfigurableInvoked before bean property configuration is begun on this object.- Specified by:
startConfigurationin interfaceConfigurable
-
hasUpdateListeners
public boolean hasUpdateListeners(java.lang.Object source, ClassMetaData meta)Description copied from class:LifecycleEventManagerReturn whether there are listeners or callbacks for the given source.- Overrides:
hasUpdateListenersin classLifecycleEventManager
-
hasPersistListeners
public boolean hasPersistListeners(java.lang.Object source, ClassMetaData meta)Description copied from class:LifecycleEventManagerReturn whether there are listeners or callbacks for the given source.- Overrides:
hasPersistListenersin classLifecycleEventManager
-
hasDeleteListeners
public boolean hasDeleteListeners(java.lang.Object source, ClassMetaData meta)Description copied from class:LifecycleEventManagerReturn whether there are listeners or callbacks for the given source.- Overrides:
hasDeleteListenersin classLifecycleEventManager
-
fireEvent
public java.lang.Exception[] fireEvent(java.lang.Object source, ClassMetaData meta, int type)Description copied from class:LifecycleEventManagerFire lifecycle event to all registered listeners without an argument.- Overrides:
fireEventin classLifecycleEventManager
-
fireEvent
public java.lang.Exception[] fireEvent(java.lang.Object source, java.lang.Object related, ClassMetaData meta, int type)Description copied from class:LifecycleEventManagerFire lifecycle event to all registered listeners.- Overrides:
fireEventin 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:
isActivein classLifecycleEventManager- Returns:
- boolean
-
isValidationEnabled
public boolean isValidationEnabled()
-
setValidationEnabled
public boolean setValidationEnabled(boolean enabled)
-
-