- java.lang.Object
-
- io.helidon.scheduling.Scheduling.CronBuilder
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Task
build()
Build the instance from this builder.Scheduling.CronBuilder
concurrentExecution(boolean allowConcurrentExecution)
Allow concurrent execution if previous task didn't finish before next execution.Scheduling.CronBuilder
executor(ScheduledExecutorService executorService)
CustomScheduledExecutorService
used for executing scheduled task.Scheduling.CronBuilder
expression(String cronExpression)
Cron expression for specifying period of execution.Scheduling.CronBuilder
task(ScheduledConsumer<CronInvocation> task)
Task to be scheduled for execution.
-
-
-
Method Detail
-
executor
public Scheduling.CronBuilder executor(ScheduledExecutorService executorService)
CustomScheduledExecutorService
used for executing scheduled task.- Parameters:
executorService
- custom ScheduledExecutorService- Returns:
- this builder
-
expression
public Scheduling.CronBuilder expression(String cronExpression)
Cron expression for specifying period of execution.Examples:
0/2 * * * * ? *
- Every 2 seconds0 45 9 ? * *
- Every day at 9:450 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 istrue
.- Parameters:
allowConcurrentExecution
- true for allow concurrent execution.- Returns:
- this builder
-
task
public Scheduling.CronBuilder task(ScheduledConsumer<CronInvocation> task)
Task to be scheduled for execution.- Parameters:
task
- scheduled for execution- Returns:
- this builder
-
-