类 MethodInvokingRunnable
- java.lang.Object
- org.springframework.util.MethodInvoker
- org.springframework.beans.support.ArgumentConvertingMethodInvoker
- org.springframework.scheduling.support.MethodInvokingRunnable
- 所有已实现的接口:
Runnable
,Aware
,BeanClassLoaderAware
,InitializingBean
public class MethodInvokingRunnable extends ArgumentConvertingMethodInvoker implements Runnable, BeanClassLoaderAware, InitializingBean
Adapter that implements theRunnable
interface as a configurable method invocation based on Spring's MethodInvoker.Inherits common configuration properties from
MethodInvoker
.- 从以下版本开始:
- 1.2.4
- 作者:
- Juergen Hoeller
- 另请参阅:
Executor.execute(Runnable)
构造器概要
构造器 构造器 说明 MethodInvokingRunnable()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
afterPropertiesSet()
Invoked by the containingBeanFactory
after it has set all bean properties and satisfiedBeanFactoryAware
,ApplicationContextAware
etc.protected String
getInvocationFailureMessage()
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.从类继承的方法 org.springframework.beans.support.ArgumentConvertingMethodInvoker
doFindMatchingMethod, findMatchingMethod, getDefaultTypeConverter, getTypeConverter, registerCustomEditor, setTypeConverter
从类继承的方法 org.springframework.util.MethodInvoker
getArguments, getPreparedMethod, getTargetClass, getTargetMethod, getTargetObject, getTypeDifferenceWeight, invoke, isPrepared, prepare, setArguments, setStaticMethod, setTargetClass, setTargetMethod, setTargetObject
构造器详细资料
MethodInvokingRunnable
public MethodInvokingRunnable()
方法详细资料
setBeanClassLoader
public void setBeanClassLoader(ClassLoader classLoader)
从接口复制的说明: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.- 指定者:
setBeanClassLoader
在接口中BeanClassLoaderAware
- 参数:
classLoader
- the owning class loader; may benull
in which case a defaultClassLoader
must be used, for example theClassLoader
obtained viaClassUtils.getDefaultClassLoader()
resolveClassName
protected Class<?> resolveClassName(String className) throws ClassNotFoundException
从类复制的说明:MethodInvoker
Resolve the given class name into a Class.The default implementations uses
ClassUtils.forName
, using the thread context class loader.- 覆盖:
resolveClassName
在类中MethodInvoker
- 参数:
className
- the class name to resolve- 返回:
- the resolved Class
- 抛出:
ClassNotFoundException
- if the class name was invalid
afterPropertiesSet
public void afterPropertiesSet() throws ClassNotFoundException, NoSuchMethodException
从接口复制的说明: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.
getInvocationFailureMessage
protected String getInvocationFailureMessage()
Build a message for an invocation failure exception.- 返回:
- the error message, including the target method name etc