Class KernelSchedulingConfiguration

java.lang.Object
io.meeds.spring.kernel.KernelSchedulingConfiguration
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.DisposableBean, org.springframework.scheduling.annotation.SchedulingConfigurer

@Configuration public class KernelSchedulingConfiguration extends Object implements org.springframework.scheduling.annotation.SchedulingConfigurer, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.DisposableBean
Routes a scheduled method that names ClusterTaskScheduler.NAME to the ClusterTaskScheduler, which runs it once per cluster. Every other scheduled method runs as Spring routes it, on each node: on the scheduler Spring Boot builds for the context (spring.task.scheduling.*), never on the kernel's job scheduler.

The cluster scheduler is not a bean: Spring Boot builds its own scheduler, and its own task executor, only when the context holds no bean of their kind, so a scheduler bean declared here would take them from every context.

  • Constructor Details

    • KernelSchedulingConfiguration

      public KernelSchedulingConfiguration()
  • Method Details

    • setBeanFactory

      public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
      Specified by:
      setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAware
    • configureTasks

      public void configureTasks(org.springframework.scheduling.config.ScheduledTaskRegistrar registrar)
      Specified by:
      configureTasks in interface org.springframework.scheduling.annotation.SchedulingConfigurer
    • destroy

      public void destroy()
      Specified by:
      destroy in interface org.springframework.beans.factory.DisposableBean