public class MethodLifecycleCallbacks extends Object implements LifecycleCallbacks, Externalizable
Constructor and Description |
---|
MethodLifecycleCallbacks(Class cls,
String method,
boolean arg)
Constructor.
|
MethodLifecycleCallbacks(Method method,
boolean arg)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Method |
getCallbackMethod()
The callback method.
|
protected static Method |
getMethod(Class cls,
String method,
Class[] args)
Helper method to return the named method of the given class, throwing
the proper exception on error.
|
boolean |
hasCallback(Object obj,
int eventType)
Return whether the given instance has a callback for the given
event type.
|
void |
makeCallback(Object obj,
Object arg,
int eventType)
Invoke the callback for the given event type on the given instance.
|
void |
readExternal(ObjectInput in) |
boolean |
requiresArgument()
Returns if this callback expects another argument
|
String |
toString() |
void |
writeExternal(ObjectOutput out) |
public MethodLifecycleCallbacks(Class cls, String method, boolean arg)
arg
- Whether we expect a further argument such as in AfterDetachpublic MethodLifecycleCallbacks(Method method, boolean arg)
public Method getCallbackMethod()
public boolean requiresArgument()
public boolean hasCallback(Object obj, int eventType)
LifecycleCallbacks
hasCallback
in interface LifecycleCallbacks
public void makeCallback(Object obj, Object arg, int eventType) throws Exception
LifecycleCallbacks
makeCallback
in interface LifecycleCallbacks
Exception
protected static Method getMethod(Class cls, String method, Class[] args)
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
Copyright © 2006–2017 Apache Software Foundation. All rights reserved.