spring-framework / org.springframework.scheduling.quartz / MethodInvokingJobDetailFactoryBean / <init>

<init>

MethodInvokingJobDetailFactoryBean()

org.springframework.beans.factory.FactoryBean that exposes a org.quartz.JobDetail object which delegates job execution to a specified (static or non-static) method. Avoids the need for implementing a one-line Quartz Job that just invokes an existing service method on a Spring-managed target bean.

Inherits common configuration properties from the MethodInvoker base class, such as "targetObject" and "targetMethod", adding support for lookup of the target bean by name through the "targetBeanName" property (as alternative to specifying a "targetObject" directly, allowing for non-singleton target objects).

Supports both concurrently running jobs and non-currently running jobs through the "concurrent" property. Jobs created by this MethodInvokingJobDetailFactoryBean are by default volatile and durable (according to Quartz terminology).

NOTE: JobDetails created via this FactoryBean are not serializable and thus not suitable for persistent job stores. You need to implement your own Quartz Job as a thin wrapper for each case where you want a persistent job to delegate to a specific service method.

Compatible with Quartz 2.1.4 and higher, as of Spring 4.1.

Author
Juergen Hoeller

Author
Alef Arendsen

Since
18.02.2004

See Also
#setTargetBeanName#setTargetObject#setTargetMethod#setConcurrent