Class ScheduledMethodRunnable
- java.lang.Object
 - org.springframework.scheduling.support.ScheduledMethodRunnable
 
- All Implemented Interfaces:
 Runnable
public class ScheduledMethodRunnable extends Object implements Runnable
Variant ofMethodInvokingRunnablemeant 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.- Since:
 - 3.0.6
 - Author:
 - Juergen Hoeller
 - See Also:
 ScheduledAnnotationBeanPostProcessor
Constructor Summary
Constructors Constructor Description ScheduledMethodRunnable(Object target, Method method)Create aScheduledMethodRunnablefor the given target instance, calling the specified method.ScheduledMethodRunnable(Object target, String methodName)Create aScheduledMethodRunnablefor the given target instance, calling the specified method by name.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MethodgetMethod()Return the target method to call.ObjectgetTarget()Return the target instance to call the method on.voidrun()StringtoString()
Constructor Detail
ScheduledMethodRunnable
public ScheduledMethodRunnable(Object target, Method method)
Create aScheduledMethodRunnablefor the given target instance, calling the specified method.- Parameters:
 target- the target instance to call the method onmethod- the target method to call
ScheduledMethodRunnable
public ScheduledMethodRunnable(Object target, String methodName) throws NoSuchMethodException
Create aScheduledMethodRunnablefor the given target instance, calling the specified method by name.- Parameters:
 target- the target instance to call the method onmethodName- the name of the target method- Throws:
 NoSuchMethodException- if the specified method does not exist