Package org.apache.openjpa.event
Class MethodLifecycleCallbacks
java.lang.Object
org.apache.openjpa.event.MethodLifecycleCallbacks
- All Implemented Interfaces:
Externalizable,Serializable,LifecycleCallbacks
- Direct Known Subclasses:
BeanLifecycleCallbacks
Callback adapter that invokes a callback method via reflection.
- Author:
- Steve Kim
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMethodLifecycleCallbacks(Class cls, String method, boolean arg) Constructor.MethodLifecycleCallbacks(Method method, boolean arg) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionThe callback method.protected static MethodHelper method to return the named method of the given class, throwing the proper exception on error.booleanhasCallback(Object obj, int eventType) Return whether the given instance has a callback for the given event type.voidmakeCallback(Object obj, Object arg, int eventType) Invoke the callback for the given event type on the given instance.voidbooleanReturns if this callback expects another argumenttoString()void
-
Constructor Details
-
MethodLifecycleCallbacks
Constructor. Supply callback class and its callback method name.- Parameters:
arg- Whether we expect a further argument such as in AfterDetach
-
MethodLifecycleCallbacks
Constructor. Supply callback method.
-
-
Method Details
-
getCallbackMethod
The callback method. -
requiresArgument
public boolean requiresArgument()Returns if this callback expects another argument -
hasCallback
Description copied from interface:LifecycleCallbacksReturn whether the given instance has a callback for the given event type.- Specified by:
hasCallbackin interfaceLifecycleCallbacks
-
makeCallback
Description copied from interface:LifecycleCallbacksInvoke the callback for the given event type on the given instance.- Specified by:
makeCallbackin interfaceLifecycleCallbacks- Throws:
Exception
-
toString
-
getMethod
Helper method to return the named method of the given class, throwing the proper exception on error. -
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-