Class ContextLifecycleScheduledTaskRegistrar
- java.lang.Object
- org.springframework.scheduling.config.ScheduledTaskRegistrar
- org.springframework.scheduling.config.ContextLifecycleScheduledTaskRegistrar
- All Implemented Interfaces:
DisposableBean,InitializingBean,SmartInitializingSingleton
public class ContextLifecycleScheduledTaskRegistrar extends ScheduledTaskRegistrar implements SmartInitializingSingleton
ScheduledTaskRegistrarsubclass which redirects the actual scheduling of tasks to theafterSingletonsInstantiated()callback (as of 4.1.2).- Since:
- 3.2.1
- Author:
- Juergen Hoeller
Constructor Summary
Constructors Constructor Description ContextLifecycleScheduledTaskRegistrar()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()CallsScheduledTaskRegistrar.scheduleTasks()at bean construction time.voidafterSingletonsInstantiated()Invoked right at the end of the singleton pre-instantiation phase, with a guarantee that all regular singleton beans have been created already.Methods inherited from class org.springframework.scheduling.config.ScheduledTaskRegistrar
addCronTask, addCronTask, addFixedDelayTask, addFixedDelayTask, addFixedRateTask, addFixedRateTask, addTriggerTask, addTriggerTask, destroy, getCronTaskList, getFixedDelayTaskList, getFixedRateTaskList, getScheduler, getTriggerTaskList, hasTasks, scheduleCronTask, scheduleFixedDelayTask, scheduleFixedRateTask, scheduleTasks, scheduleTriggerTask, setCronTasks, setCronTasksList, setFixedDelayTasks, setFixedDelayTasksList, setFixedRateTasks, setFixedRateTasksList, setScheduler, setTaskScheduler, setTriggerTasks, setTriggerTasksList
Constructor Detail
ContextLifecycleScheduledTaskRegistrar
public ContextLifecycleScheduledTaskRegistrar()
Method Detail
afterPropertiesSet
public void afterPropertiesSet()
Description copied from class:ScheduledTaskRegistrarCallsScheduledTaskRegistrar.scheduleTasks()at bean construction time.- Specified by:
afterPropertiesSetin interfaceInitializingBean- Overrides:
afterPropertiesSetin classScheduledTaskRegistrar
afterSingletonsInstantiated
public void afterSingletonsInstantiated()
Description copied from interface:SmartInitializingSingletonInvoked right at the end of the singleton pre-instantiation phase, with a guarantee that all regular singleton beans have been created already.ListableBeanFactory.getBeansOfType(java.lang.Class<T>)calls within this method won't trigger accidental side effects during bootstrap.NOTE: This callback won't be triggered for singleton beans lazily initialized on demand after
BeanFactorybootstrap, and not for any other bean scope either. Carefully use it for beans with the intended bootstrap semantics only.- Specified by:
afterSingletonsInstantiatedin interfaceSmartInitializingSingleton