Package io.meeds.spring.kernel
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigureTasks(org.springframework.scheduling.config.ScheduledTaskRegistrar registrar) voiddestroy()voidsetBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
-
Constructor Details
-
KernelSchedulingConfiguration
public KernelSchedulingConfiguration()
-
-
Method Details
-
setBeanFactory
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) - Specified by:
setBeanFactoryin interfaceorg.springframework.beans.factory.BeanFactoryAware
-
configureTasks
public void configureTasks(org.springframework.scheduling.config.ScheduledTaskRegistrar registrar) - Specified by:
configureTasksin interfaceorg.springframework.scheduling.annotation.SchedulingConfigurer
-
destroy
public void destroy()- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean
-