Class MethodInvokingRunnable
java.lang.Object
org.springframework.util.MethodInvoker
org.springframework.beans.support.ArgumentConvertingMethodInvoker
org.springframework.scheduling.support.MethodInvokingRunnable
- All Implemented Interfaces:
Runnable
,Aware
,BeanClassLoaderAware
,InitializingBean
public class MethodInvokingRunnable
extends ArgumentConvertingMethodInvoker
implements Runnable, BeanClassLoaderAware, 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 inherited from class org.springframework.util.MethodInvoker
targetClass
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Invoked by the containingBeanFactory
after it has set all bean properties and satisfiedBeanFactoryAware
,ApplicationContextAware
etc.protected String
Build a message for an invocation failure exception.protected Class<?>
resolveClassName
(String className) Resolve the given class name into a Class.void
run()
void
setBeanClassLoader
(ClassLoader classLoader) Callback that supplies the beanclass loader
to a bean instance.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
-
Field Details
-
logger
protected final org.apache.commons.logging.Log logger
-
-
Constructor Details
-
MethodInvokingRunnable
public MethodInvokingRunnable()
-
-
Method Details
-
setBeanClassLoader
Description copied from interface:BeanClassLoaderAware
Callback that supplies the beanclass loader
to a bean instance.Invoked after the population of normal bean properties but before an initialization callback such as
InitializingBean's
InitializingBean.afterPropertiesSet()
method or a custom init-method.- Specified by:
setBeanClassLoader
in interfaceBeanClassLoaderAware
- Parameters:
classLoader
- the owning class loader
-
resolveClassName
Description copied from class:MethodInvoker
Resolve the given class name into a Class.The default implementations uses
ClassUtils.forName
, using the thread context class loader.- Overrides:
resolveClassName
in classMethodInvoker
- Parameters:
className
- the class name to resolve- Returns:
- the resolved Class
- Throws:
ClassNotFoundException
- if the class name was invalid
-
afterPropertiesSet
Description copied from interface:InitializingBean
Invoked by the containingBeanFactory
after it has set all bean properties and satisfiedBeanFactoryAware
,ApplicationContextAware
etc.This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.
- Specified by:
afterPropertiesSet
in interfaceInitializingBean
- Throws:
ClassNotFoundException
NoSuchMethodException
-
run
public void run() -
getInvocationFailureMessage
Build a message for an invocation failure exception.- Returns:
- the error message, including the target method name etc
-