spring-framework / org.springframework.scheduling.support

Package org.springframework.scheduling.support

Types

CronSequenceGenerator

open class CronSequenceGenerator

Date sequence generator for a Crontab pattern, allowing clients to specify a pattern that the sequence matches.

The pattern is a list of six single space-separated fields: representing second, minute, hour, day, month, weekday. Month and weekday names can be given as the first three letters of the English names.

Example patterns:

  • "0 0 * * * *" = the top of every hour of every day.
  • "*/10 * * * * *" = every ten seconds.
  • "0 0 8-10 * * *" = 8, 9 and 10 o'clock of every day.
  • "0 0 6,19 * * *" = 6:00 AM and 7:00 PM every day.
  • "0 0/30 8-10 * * *" = 8:00, 8:30, 9:00, 9:30, 10:00 and 10:30 every day.
  • "0 0 9-17 * * MON-FRI" = on the hour nine-to-five weekdays
  • "0 0 0 25 12 ?" = every Christmas Day at midnight

MethodInvokingRunnable

open class MethodInvokingRunnable : ArgumentConvertingMethodInvoker, Runnable, BeanClassLoaderAware, InitializingBean

Adapter that implements the Runnable interface as a configurable method invocation based on Spring's MethodInvoker.

Inherits common configuration properties from org.springframework.util.MethodInvoker.

PeriodicTrigger

open class PeriodicTrigger : Trigger

A trigger for periodic task execution. The period may be applied as either fixed-rate or fixed-delay, and an initial delay value may also be configured. The default initial delay is 0, and the default behavior is fixed-delay (i.e. the interval between successive executions is measured from each completion time). To measure the interval between the scheduled start time of each execution instead, set the 'fixedRate' property to true.

Note that the TaskScheduler interface already defines methods for scheduling tasks at fixed-rate or with fixed-delay. Both also support an optional value for the initial delay. Those methods should be used directly whenever possible. The value of this Trigger implementation is that it can be used within components that rely on the Trigger abstraction. For example, it may be convenient to allow periodic triggers, cron-based triggers, and even custom Trigger implementations to be used interchangeably.

ScheduledMethodRunnable

open class ScheduledMethodRunnable : Runnable

Variant of MethodInvokingRunnable meant to be used for processing of no-arg scheduled methods. Propagates user exceptions to the caller, assuming that an error strategy for Runnables is in place.

SimpleTriggerContext

open class SimpleTriggerContext : TriggerContext

Simple data holder implementation of the TriggerContext interface.

TaskUtils

abstract class TaskUtils

Utility methods for decorating tasks with error handling.

NOTE: This class is intended for internal use by Spring's scheduler implementations. It is only public so that it may be accessed from impl classes within other packages. It is not intended for general use.