类 SpringBeanJobFactory
- java.lang.Object
- org.springframework.scheduling.quartz.AdaptableJobFactory
- org.springframework.scheduling.quartz.SpringBeanJobFactory
- 所有已实现的接口:
JobFactory
,Aware
,SchedulerContextAware
public class SpringBeanJobFactory extends AdaptableJobFactory implements SchedulerContextAware
Subclass ofAdaptableJobFactory
that also supports Spring-style dependency injection on bean properties. This is essentially the direct equivalent of Spring'sQuartzJobBean
in the shape of a QuartzJobFactory
.Applies scheduler context, job data map and trigger data map entries as bean property values. If no matching bean property is found, the entry is by default simply ignored. This is analogous to QuartzJobBean's behavior.
Compatible with Quartz 2.1.4 and higher, as of Spring 4.1.
- 从以下版本开始:
- 2.0
- 作者:
- Juergen Hoeller
- 另请参阅:
SchedulerFactoryBean.setJobFactory(org.quartz.spi.JobFactory)
,QuartzJobBean
构造器概要
构造器 构造器 说明 SpringBeanJobFactory()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected Object
createJobInstance(TriggerFiredBundle bundle)
Create the job instance, populating it with property values taken from the scheduler context, job data map and trigger data map.protected boolean
isEligibleForPropertyPopulation(Object jobObject)
Return whether the given job object is eligible for having its bean properties populated.void
setIgnoredUnknownProperties(String... ignoredUnknownProperties)
Specify the unknown properties (not found in the bean) that should be ignored.void
setSchedulerContext(SchedulerContext schedulerContext)
Set the SchedulerContext of the current Quartz Scheduler.从类继承的方法 org.springframework.scheduling.quartz.AdaptableJobFactory
adaptJob, newJob
构造器详细资料
SpringBeanJobFactory
public SpringBeanJobFactory()
方法详细资料
setIgnoredUnknownProperties
public void setIgnoredUnknownProperties(String... ignoredUnknownProperties)
Specify the unknown properties (not found in the bean) that should be ignored.Default is
null
, indicating that all unknown properties should be ignored. Specify an empty array to throw an exception in case of any unknown properties, or a list of property names that should be ignored if there is no corresponding property found on the particular job class (all other unknown properties will still trigger an exception).
setSchedulerContext
public void setSchedulerContext(SchedulerContext schedulerContext)
从接口复制的说明:SchedulerContextAware
Set the SchedulerContext of the current Quartz Scheduler.
createJobInstance
protected Object createJobInstance(TriggerFiredBundle bundle) throws Exception
Create the job instance, populating it with property values taken from the scheduler context, job data map and trigger data map.- 覆盖:
createJobInstance
在类中AdaptableJobFactory
- 参数:
bundle
- the TriggerFiredBundle from which the JobDetail and other info relating to the trigger firing can be obtained- 返回:
- the job instance
- 抛出:
Exception
- if job instantiation failed
isEligibleForPropertyPopulation
protected boolean isEligibleForPropertyPopulation(Object jobObject)
Return whether the given job object is eligible for having its bean properties populated.The default implementation ignores
QuartzJobBean
instances, which will inject bean properties themselves.- 参数:
jobObject
- the job object to introspect- 另请参阅:
QuartzJobBean