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

public Class SchedulerAccessorBean

extends SchedulerAccessor
implements BeanFactoryAware, InitializingBean
Class Inheritance
All Implemented Interfaces
org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.Aware
Imports
org.quartz.Scheduler, org.quartz.SchedulerException, org.quartz.impl.SchedulerRepository, org.springframework.beans.factory.BeanFactory, .BeanFactoryAware, .InitializingBean, .ListableBeanFactory, org.springframework.lang.Nullable, org.springframework.util.Assert

Spring bean-style class for accessing a Quartz Scheduler, i.e. for registering jobs, triggers and listeners on a given org.quartz.Scheduler instance.

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

Author
Juergen Hoeller
Since
2.5.6
See Also
setScheduler, setSchedulerName

Field Summary

Modifier and TypeField and Description
private BeanFactory
private org.quartz.Scheduler
private String
Inherited from org.springframework.scheduling.quartz.SchedulerAccessor:
loggerresourceLoader

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 org.quartz.Scheduler
protected org.quartz.Scheduler
findScheduler(String schedulerName)

public org.quartz.Scheduler
getScheduler()

Implements abstract org.springframework.scheduling.quartz.SchedulerAccessor.getScheduler.

Return the Quartz Scheduler instance that this accessor operates on.

public void
setBeanFactory(BeanFactory
owning BeanFactory (never null). The bean can immediately call methods on the factory.
beanFactory
)

Implements org.springframework.beans.factory.BeanFactoryAware.setBeanFactory.

Callback that supplies the owning factory to a bean instance.

public void
setScheduler(org.quartz.Scheduler scheduler)

Specify the Quartz Scheduler instance to operate on.

public void
setSchedulerName(String schedulerName)

Specify the Quartz Scheduler to operate on via its scheduler name in the Spring application context or also in the Quartz org.quartz.impl.SchedulerRepository.

Inherited from org.springframework.scheduling.quartz.SchedulerAccessor:
registerJobsAndTriggersregisterListenerssetCalendarssetGlobalJobListenerssetGlobalTriggerListenerssetJobDetailssetJobSchedulingDataLocationsetJobSchedulingDataLocationssetOverwriteExistingJobssetResourceLoadersetSchedulerListenerssetTransactionManagersetTriggers

Field Detail

beanFactoryback to summary
private BeanFactory beanFactory
Annotations
@Nullable
schedulerback to summary
private org.quartz.Scheduler scheduler
Annotations
@Nullable
schedulerNameback to summary
private String schedulerName
Annotations
@Nullable

Constructor Detail

SchedulerAccessorBeanback to summary
public SchedulerAccessorBean()

Method Detail

afterPropertiesSetback to summary
public void afterPropertiesSet() throws org.quartz.SchedulerException

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
findDefaultSchedulerback to summary
protected org.quartz.Scheduler findDefaultScheduler()
findSchedulerback to summary
protected org.quartz.Scheduler findScheduler(String schedulerName) throws org.quartz.SchedulerException
getSchedulerback to summary
public org.quartz.Scheduler getScheduler()

Implements abstract org.springframework.scheduling.quartz.SchedulerAccessor.getScheduler.

Return the Quartz Scheduler instance that this accessor operates on.

Annotations
@Override
setBeanFactoryback to summary
public void setBeanFactory(BeanFactory beanFactory)

Implements org.springframework.beans.factory.BeanFactoryAware.setBeanFactory.

Doc from org.springframework.beans.factory.BeanFactoryAware.setBeanFactory.

Callback that supplies the owning factory to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean#afterPropertiesSet() or a custom init-method.

Parameters
beanFactory:BeanFactory

owning BeanFactory (never null). The bean can immediately call methods on the factory.

Annotations
@Override
setSchedulerback to summary
public void setScheduler(org.quartz.Scheduler scheduler)

Specify the Quartz Scheduler instance to operate on.

If not specified, this accessor will try to retrieve a default Scheduler bean from the containing application context.

setSchedulerNameback to summary
public void setSchedulerName(String schedulerName)

Specify the Quartz Scheduler to operate on via its scheduler name in the Spring application context or also in the Quartz org.quartz.impl.SchedulerRepository.

Schedulers can be registered in the repository through custom bootstrapping, e.g. via the org.quartz.impl.StdSchedulerFactory or org.quartz.impl.DirectSchedulerFactory factory classes. However, in general, it's preferable to use Spring's SchedulerFactoryBean which includes the job/trigger/listener capabilities of this accessor as well.

If not specified, this accessor will try to retrieve a default Scheduler bean from the containing application context.