public class MethodInvokingRunnable extends ArgumentConvertingMethodInvoker implements java.lang.Runnable, BeanClassLoaderAware, InitializingBean
Runnable
interface as a configurable
method invocation based on Spring's MethodInvoker.
Inherits common configuration properties from
MethodInvoker
.
Executor.execute(Runnable)
Constructor and Description |
---|
MethodInvokingRunnable() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet()
Invoked by the containing
BeanFactory after it has set all bean properties
and satisfied BeanFactoryAware , ApplicationContextAware etc. |
protected java.lang.String |
getInvocationFailureMessage()
Build a message for an invocation failure exception.
|
protected java.lang.Class<?> |
resolveClassName(java.lang.String className)
Resolve the given class name into a Class.
|
void |
run() |
void |
setBeanClassLoader(java.lang.ClassLoader classLoader)
Callback that supplies the bean
class loader to
a bean instance. |
doFindMatchingMethod, findMatchingMethod, getDefaultTypeConverter, getTypeConverter, registerCustomEditor, setTypeConverter
getArguments, getPreparedMethod, getTargetClass, getTargetMethod, getTargetObject, getTypeDifferenceWeight, invoke, isPrepared, prepare, setArguments, setStaticMethod, setTargetClass, setTargetMethod, setTargetObject
protected final Log logger
public void setBeanClassLoader(java.lang.ClassLoader classLoader)
BeanClassLoaderAware
class 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.
setBeanClassLoader
in interface BeanClassLoaderAware
classLoader
- the owning class loader; may be null
in
which case a default ClassLoader
must be used, for example
the ClassLoader
obtained via
ClassUtils.getDefaultClassLoader()
protected java.lang.Class<?> resolveClassName(java.lang.String className) throws java.lang.ClassNotFoundException
MethodInvoker
The default implementations uses ClassUtils.forName
,
using the thread context class loader.
resolveClassName
in class MethodInvoker
className
- the class name to resolvejava.lang.ClassNotFoundException
- if the class name was invalidpublic void afterPropertiesSet() throws java.lang.ClassNotFoundException, java.lang.NoSuchMethodException
InitializingBean
BeanFactory
after it has set all bean properties
and satisfied BeanFactoryAware
, 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.
afterPropertiesSet
in interface InitializingBean
java.lang.ClassNotFoundException
java.lang.NoSuchMethodException
public void run()
run
in interface java.lang.Runnable
protected java.lang.String getInvocationFailureMessage()