Top Description Fields Constructors Methods
org.springframework.scheduling.annotation

public Class ScheduledAnnotationBeanPostProcessor

extends Object
implements ScheduledTaskHolder, MergedBeanDefinitionPostProcessor, DestructionAwareBeanPostProcessor, Ordered, EmbeddedValueResolverAware, BeanNameAware, BeanFactoryAware, ApplicationContextAware, SmartInitializingSingleton, DisposableBean, ApplicationListener<ApplicationContextEvent>
Class Inheritance
All Implemented Interfaces
org.springframework.context.ApplicationListener, java.util.EventListener, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.SmartInitializingSingleton, org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.context.EmbeddedValueResolverAware, org.springframework.core.Ordered, org.springframework.beans.factory.config.DestructionAwareBeanPostProcessor, org.springframework.beans.factory.config.BeanPostProcessor, org.springframework.beans.factory.support.MergedBeanDefinitionPostProcessor, org.springframework.scheduling.config.ScheduledTaskHolder
Imports
java.lang.reflect.Method, java.time.Duration, java.util.ArrayList, .Collection, .Collections, .IdentityHashMap, .LinkedHashSet, .List, .Map, .Set, java.util.concurrent.ConcurrentHashMap, .CopyOnWriteArrayList, .ScheduledExecutorService, .TimeUnit, org.apache.commons.logging.Log, .LogFactory, org.springframework.aop.framework.AopInfrastructureBean, .AopProxyUtils, org.springframework.aop.support.AopUtils, org.springframework.beans.factory.BeanFactory, .BeanFactoryAware, .BeanNameAware, .DisposableBean, .ListableBeanFactory, .SmartInitializingSingleton, org.springframework.beans.factory.config.DestructionAwareBeanPostProcessor, org.springframework.beans.factory.support.MergedBeanDefinitionPostProcessor, .RootBeanDefinition, org.springframework.context.ApplicationContext, .ApplicationContextAware, .ApplicationListener, .EmbeddedValueResolverAware, org.springframework.context.event.ApplicationContextEvent, .ContextClosedEvent, .ContextRefreshedEvent, org.springframework.core.MethodIntrospector, .Ordered, org.springframework.core.annotation.AnnotatedElementUtils, .AnnotationAwareOrderComparator, .AnnotationUtils, org.springframework.lang.Nullable, org.springframework.scheduling.TaskScheduler, .Trigger, org.springframework.scheduling.config.CronTask, .FixedDelayTask, .FixedRateTask, .OneTimeTask, .ScheduledTask, .ScheduledTaskHolder, .ScheduledTaskRegistrar, .TaskSchedulerRouter, org.springframework.scheduling.support.CronTrigger, .ScheduledMethodRunnable, org.springframework.util.Assert, .ClassUtils, .StringUtils, .StringValueResolver

Bean post-processor that registers methods annotated with @Scheduled to be invoked by a org.springframework.scheduling.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 (e.g. registration of Trigger tasks). See the @EnableScheduling javadocs for complete usage details.

Authors
Mark Fisher, Juergen Hoeller, Chris Beams, Elizabeth Chatman, Victor Brown, Sam Brannen, Simon Baslé
Since
3.0
See Also
Scheduled, EnableScheduling, SchedulingConfigurer, org.springframework.scheduling.TaskScheduler, org.springframework.scheduling.config.ScheduledTaskRegistrar, AsyncAnnotationBeanPostProcessor

Field Summary

Modifier and TypeField and Description
private ApplicationContext
private BeanFactory
private String
public static final String
DEFAULT_TASK_SCHEDULER_BEAN_NAME

The default name of the TaskScheduler bean to pick up: taskScheduler.

private StringValueResolver
private TaskSchedulerRouter
protected final Log
private final Set<Class<?>>
private static final boolean
reactiveStreamsPresent

Reactive Streams API present on the classpath?

private final Map<Object, List<Runnable>>
private final ScheduledTaskRegistrar
private final Map<Object, Set<ScheduledTask>>
private Object

Constructor Summary

AccessConstructor and Description
public
ScheduledAnnotationBeanPostProcessor()

Create a default ScheduledAnnotationBeanPostProcessor.

public
ScheduledAnnotationBeanPostProcessor(ScheduledTaskRegistrar
the ScheduledTaskRegistrar to register @Scheduled tasks on
registrar
)

Create a ScheduledAnnotationBeanPostProcessor delegating to the specified ScheduledTaskRegistrar.

Method Summary

Modifier and TypeMethod and Description
public void
afterSingletonsInstantiated()

Implements org.springframework.beans.factory.SmartInitializingSingleton.afterSingletonsInstantiated.

Invoked right at the end of the singleton pre-instantiation phase, with a guarantee that all regular singleton beans have been created already.

protected Runnable
createRunnable(Object
the target bean instance
target
,
Method
the scheduled method to call
method
,
String qualifier)

Create a Runnable for the given bean instance, calling the specified scheduled method.

protected Runnable
createRunnable(Object
the target bean instance
target
,
Method
the scheduled method to call
method
)
Deprecated since 6.1. in favor of createRunnable(Object, Method, String)

Create a Runnable for the given bean instance, calling the specified scheduled method.

public void
destroy()

Implements org.springframework.beans.factory.DisposableBean.destroy.

Invoked by the containing BeanFactory on destruction of a bean.

private void
public int
getOrder()

Implements org.springframework.core.Ordered.getOrder.

Get the order value of this object.

public Set<ScheduledTask>
getScheduledTasks()

Implements org.springframework.scheduling.config.ScheduledTaskHolder.getScheduledTasks.

Return all currently scheduled tasks, from Scheduled methods as well as from programmatic SchedulingConfigurer interaction.

private static boolean
private static boolean
isP(char ch)

public void
onApplicationEvent(ApplicationContextEvent
the event to respond to
event
)

Implements org.springframework.context.ApplicationListener.onApplicationEvent.

Reacts to ContextRefreshedEvent as well as ContextClosedEvent: performing finishRegistration() and early cancelling of scheduled tasks, respectively.

public Object
postProcessAfterInitialization(Object
the new bean instance
bean
,
String
the name of the bean
beanName
)

Overrides default org.springframework.beans.factory.config.BeanPostProcessor.postProcessAfterInitialization.

Apply this BeanPostProcessor to the given new bean instance after any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method).

public void
postProcessBeforeDestruction(Object
the bean instance to be destroyed
bean
,
String
the name of the bean
beanName
)

Implements org.springframework.beans.factory.config.DestructionAwareBeanPostProcessor.postProcessBeforeDestruction.

Apply this BeanPostProcessor to the given bean instance before its destruction, e.g. invoking custom destruction callbacks.

public Object
postProcessBeforeInitialization(Object
the new bean instance
bean
,
String
the name of the bean
beanName
)

Overrides default org.springframework.beans.factory.config.BeanPostProcessor.postProcessBeforeInitialization.

Apply this BeanPostProcessor to the given new bean instance before any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method).

public void
postProcessMergedBeanDefinition(RootBeanDefinition
the merged bean definition for the bean
beanDefinition
,
Class<?>
the actual type of the managed bean instance
beanType
,
String
the name of the bean
beanName
)

Implements org.springframework.beans.factory.support.MergedBeanDefinitionPostProcessor.postProcessMergedBeanDefinition.

Post-process the given merged bean definition for the specified bean.

protected void
processScheduled(Scheduled
the @Scheduled annotation
scheduled
,
Method
the method that the annotation has been declared on
method
,
Object
the target bean instance
bean
)

Process the given @Scheduled method declaration on the given bean, attempting to distinguish reactive methods from synchronous methods.

private void
processScheduledAsync(Scheduled
the @Scheduled annotation
scheduled
,
Method
the method that the annotation has been declared on, which must either return a Publisher-adaptable type or be a Kotlin suspending function
method
,
Object
the target bean instance
bean
)

Process the given @Scheduled bean method declaration which returns a Publisher, or the given Kotlin suspending function converted to a Publisher.

private void
processScheduledSync(Scheduled
the @Scheduled annotation
scheduled
,
Method
the method that the annotation has been declared on
method
,
Object
the target bean instance
bean
)

Process the given @Scheduled method declaration on the given bean, as a synchronous method.

private void
processScheduledTask(Scheduled
the @Scheduled annotation
scheduled
,
Runnable
the runnable to be scheduled
runnable
,
Method
the method that the annotation has been declared on
method
,
Object
the target bean instance
bean
)

Parse the Scheduled annotation and schedule the provided Runnable accordingly.

public boolean
requiresDestruction(Object
the bean instance to check
bean
)

Overrides default org.springframework.beans.factory.config.DestructionAwareBeanPostProcessor.requiresDestruction.

Determine whether the given bean instance requires destruction by this post-processor.

public void
setApplicationContext(ApplicationContext
the ApplicationContext object to be used by this object
applicationContext
)

Implements org.springframework.context.ApplicationContextAware.setApplicationContext.

Setting an ApplicationContext is optional: If set, registered tasks will be activated in the ContextRefreshedEvent phase; if not set, it will happen at afterSingletonsInstantiated time.

public void
setBeanFactory(BeanFactory
owning BeanFactory (never null). The bean can immediately call methods on the factory.
beanFactory
)

Implements org.springframework.beans.factory.BeanFactoryAware.setBeanFactory.

Making a BeanFactory available is optional; if not set, SchedulingConfigurer beans won't get autodetected and a scheduler has to be explicitly configured.

public void
setBeanName(String
the name of the bean in the factory. Note that this name is the actual bean name used in the factory, which may differ from the originally specified name: in particular for inner bean names, the actual bean name might have been made unique through appending "#..." suffixes. Use the BeanFactoryUtils#originalBeanName(String) method to extract the original bean name (without suffix), if desired.
beanName
)

Implements org.springframework.beans.factory.BeanNameAware.setBeanName.

Set the name of the bean in the bean factory that created this bean.

public void
setEmbeddedValueResolver(StringValueResolver resolver)

Implements org.springframework.context.EmbeddedValueResolverAware.setEmbeddedValueResolver.

Set the StringValueResolver to use for resolving embedded definition values.

public void
setScheduler(Object scheduler)

Set the org.springframework.scheduling.TaskScheduler that will invoke the scheduled methods, or a java.util.concurrent.ScheduledExecutorService to be wrapped as a TaskScheduler.

private static Duration
toDuration(long value, TimeUnit timeUnit)

private static Duration
toDuration(String value, TimeUnit timeUnit)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

applicationContextback to summary
private ApplicationContext applicationContext
Annotations
@Nullable
beanFactoryback to summary
private BeanFactory beanFactory
Annotations
@Nullable
beanNameback to summary
private String beanName
Annotations
@Nullable
DEFAULT_TASK_SCHEDULER_BEAN_NAMEback to summary
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
embeddedValueResolverback to summary
private StringValueResolver embeddedValueResolver
Annotations
@Nullable
localSchedulerback to summary
private TaskSchedulerRouter localScheduler
Annotations
@Nullable
loggerback to summary
protected final Log logger
nonAnnotatedClassesback to summary
private final Set<Class<?>> nonAnnotatedClasses
reactiveStreamsPresentback to summary
private static final boolean reactiveStreamsPresent

Reactive Streams API present on the classpath?

reactiveSubscriptionsback to summary
private final Map<Object, List<Runnable>> reactiveSubscriptions
registrarback to summary
private final ScheduledTaskRegistrar registrar
scheduledTasksback to summary
private final Map<Object, Set<ScheduledTask>> scheduledTasks
schedulerback to summary
private Object scheduler
Annotations
@Nullable

Constructor Detail

ScheduledAnnotationBeanPostProcessorback to summary
public ScheduledAnnotationBeanPostProcessor()

Create a default ScheduledAnnotationBeanPostProcessor.

ScheduledAnnotationBeanPostProcessorback to summary
public ScheduledAnnotationBeanPostProcessor(ScheduledTaskRegistrar registrar)

Create a ScheduledAnnotationBeanPostProcessor delegating to the specified ScheduledTaskRegistrar.

Parameters
registrar:ScheduledTaskRegistrar

the ScheduledTaskRegistrar to register @Scheduled tasks on

Since
5.1

Method Detail

afterSingletonsInstantiatedback to summary
public void afterSingletonsInstantiated()

Implements org.springframework.beans.factory.SmartInitializingSingleton.afterSingletonsInstantiated.

Doc from org.springframework.beans.factory.SmartInitializingSingleton.afterSingletonsInstantiated.

Invoked right at the end of the singleton pre-instantiation phase, with a guarantee that all regular singleton beans have been created already. ListableBeanFactory#getBeansOfType 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 BeanFactory bootstrap, and not for any other bean scope either. Carefully use it for beans with the intended bootstrap semantics only.

Annotations
@Override
createRunnableback to summary
protected Runnable createRunnable(Object target, Method method, String qualifier)

Create a Runnable for the given bean instance, calling the specified scheduled method.

The default implementation creates a ScheduledMethodRunnable.

Parameters
target:Object

the target bean instance

method:Method

the scheduled method to call

Annotations
@SuppressWarnings:deprecation
Since
6.1
createRunnableback to summary
protected Runnable createRunnable(Object target, Method method)

Deprecated

since 6.1.

in favor of createRunnable(Object, Method, String)

Create a Runnable for the given bean instance, calling the specified scheduled method.

Parameters
target:Object

the target bean instance

method:Method

the scheduled method to call

Annotations
@Deprecated
since:6.1
@Nullable
Since
5.1
destroyback to summary
public void destroy()

Implements org.springframework.beans.factory.DisposableBean.destroy.

Doc from org.springframework.beans.factory.DisposableBean.destroy.

Invoked by the containing BeanFactory on destruction of a bean.

Annotations
@Override
finishRegistrationback to summary
private void finishRegistration()
getOrderback to summary
public int getOrder()

Implements org.springframework.core.Ordered.getOrder.

Doc from org.springframework.core.Ordered.getOrder.

Get the order value of this object.

Higher values are interpreted as lower priority. As a consequence, the object with the lowest value has the highest priority (somewhat analogous to Servlet load-on-startup values).

Same order values will result in arbitrary sort positions for the affected objects.

Returns:int

the order value

Annotations
@Override
getScheduledTasksback to summary
public Set<ScheduledTask> getScheduledTasks()

Implements org.springframework.scheduling.config.ScheduledTaskHolder.getScheduledTasks.

Return all currently scheduled tasks, from Scheduled methods as well as from programmatic SchedulingConfigurer interaction.

Note that this includes upcoming scheduled subscriptions for reactive methods but doesn't cover any currently active subscription for such methods.

Annotations
@Override
Since
5.0.2
isDurationStringback to summary
private static boolean isDurationString(String value)
isPback to summary
private static boolean isP(char ch)
onApplicationEventback to summary
public void onApplicationEvent(ApplicationContextEvent event)

Implements org.springframework.context.ApplicationListener.onApplicationEvent.

Reacts to ContextRefreshedEvent as well as ContextClosedEvent: performing finishRegistration() and early cancelling of scheduled tasks, respectively.

Parameters
event:ApplicationContextEvent

Doc from org.springframework.context.ApplicationListener.onApplicationEvent.

the event to respond to

Annotations
@Override
postProcessAfterInitializationback to summary
public Object postProcessAfterInitialization(Object bean, String beanName)

Overrides default org.springframework.beans.factory.config.BeanPostProcessor.postProcessAfterInitialization.

Doc from org.springframework.beans.factory.config.BeanPostProcessor.postProcessAfterInitialization.

Apply this BeanPostProcessor to the given new bean instance after any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method). The bean will already be populated with property values. The returned bean instance may be a wrapper around the original.

In case of a FactoryBean, this callback will be invoked for both the FactoryBean instance and the objects created by the FactoryBean (as of Spring 2.0). The post-processor can decide whether to apply to either the FactoryBean or created objects or both through corresponding bean instanceof FactoryBean checks.

This callback will also be invoked after a short-circuiting triggered by a InstantiationAwareBeanPostProcessor#postProcessBeforeInstantiation method, in contrast to all other BeanPostProcessor callbacks.

The default implementation returns the given bean as-is.

Parameters
bean:Object

the new bean instance

beanName:String

the name of the bean

Returns:Object

the bean instance to use, either the original or a wrapped one; if null, no subsequent BeanPostProcessors will be invoked

Annotations
@Override
postProcessBeforeDestructionback to summary
public void postProcessBeforeDestruction(Object bean, String beanName)

Implements org.springframework.beans.factory.config.DestructionAwareBeanPostProcessor.postProcessBeforeDestruction.

Doc from org.springframework.beans.factory.config.DestructionAwareBeanPostProcessor.postProcessBeforeDestruction.

Apply this BeanPostProcessor to the given bean instance before its destruction, e.g. invoking custom destruction callbacks.

Like DisposableBean's destroy and a custom destroy method, this callback will only apply to beans which the container fully manages the lifecycle for. This is usually the case for singletons and scoped beans.

Parameters
bean:Object

the bean instance to be destroyed

beanName:String

the name of the bean

Annotations
@Override
postProcessBeforeInitializationback to summary
public Object postProcessBeforeInitialization(Object bean, String beanName)

Overrides default org.springframework.beans.factory.config.BeanPostProcessor.postProcessBeforeInitialization.

Doc from org.springframework.beans.factory.config.BeanPostProcessor.postProcessBeforeInitialization.

Apply this BeanPostProcessor to the given new bean instance before any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method). The bean will already be populated with property values. The returned bean instance may be a wrapper around the original.

The default implementation returns the given bean as-is.

Parameters
bean:Object

the new bean instance

beanName:String

the name of the bean

Returns:Object

the bean instance to use, either the original or a wrapped one; if null, no subsequent BeanPostProcessors will be invoked

Annotations
@Override
postProcessMergedBeanDefinitionback to summary
public void postProcessMergedBeanDefinition(RootBeanDefinition beanDefinition, Class<?> beanType, String beanName)

Implements org.springframework.beans.factory.support.MergedBeanDefinitionPostProcessor.postProcessMergedBeanDefinition.

Doc from org.springframework.beans.factory.support.MergedBeanDefinitionPostProcessor.postProcessMergedBeanDefinition.

Post-process the given merged bean definition for the specified bean.

Parameters
beanDefinition:RootBeanDefinition

the merged bean definition for the bean

beanType:Class<?>

the actual type of the managed bean instance

beanName:String

the name of the bean

Annotations
@Override
processScheduledback to summary
protected void processScheduled(Scheduled scheduled, Method method, Object bean)

Process the given @Scheduled method declaration on the given bean, attempting to distinguish reactive methods from synchronous methods.

Parameters
scheduled:Scheduled

the @Scheduled annotation

method:Method

the method that the annotation has been declared on

bean:Object

the target bean instance

See Also
processScheduledSync(Scheduled, Method, Object), processScheduledAsync(Scheduled, Method, Object)
processScheduledAsyncback to summary
private void processScheduledAsync(Scheduled scheduled, Method method, Object bean)

Process the given @Scheduled bean method declaration which returns a Publisher, or the given Kotlin suspending function converted to a Publisher. A Runnable which subscribes to that publisher is then repeatedly scheduled according to the annotation configuration.

Note that for fixed delay configuration, the subscription is turned into a blocking call instead. Types for which a ReactiveAdapter is registered but which cannot be deferred (i.e. not a Publisher) are not supported.

Parameters
scheduled:Scheduled

the @Scheduled annotation

method:Method

the method that the annotation has been declared on, which must either return a Publisher-adaptable type or be a Kotlin suspending function

bean:Object

the target bean instance

See Also
ScheduledAnnotationReactiveSupport
processScheduledSyncback to summary
private void processScheduledSync(Scheduled scheduled, Method method, Object bean)

Process the given @Scheduled method declaration on the given bean, as a synchronous method. The method must accept no arguments. Its return value is ignored (if any), and the scheduled invocations of the method take place using the underlying TaskScheduler infrastructure.

Parameters
scheduled:Scheduled

the @Scheduled annotation

method:Method

the method that the annotation has been declared on

bean:Object

the target bean instance

processScheduledTaskback to summary
private void processScheduledTask(Scheduled scheduled, Runnable runnable, Method method, Object bean)

Parse the Scheduled annotation and schedule the provided Runnable accordingly. The Runnable can represent either a synchronous method invocation (see processScheduledSync(Scheduled, Method, Object)) or an asynchronous one (see processScheduledAsync(Scheduled, Method, Object)).

Parameters
scheduled:Scheduled

the @Scheduled annotation

runnable:Runnable

the runnable to be scheduled

method:Method

the method that the annotation has been declared on

bean:Object

the target bean instance

requiresDestructionback to summary
public boolean requiresDestruction(Object bean)

Overrides default org.springframework.beans.factory.config.DestructionAwareBeanPostProcessor.requiresDestruction.

Doc from org.springframework.beans.factory.config.DestructionAwareBeanPostProcessor.requiresDestruction.

Determine whether the given bean instance requires destruction by this post-processor.

The default implementation returns true. If a pre-5 implementation of DestructionAwareBeanPostProcessor does not provide a concrete implementation of this method, Spring silently assumes true as well.

Parameters
bean:Object

the bean instance to check

Returns:boolean

true if postProcessBeforeDestruction is supposed to be called for this bean instance eventually, or false if not needed

Annotations
@Override
setApplicationContextback to summary
public void setApplicationContext(ApplicationContext applicationContext)

Implements org.springframework.context.ApplicationContextAware.setApplicationContext.

Setting an ApplicationContext is optional: If set, registered tasks will be activated in the ContextRefreshedEvent phase; if not set, it will happen at afterSingletonsInstantiated time.

Parameters
applicationContext:ApplicationContext

Doc from org.springframework.context.ApplicationContextAware.setApplicationContext.

the ApplicationContext object to be used by this object

Annotations
@Override
setBeanFactoryback to summary
public void setBeanFactory(BeanFactory beanFactory)

Implements org.springframework.beans.factory.BeanFactoryAware.setBeanFactory.

Making a BeanFactory available is optional; if not set, SchedulingConfigurer beans won't get autodetected and a scheduler has to be explicitly configured.

Parameters
beanFactory:BeanFactory

Doc from org.springframework.beans.factory.BeanFactoryAware.setBeanFactory.

owning BeanFactory (never null). The bean can immediately call methods on the factory.

Annotations
@Override
setBeanNameback to summary
public void setBeanName(String beanName)

Implements org.springframework.beans.factory.BeanNameAware.setBeanName.

Doc from org.springframework.beans.factory.BeanNameAware.setBeanName.

Set the name of the bean in the bean factory that created this bean.

Invoked after population of normal bean properties but before an init callback such as InitializingBean#afterPropertiesSet() or a custom init-method.

Parameters
beanName:String

the name of the bean in the factory. Note that this name is the actual bean name used in the factory, which may differ from the originally specified name: in particular for inner bean names, the actual bean name might have been made unique through appending "#..." suffixes. Use the BeanFactoryUtils#originalBeanName(String) method to extract the original bean name (without suffix), if desired.

Annotations
@Override
setEmbeddedValueResolverback to summary
public void setEmbeddedValueResolver(StringValueResolver resolver)

Implements org.springframework.context.EmbeddedValueResolverAware.setEmbeddedValueResolver.

Doc from org.springframework.context.EmbeddedValueResolverAware.setEmbeddedValueResolver.

Set the StringValueResolver to use for resolving embedded definition values.

Annotations
@Override
setSchedulerback to summary
public void setScheduler(Object scheduler)

Set the org.springframework.scheduling.TaskScheduler that will invoke the scheduled methods, or a java.util.concurrent.ScheduledExecutorService to be wrapped as a TaskScheduler.

If not specified, default scheduler resolution will apply: searching for a unique TaskScheduler bean in the context, or for a TaskScheduler bean named "taskScheduler" otherwise; the same lookup will also be performed for a ScheduledExecutorService bean. If neither of the two is resolvable, a local single-threaded default scheduler will be created within the registrar.

See Also
DEFAULT_TASK_SCHEDULER_BEAN_NAME
toDurationback to summary
private static Duration toDuration(long value, TimeUnit timeUnit)
toDurationback to summary
private static Duration toDuration(String value, TimeUnit timeUnit)