Class MethodInvokingRunnable

java.lang.Object
org.springframework.util.MethodInvoker
org.springframework.beans.support.ArgumentConvertingMethodInvoker
org.springframework.scheduling.support.MethodInvokingRunnable
All Implemented Interfaces:
Runnable, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.InitializingBean

public class MethodInvokingRunnable extends org.springframework.beans.support.ArgumentConvertingMethodInvoker implements Runnable, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.InitializingBean
Adapter that implements the Runnable interface as a configurable method invocation based on Spring's MethodInvoker.

Inherits common configuration properties from MethodInvoker.

Since:
1.2.4
Author:
Juergen Hoeller
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final Log
     

    Fields inherited from class org.springframework.util.MethodInvoker

    targetClass
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    protected String
    Build a message for an invocation failure exception.
    protected Class<?>
     
    void
    run()
     
    void
     

    Methods inherited from class org.springframework.beans.support.ArgumentConvertingMethodInvoker

    doFindMatchingMethod, findMatchingMethod, getDefaultTypeConverter, getTypeConverter, registerCustomEditor, setTypeConverter

    Methods inherited from class org.springframework.util.MethodInvoker

    getArguments, getPreparedMethod, getTargetClass, getTargetMethod, getTargetObject, getTypeDifferenceWeight, invoke, isPrepared, prepare, setArguments, setStaticMethod, setTargetClass, setTargetMethod, setTargetObject

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • logger

      protected final Log logger
  • Constructor Details

    • MethodInvokingRunnable

      public MethodInvokingRunnable()
  • Method Details

    • setBeanClassLoader

      public void setBeanClassLoader(ClassLoader classLoader)
      Specified by:
      setBeanClassLoader in interface org.springframework.beans.factory.BeanClassLoaderAware
    • resolveClassName

      protected Class<?> resolveClassName(String className) throws ClassNotFoundException
      Overrides:
      resolveClassName in class org.springframework.util.MethodInvoker
      Throws:
      ClassNotFoundException
    • afterPropertiesSet

      public void afterPropertiesSet() throws ClassNotFoundException, NoSuchMethodException
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Throws:
      ClassNotFoundException
      NoSuchMethodException
    • run

      public void run()
      Specified by:
      run in interface Runnable
    • getInvocationFailureMessage

      protected String getInvocationFailureMessage()
      Build a message for an invocation failure exception.
      Returns:
      the error message, including the target method name etc