Class Scheduling.CronBuilder

  • All Implemented Interfaces:
    Builder<Task>, Supplier<Task>
    Enclosing class:
    Scheduling

    public static final class Scheduling.CronBuilder
    extends Object
    implements Builder<Task>
    Builder for task executed periodically according to provided cron expression.
    • Method Detail

      • expression

        public Scheduling.CronBuilder expression​(String cronExpression)
        Cron expression for specifying period of execution.

        Examples:

        • 0/2 * * * * ? * - Every 2 seconds
        • 0 45 9 ? * * - Every day at 9:45
        • 0 15 8 ? * MON-FRI - Every workday at 8:15
        Parameters:
        cronExpression - cron expression
        Returns:
        this builder
      • concurrentExecution

        public Scheduling.CronBuilder concurrentExecution​(boolean allowConcurrentExecution)
        Allow concurrent execution if previous task didn't finish before next execution. Default value is true.
        Parameters:
        allowConcurrentExecution - true for allow concurrent execution.
        Returns:
        this builder
      • build

        public Task build()
        Description copied from interface: Builder
        Build the instance from this builder.
        Specified by:
        build in interface Builder<Task>
        Returns:
        instance of the built type