spring-context

org.springframework.scheduling.support
Class MethodInvokingRunnable

java.lang.Object
  extended by org.springframework.util.MethodInvoker
      extended by org.springframework.beans.support.ArgumentConvertingMethodInvoker
          extended by org.springframework.scheduling.support.MethodInvokingRunnable
All Implemented Interfaces:
java.lang.Runnable, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.InitializingBean
Direct Known Subclasses:
MethodInvokingTimerTaskFactoryBean

public class MethodInvokingRunnable
extends org.springframework.beans.support.ArgumentConvertingMethodInvoker
implements java.lang.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:
ScheduledTimerTask.setRunnable(Runnable), Executor.execute(Runnable)

Field Summary
protected  org.apache.commons.logging.Log logger
           
 
Constructor Summary
MethodInvokingRunnable()
           
 
Method Summary
 void afterPropertiesSet()
           
protected  java.lang.String getInvocationFailureMessage()
          Build a message for an invocation failure exception.
protected  java.lang.Class resolveClassName(java.lang.String className)
           
 void run()
           
 void setBeanClassLoader(java.lang.ClassLoader classLoader)
           
 
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 Detail

logger

protected final org.apache.commons.logging.Log logger
Constructor Detail

MethodInvokingRunnable

public MethodInvokingRunnable()
Method Detail

setBeanClassLoader

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

resolveClassName

protected java.lang.Class resolveClassName(java.lang.String className)
                                    throws java.lang.ClassNotFoundException
Overrides:
resolveClassName in class org.springframework.util.MethodInvoker
Throws:
java.lang.ClassNotFoundException

afterPropertiesSet

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

run

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

getInvocationFailureMessage

protected java.lang.String getInvocationFailureMessage()
Build a message for an invocation failure exception.

Returns:
the error message, including the target method name etc

spring-context