Package ome.services.scheduler
Class SchedulerFactoryBean
- java.lang.Object
-
- org.springframework.scheduling.quartz.SchedulerAccessor
-
- org.springframework.scheduling.quartz.SchedulerFactoryBean
-
- ome.services.scheduler.SchedulerFactoryBean
-
- All Implemented Interfaces:
java.util.EventListener
,org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanNameAware
,org.springframework.beans.factory.DisposableBean
,org.springframework.beans.factory.FactoryBean<org.quartz.Scheduler>
,org.springframework.beans.factory.InitializingBean
,org.springframework.context.ApplicationContextAware
,org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>
,org.springframework.context.Lifecycle
,org.springframework.context.Phased
,org.springframework.context.ResourceLoaderAware
,org.springframework.context.SmartLifecycle
public class SchedulerFactoryBean extends org.springframework.scheduling.quartz.SchedulerFactoryBean implements org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>, org.springframework.context.ApplicationContextAware
Produces aScheduler
which automatically loads all the triggers it can find.- Since:
- 3.0-Beta3
-
-
Constructor Summary
Constructors Constructor Description SchedulerFactoryBean()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
onApplicationEvent(org.springframework.context.event.ContextRefreshedEvent event)
protected void
registerTrigger(java.lang.String beanName, org.quartz.Trigger trigger)
Registers aTrigger
.protected void
restartIfNeeded()
Similar to theSchedulerFactoryBean.isRunning()
method, but properly handles the situation where theScheduler
has been completely shutdown and therefore must be replaced.void
setApplicationContext(org.springframework.context.ApplicationContext ctx)
-
Methods inherited from class org.springframework.scheduling.quartz.SchedulerFactoryBean
afterPropertiesSet, createScheduler, destroy, getConfigTimeDataSource, getConfigTimeNonTransactionalDataSource, getConfigTimeResourceLoader, getConfigTimeTaskExecutor, getObject, getObjectType, getPhase, getScheduler, isAutoStartup, isRunning, isSingleton, setApplicationContextSchedulerContextKey, setAutoStartup, setBeanName, setConfigLocation, setDataSource, setExposeSchedulerInRepository, setJobFactory, setNonTransactionalDataSource, setPhase, setQuartzProperties, setSchedulerContextAsMap, setSchedulerFactory, setSchedulerFactoryClass, setSchedulerName, setStartupDelay, setTaskExecutor, setWaitForJobsToCompleteOnShutdown, start, startScheduler, stop, stop
-
Methods inherited from class org.springframework.scheduling.quartz.SchedulerAccessor
registerJobsAndTriggers, registerListeners, setCalendars, setGlobalJobListeners, setGlobalTriggerListeners, setJobDetails, setJobSchedulingDataLocation, setJobSchedulingDataLocations, setOverwriteExistingJobs, setResourceLoader, setSchedulerListeners, setTransactionManager, setTriggers
-
-
-
-
Method Detail
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext ctx)
- Specified by:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
- Overrides:
setApplicationContext
in classorg.springframework.scheduling.quartz.SchedulerFactoryBean
-
onApplicationEvent
public void onApplicationEvent(org.springframework.context.event.ContextRefreshedEvent event)
- Specified by:
onApplicationEvent
in interfaceorg.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>
-
registerTrigger
protected void registerTrigger(java.lang.String beanName, org.quartz.Trigger trigger)
Registers aTrigger
. A method like this should really have protected visibility in the superclass.
-
restartIfNeeded
protected void restartIfNeeded()
Similar to theSchedulerFactoryBean.isRunning()
method, but properly handles the situation where theScheduler
has been completely shutdown and therefore must be replaced.
-
-