public class SchedulerAccessorBean extends SchedulerAccessor implements BeanFactoryAware, InitializingBean
Scheduler
instance.
Compatible with Quartz 2.1.4 and higher, as of Spring 4.1.
setScheduler(org.quartz.Scheduler)
,
setSchedulerName(java.lang.String)
logger, resourceLoader
Constructor and Description |
---|
SchedulerAccessorBean() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet()
Invoked by the containing
BeanFactory after it has set all bean properties
and satisfied BeanFactoryAware , ApplicationContextAware etc. |
protected org.quartz.Scheduler |
findDefaultScheduler() |
protected org.quartz.Scheduler |
findScheduler(String schedulerName) |
org.quartz.Scheduler |
getScheduler()
Return the Quartz Scheduler instance that this accessor operates on.
|
void |
setBeanFactory(BeanFactory beanFactory)
Callback that supplies the owning factory to a bean instance.
|
void |
setScheduler(org.quartz.Scheduler scheduler)
Specify the Quartz
Scheduler instance to operate on. |
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 SchedulerRepository . |
registerJobsAndTriggers, registerListeners, setCalendars, setGlobalJobListeners, setGlobalTriggerListeners, setJobDetails, setJobSchedulingDataLocation, setJobSchedulingDataLocations, setOverwriteExistingJobs, setResourceLoader, setSchedulerListeners, setTransactionManager, setTriggers
public void setSchedulerName(String schedulerName)
Scheduler
to operate on via its scheduler name in the Spring
application context or also in the Quartz SchedulerRepository
.
Schedulers can be registered in the repository through custom bootstrapping,
e.g. via the StdSchedulerFactory
or
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.
public void setScheduler(org.quartz.Scheduler scheduler)
Scheduler
instance to operate on.
If not specified, this accessor will try to retrieve a default Scheduler
bean from the containing application context.
public org.quartz.Scheduler getScheduler()
getScheduler
in class SchedulerAccessor
public void setBeanFactory(BeanFactory beanFactory)
BeanFactoryAware
Invoked after the population of normal bean properties
but before an initialization callback such as
InitializingBean.afterPropertiesSet()
or a custom init-method.
setBeanFactory
in interface BeanFactoryAware
beanFactory
- owning BeanFactory (never null
).
The bean can immediately call methods on the factory.BeanInitializationException
public void afterPropertiesSet() throws org.quartz.SchedulerException
InitializingBean
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.
afterPropertiesSet
in interface InitializingBean
org.quartz.SchedulerException
protected org.quartz.Scheduler findScheduler(String schedulerName) throws org.quartz.SchedulerException
org.quartz.SchedulerException
protected org.quartz.Scheduler findDefaultScheduler()