public class ScheduledMethodRunnable
extends java.lang.Object
implements java.lang.Runnable
MethodInvokingRunnable
meant to be used for processing
of no-arg scheduled methods. Propagates user exceptions to the caller,
assuming that an error strategy for Runnables is in place.ScheduledAnnotationBeanPostProcessor
Constructor and Description |
---|
ScheduledMethodRunnable(java.lang.Object target,
java.lang.reflect.Method method)
Create a
ScheduledMethodRunnable for the given target instance,
calling the specified method. |
ScheduledMethodRunnable(java.lang.Object target,
java.lang.String methodName)
Create a
ScheduledMethodRunnable for the given target instance,
calling the specified method by name. |
Modifier and Type | Method and Description |
---|---|
java.lang.reflect.Method |
getMethod()
Return the target method to call.
|
java.lang.Object |
getTarget()
Return the target instance to call the method on.
|
void |
run() |
java.lang.String |
toString() |
public ScheduledMethodRunnable(java.lang.Object target, java.lang.reflect.Method method)
ScheduledMethodRunnable
for the given target instance,
calling the specified method.target
- the target instance to call the method onmethod
- the target method to callpublic ScheduledMethodRunnable(java.lang.Object target, java.lang.String methodName) throws java.lang.NoSuchMethodException
ScheduledMethodRunnable
for the given target instance,
calling the specified method by name.target
- the target instance to call the method onmethodName
- the name of the target methodjava.lang.NoSuchMethodException
- if the specified method does not existpublic java.lang.Object getTarget()
public java.lang.reflect.Method getMethod()
public void run()
run
in interface java.lang.Runnable
public java.lang.String toString()
toString
in class java.lang.Object