Package org.apache.openjpa.validation
Class ValidatingLifecycleEventManager
java.lang.Object
org.apache.openjpa.event.LifecycleEventManager
org.apache.openjpa.validation.ValidatingLifecycleEventManager
- All Implemented Interfaces:
Serializable
,CallbackModes
,Configurable
An extension of LifecycleEventManager which adds validation capabilities for
specific lifecycle events. Validation occurs after firing all lifecycle
events and callbacks.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.openjpa.event.LifecycleEventManager
LifecycleEventManager.ListenerAdapter, LifecycleEventManager.ListenerList
-
Field Summary
Fields inherited from interface org.apache.openjpa.event.CallbackModes
CALLBACK_FAIL_FAST, CALLBACK_IGNORE, CALLBACK_LOG, CALLBACK_RETHROW, CALLBACK_ROLLBACK
-
Constructor Summary
ConstructorDescriptionConstructor which accepts a reference to the validator to use. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Invoked upon completion of bean property configuration for this object.fireEvent
(Object source, Object related, ClassMetaData meta, int type) Fire lifecycle event to all registered listeners.fireEvent
(Object source, ClassMetaData meta, int type) Fire lifecycle event to all registered listeners without an argument.boolean
hasDeleteListeners
(Object source, ClassMetaData meta) Return whether there are listeners or callbacks for the given source.boolean
hasPersistListeners
(Object source, ClassMetaData meta) Return whether there are listeners or callbacks for the given source.boolean
hasUpdateListeners
(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
void
Invoked prior to setting bean properties.boolean
setValidationEnabled
(boolean enabled) void
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
-
Field Details
-
_validationEnabled
protected boolean _validationEnabled
-
-
Constructor Details
-
ValidatingLifecycleEventManager
public ValidatingLifecycleEventManager()Constructor which accepts a reference to the validator to use. If null, no validation will occur.
-
-
Method Details
-
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
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
Description copied from class:LifecycleEventManager
Return whether there are listeners or callbacks for the given source.- Overrides:
hasUpdateListeners
in classLifecycleEventManager
-
hasPersistListeners
Description copied from class:LifecycleEventManager
Return whether there are listeners or callbacks for the given source.- Overrides:
hasPersistListeners
in classLifecycleEventManager
-
hasDeleteListeners
Description copied from class:LifecycleEventManager
Return whether there are listeners or callbacks for the given source.- Overrides:
hasDeleteListeners
in classLifecycleEventManager
-
fireEvent
Description copied from class:LifecycleEventManager
Fire lifecycle event to all registered listeners without an argument.- Overrides:
fireEvent
in classLifecycleEventManager
-
fireEvent
Description copied from class:LifecycleEventManager
Fire lifecycle event to all registered listeners.- Overrides:
fireEvent
in classLifecycleEventManager
-
isActive
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)
-