public class

MethodInvokingRunnable

extends ArgumentConvertingMethodInvoker
implements Runnable BeanClassLoaderAware InitializingBean
java.lang.Object
   ↳ org.springframework.util.MethodInvoker
     ↳ org.springframework.beans.support.ArgumentConvertingMethodInvoker
       ↳ org.springframework.scheduling.support.MethodInvokingRunnable
Known Direct Subclasses

Class Overview

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

Inherits common configuration properties from MethodInvoker.

Summary

Fields
protected final Log logger
Public Constructors
MethodInvokingRunnable()
Public Methods
void afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
void run()
void setBeanClassLoader(ClassLoader classLoader)
Callback that supplies the bean class loader to a bean instance.
Protected Methods
String getInvocationFailureMessage()
Build a message for an invocation failure exception.
Class resolveClassName(String className)
Resolve the given class name into a Class.
[Expand]
Inherited Methods
From class org.springframework.beans.support.ArgumentConvertingMethodInvoker
From class org.springframework.util.MethodInvoker
From class java.lang.Object
From interface java.lang.Runnable
From interface org.springframework.beans.factory.BeanClassLoaderAware
From interface org.springframework.beans.factory.InitializingBean

Fields

protected final Log logger

Public Constructors

public MethodInvokingRunnable ()

Public Methods

public void afterPropertiesSet ()

Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

public void run ()

public void setBeanClassLoader (ClassLoader classLoader)

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 afterPropertiesSet() method or a custom init-method.

Parameters
classLoader the owning class loader; may be null in which case a default ClassLoader must be used, for example the ClassLoader obtained via getDefaultClassLoader()

Protected Methods

protected String getInvocationFailureMessage ()

Build a message for an invocation failure exception.

Returns
  • the error message, including the target method name etc

protected Class resolveClassName (String className)

Resolve the given class name into a Class.

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

Parameters
className the class name to resolve
Returns
  • the resolved Class