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
FieldsFields inherited from interface org.apache.openjpa.event.CallbackModes
CALLBACK_FAIL_FAST, CALLBACK_IGNORE, CALLBACK_LOG, CALLBACK_RETHROW, CALLBACK_ROLLBACK -
Constructor Summary
ConstructorsConstructorDescriptionConstructor which accepts a reference to the validator to use. -
Method Summary
Modifier and TypeMethodDescriptionvoidInvoked 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.booleanhasDeleteListeners(Object source, ClassMetaData meta) Return whether there are listeners or callbacks for the given source.booleanhasPersistListeners(Object source, ClassMetaData meta) Return whether there are listeners or callbacks for the given source.booleanhasUpdateListeners(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.booleanvoidInvoked prior to setting bean properties.booleansetValidationEnabled(boolean enabled) voidInvoked 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:ConfigurableInvoked upon completion of bean property configuration for this object.- Specified by:
endConfigurationin interfaceConfigurable
-
setConfiguration
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
Description copied from class:LifecycleEventManagerReturn whether there are listeners or callbacks for the given source.- Overrides:
hasUpdateListenersin classLifecycleEventManager
-
hasPersistListeners
Description copied from class:LifecycleEventManagerReturn whether there are listeners or callbacks for the given source.- Overrides:
hasPersistListenersin classLifecycleEventManager
-
hasDeleteListeners
Description copied from class:LifecycleEventManagerReturn whether there are listeners or callbacks for the given source.- Overrides:
hasDeleteListenersin classLifecycleEventManager
-
fireEvent
Description copied from class:LifecycleEventManagerFire lifecycle event to all registered listeners without an argument.- Overrides:
fireEventin classLifecycleEventManager
-
fireEvent
Description copied from class:LifecycleEventManagerFire lifecycle event to all registered listeners.- Overrides:
fireEventin classLifecycleEventManager
-
isActive
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)
-