Top Description Fields Constructors Methods
org.springframework.scheduling.support

public Class MethodInvokingRunnable

extends ArgumentConvertingMethodInvoker
implements Runnable, BeanClassLoaderAware, InitializingBean
Class Inheritance
All Implemented Interfaces
org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.Aware, java.lang.Runnable
Imports
java.lang.reflect.InvocationTargetException, org.apache.commons.logging.Log, .LogFactory, org.springframework.beans.factory.BeanClassLoaderAware, .InitializingBean, org.springframework.beans.support.ArgumentConvertingMethodInvoker, org.springframework.lang.Nullable, org.springframework.util.ClassUtils

Adapter that implements the Runnable interface as a configurable method invocation based on Spring's MethodInvoker.

Inherits common configuration properties from org.springframework.util.MethodInvoker.

Author
Juergen Hoeller
Since
1.2.4
See Also
java.util.concurrent.Executor#execute(Runnable)

Field Summary

Modifier and TypeField and Description
private ClassLoader
protected final Log

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
afterPropertiesSet()

Implements org.springframework.beans.factory.InitializingBean.afterPropertiesSet.

Invoked by the containing 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.

protected String

Returns:

the error message, including the target method name etc
getInvocationFailureMessage
()

Build a message for an invocation failure exception.

protected Class<?>
resolveClassName(String
the class name to resolve
className
)

Overrides org.springframework.util.MethodInvoker.resolveClassName.

Resolve the given class name into a Class.

public void
run()

Implements java.lang.Runnable.run.

Runs this operation.

public void
setBeanClassLoader(ClassLoader
the owning class loader
classLoader
)

Implements org.springframework.beans.factory.BeanClassLoaderAware.setBeanClassLoader.

Callback that supplies the bean class loader to a bean instance.

Inherited from org.springframework.beans.support.ArgumentConvertingMethodInvoker:
doFindMatchingMethodfindMatchingMethodgetDefaultTypeConvertergetTypeConverterregisterCustomEditorsetTypeConverter

Field Detail

beanClassLoaderback to summary
private ClassLoader beanClassLoader
Annotations
@Nullable
loggerback to summary
protected final Log logger

Constructor Detail

MethodInvokingRunnableback to summary
public MethodInvokingRunnable()

Method Detail

afterPropertiesSetback to summary
public void afterPropertiesSet() throws ClassNotFoundException, NoSuchMethodException

Implements org.springframework.beans.factory.InitializingBean.afterPropertiesSet.

Doc from org.springframework.beans.factory.InitializingBean.afterPropertiesSet.

Invoked by the containing 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.

Annotations
@Override
getInvocationFailureMessageback to summary
protected String getInvocationFailureMessage()

Build a message for an invocation failure exception.

Returns:String

the error message, including the target method name etc

resolveClassNameback to summary
protected Class<?> resolveClassName(String className) throws ClassNotFoundException

Overrides org.springframework.util.MethodInvoker.resolveClassName.

Doc from org.springframework.util.MethodInvoker.resolveClassName.

Resolve the given class name into a Class.

The default implementations uses ClassUtils.forName, using the thread context class loader.

Parameters
className:String

the class name to resolve

Returns:Class<?>

the resolved Class

Annotations
@Override
Exceptions
ClassNotFoundException:
if the class name was invalid
runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.

Annotations
@Override
setBeanClassLoaderback to summary
public void setBeanClassLoader(ClassLoader classLoader)

Implements org.springframework.beans.factory.BeanClassLoaderAware.setBeanClassLoader.

Doc from org.springframework.beans.factory.BeanClassLoaderAware.setBeanClassLoader.

Callback that supplies the bean 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.

Parameters
classLoader:ClassLoader

the owning class loader

Annotations
@Override