java.lang.Object
io.helidon.scheduling.Scheduling.CronBuilder
- All Implemented Interfaces:
io.helidon.common.Builder<Scheduling.CronBuilder,,Task> Supplier<Task>
- Enclosing class:
- Scheduling
public static final class Scheduling.CronBuilder
extends Object
implements io.helidon.common.Builder<Scheduling.CronBuilder,Task>
Builder for task executed periodically according to provided cron expression.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()concurrentExecution(boolean allowConcurrentExecution) Allow concurrent execution if previous task didn't finish before next execution.executor(ScheduledExecutorService executorService) CustomScheduledExecutorServiceused for executing scheduled task.expression(String cronExpression) Cron expression for specifying period of execution.task(ScheduledConsumer<CronInvocation> task) Task to be scheduled for execution.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.helidon.common.Builder
get, identity, update
-
Method Details
-
executor
CustomScheduledExecutorServiceused for executing scheduled task.- Parameters:
executorService- custom ScheduledExecutorService- Returns:
- this builder
-
expression
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
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
Task to be scheduled for execution.- Parameters:
task- scheduled for execution- Returns:
- this builder
-
build
- Specified by:
buildin interfaceio.helidon.common.Builder<Scheduling.CronBuilder,Task>
-