org.springframework.scheduling.support

Class ScheduledMethodRunnable

  • java.lang.Object
    • org.springframework.scheduling.support.ScheduledMethodRunnable
  • All Implemented Interfaces:
    java.lang.Runnable


    public class ScheduledMethodRunnable
    extends java.lang.Object
    implements java.lang.Runnable
    Variant of 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.
    Since:
    3.0.6
    Author:
    Juergen Hoeller
    See Also:
    ScheduledAnnotationBeanPostProcessor
    • Constructor Summary

      Constructors 
      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.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      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() 
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ScheduledMethodRunnable

        public ScheduledMethodRunnable(java.lang.Object target,
                                       java.lang.reflect.Method method)
        Create a ScheduledMethodRunnable for the given target instance, calling the specified method.
        Parameters:
        target - the target instance to call the method on
        method - the target method to call
      • ScheduledMethodRunnable

        public ScheduledMethodRunnable(java.lang.Object target,
                                       java.lang.String methodName)
                                throws java.lang.NoSuchMethodException
        Create a ScheduledMethodRunnable for the given target instance, calling the specified method by name.
        Parameters:
        target - the target instance to call the method on
        methodName - the name of the target method
        Throws:
        java.lang.NoSuchMethodException - if the specified method does not exist
    • Method Detail

      • getTarget

        public java.lang.Object getTarget()
        Return the target instance to call the method on.
      • getMethod

        public java.lang.reflect.Method getMethod()
        Return the target method to call.
      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object