Class ScheduledAnnotationBeanPostProcessor

java.lang.Object
org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor
All Implemented Interfaces:
EventListener, Aware, BeanFactoryAware, BeanNameAware, BeanPostProcessor, DestructionAwareBeanPostProcessor, DisposableBean, SmartInitializingSingleton, MergedBeanDefinitionPostProcessor, ApplicationContextAware, ApplicationListener<ApplicationContextEvent>, EmbeddedValueResolverAware, Ordered, ScheduledTaskHolder

Bean post-processor that registers methods annotated with @Scheduled to be invoked by a TaskScheduler according to the "fixedRate", "fixedDelay", or "cron" expression provided via the annotation.

This post-processor is automatically registered by Spring's <task:annotation-driven> XML element and also by the @EnableScheduling annotation.

Autodetects any SchedulingConfigurer instances in the container, allowing for customization of the scheduler to be used or for fine-grained control over task registration (for example, registration of Trigger tasks). See the @EnableScheduling javadocs for complete usage details.

Since:
3.0
Author:
Mark Fisher, Juergen Hoeller, Chris Beams, Elizabeth Chatman, Victor Brown, Sam Brannen, Simon Baslé
See Also:
  • Field Details

    • DEFAULT_TASK_SCHEDULER_BEAN_NAME

      public static final String DEFAULT_TASK_SCHEDULER_BEAN_NAME
      The default name of the TaskScheduler bean to pick up: "taskScheduler".

      Note that the initial lookup happens by type; this is just the fallback in case of multiple scheduler beans found in the context.

      Since:
      4.2
      See Also:
    • logger

      protected final org.apache.commons.logging.Log logger
  • Constructor Details

    • ScheduledAnnotationBeanPostProcessor

      public ScheduledAnnotationBeanPostProcessor()
      Create a default ScheduledAnnotationBeanPostProcessor.
    • ScheduledAnnotationBeanPostProcessor

      public ScheduledAnnotationBeanPostProcessor(ScheduledTaskRegistrar registrar)
      Create a ScheduledAnnotationBeanPostProcessor delegating to the specified ScheduledTaskRegistrar.
      Parameters:
      registrar - the ScheduledTaskRegistrar to register @Scheduled tasks on
      Since:
      5.1
  • Method Details