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
FieldsFields inherited from class org.springframework.util.MethodInvoker
targetClass -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidInvoked by the containingBeanFactoryafter it has set all bean properties and satisfiedBeanFactoryAware,ApplicationContextAwareetc.protected StringBuild a message for an invocation failure exception.protected Class<?>resolveClassName(String className) Resolve the given class name into a Class.voidrun()voidsetBeanClassLoader(ClassLoader classLoader) Callback that supplies the beanclass loaderto a bean instance.Methods inherited from class org.springframework.beans.support.ArgumentConvertingMethodInvoker
doFindMatchingMethod, findMatchingMethod, getDefaultTypeConverter, getTypeConverter, registerCustomEditor, setTypeConverterMethods inherited from class org.springframework.util.MethodInvoker
getArguments, getPreparedMethod, getTargetClass, getTargetMethod, getTargetObject, getTypeDifferenceWeight, invoke, isPrepared, prepare, setArguments, setStaticMethod, setTargetClass, setTargetMethod, setTargetObject
-
Field Details
-
logger
-
-
Constructor Details
-
MethodInvokingRunnable
public MethodInvokingRunnable()
-
-
Method Details
-
setBeanClassLoader
Description copied from interface:BeanClassLoaderAwareCallback that supplies the beanclass loaderto a bean instance.Invoked after the population of normal bean properties but before an initialization callback such as
InitializingBean'sInitializingBean.afterPropertiesSet()method or a custom init-method.- Specified by:
setBeanClassLoaderin interfaceBeanClassLoaderAware- Parameters:
classLoader- the owning class loader
-
resolveClassName
Description copied from class:MethodInvokerResolve the given class name into a Class.The default implementations uses
ClassUtils.forName, using the thread context class loader.- Overrides:
resolveClassNamein 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:InitializingBeanInvoked by the containingBeanFactoryafter it has set all bean properties and satisfiedBeanFactoryAware,ApplicationContextAwareetc.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:
afterPropertiesSetin interfaceInitializingBean- Throws:
ClassNotFoundExceptionNoSuchMethodException
-
run
public void run() -
getInvocationFailureMessage
Build a message for an invocation failure exception.- Returns:
- the error message, including the target method name etc
-