Module io.helidon.scheduling
Package io.helidon.scheduling
Class CronConfig.BuilderBase<BUILDER extends CronConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends CronConfig>
java.lang.Object
io.helidon.scheduling.TaskConfig.BuilderBase<BUILDER,PROTOTYPE>
io.helidon.scheduling.CronConfig.BuilderBase<BUILDER,PROTOTYPE>
- Type Parameters:
BUILDER- type of the builder extending this abstract builderPROTOTYPE- type of the prototype interface that would be built byPrototype.Builder.buildPrototype()
- All Implemented Interfaces:
Prototype.Builder<BUILDER,,PROTOTYPE> ConfigBuilderSupport.ConfiguredBuilder<BUILDER,,PROTOTYPE> ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>
- Direct Known Subclasses:
CronConfig.Builder
- Enclosing interface:
CronConfig
public abstract static class CronConfig.BuilderBase<BUILDER extends CronConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends CronConfig>
extends TaskConfig.BuilderBase<BUILDER,PROTOTYPE>
implements ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>
Fluent API builder base for
CronConfig.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classGenerated implementation of the prototype, can be extended by descendant prototype implementations.Nested classes/interfaces inherited from class io.helidon.scheduling.TaskConfig.BuilderBase
TaskConfig.BuilderBase.TaskConfigImpl -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanAllow concurrent execution if previous task didn't finish before next execution.concurrentExecution(boolean concurrentExecution) Allow concurrent execution if previous task didn't finish before next execution.Deprecated.Update builder from configuration (node of this type).Cron expression for specifying period of execution.expression(String expression) Cron expression for specifying period of execution.from(CronConfig prototype) Update this builder from an existing prototype instance.from(CronConfig.BuilderBase<?, ?> builder) Update this builder from an existing prototype builder instance.protected voidHandles providers and decorators.Service registry used to discover providers and services.serviceRegistry(ServiceRegistry serviceRegistry) Service registry used to discover providers and services.task()Task to be scheduled for execution.task(ScheduledConsumer<CronInvocation> task) Task to be scheduled for execution.booleanService discovery flag forTaskConfig.BuilderBase.taskManager().taskManagerDiscoverServices(boolean taskManagerDiscoverServices) Service discovery flag forTaskConfig.BuilderBase.taskManager().toString()protected voidValidates required properties.zone()Time zone to use for cron expression evaluation.Time zone to use for cron expression evaluation.Methods inherited from class io.helidon.scheduling.TaskConfig.BuilderBase
clearId, config, enabled, enabled, executor, executor, from, from, id, id, taskManager, taskManagerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.helidon.builder.api.Prototype.Builder
buildPrototype, self
-
Constructor Details
-
BuilderBase
protected BuilderBase()Protected to support extensibility.
-
-
Method Details
-
from
Update this builder from an existing prototype instance. This method disables automatic service discovery.- Parameters:
prototype- existing prototype to update this builder from- Returns:
- updated builder instance
-
from
Update this builder from an existing prototype builder instance.- Parameters:
builder- existing builder prototype to update this builder from- Returns:
- updated builder instance
-
config
Deprecated.Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.- Specified by:
configin interfaceConfigBuilderSupport.ConfiguredBuilder<BUILDER extends CronConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends CronConfig> - Overrides:
configin classTaskConfig.BuilderBase<BUILDER extends CronConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends CronConfig> - Parameters:
config- configuration instance used to obtain values to update this builder- Returns:
- updated builder instance
-
config
Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.- Specified by:
configin interfaceConfigBuilderSupport.ConfiguredBuilder<BUILDER extends CronConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends CronConfig> - Overrides:
configin classTaskConfig.BuilderBase<BUILDER extends CronConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends CronConfig> - Parameters:
config- configuration instance used to obtain values to update this builder- Returns:
- updated builder instance
-
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:
expression- cron expression- Returns:
- updated builder instance
- See Also:
-
zone
Time zone to use for cron expression evaluation. Defaults toZoneId.systemDefault().The time zone determines when the cron expression triggers. For example, a cron expression
0 0 9 * * ?(every day at 9:00 AM) with zoneAmerica/New_Yorkwill trigger at 9:00 AM Eastern Time, regardless of the system's default time zone.- Parameters:
zone- time zone for cron expression evaluation- Returns:
- updated builder instance
- See Also:
-
concurrentExecution
Allow concurrent execution if previous task didn't finish before next execution. Default value istrue.- Parameters:
concurrentExecution- true for allow concurrent execution.- Returns:
- updated builder instance
- See Also:
-
task
Task to be scheduled for execution.- Parameters:
task- scheduled for execution- Returns:
- updated builder instance
- See Also:
-
taskManagerDiscoverServices
Service discovery flag forTaskConfig.BuilderBase.taskManager(). If set totrue, services will be discovered from Java service loader, or Helidon ServiceRegistry.- Overrides:
taskManagerDiscoverServicesin classTaskConfig.BuilderBase<BUILDER extends CronConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends CronConfig> - Parameters:
taskManagerDiscoverServices- whether to enable automatic service discovery- Returns:
- updated builder instance
- See Also:
-
serviceRegistry
Service registry used to discover providers and services. Provide an explicit registry instance to use.If not configured, the
GlobalServiceRegistrywould be used to discover services.- Overrides:
serviceRegistryin classTaskConfig.BuilderBase<BUILDER extends CronConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends CronConfig> - Parameters:
serviceRegistry- service registry to use- Returns:
- updated builder instance
- See Also:
-
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
- Returns:
- cron expression
-
zone
Time zone to use for cron expression evaluation. Defaults toZoneId.systemDefault().The time zone determines when the cron expression triggers. For example, a cron expression
0 0 9 * * ?(every day at 9:00 AM) with zoneAmerica/New_Yorkwill trigger at 9:00 AM Eastern Time, regardless of the system's default time zone.- Returns:
- time zone for cron expression evaluation
-
concurrentExecution
public boolean concurrentExecution()Allow concurrent execution if previous task didn't finish before next execution. Default value istrue.- Returns:
- true for allow concurrent execution.
-
task
Task to be scheduled for execution.- Returns:
- scheduled for execution
-
taskManagerDiscoverServices
public boolean taskManagerDiscoverServices()Service discovery flag forTaskConfig.BuilderBase.taskManager(). If set totrue, services will be discovered from Java service loader, or Helidon ServiceRegistry.- Overrides:
taskManagerDiscoverServicesin classTaskConfig.BuilderBase<BUILDER extends CronConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends CronConfig> - Returns:
- whether to enable automatic service discovery
-
serviceRegistry
Service registry used to discover providers and services. Provide an explicit registry instance to use.If not configured, the
GlobalServiceRegistrywould be used to discover services.- Overrides:
serviceRegistryin classTaskConfig.BuilderBase<BUILDER extends CronConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends CronConfig> - Returns:
- service registry to use
-
toString
- Overrides:
toStringin classTaskConfig.BuilderBase<BUILDER extends CronConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends CronConfig>
-
preBuildPrototype
protected void preBuildPrototype()Handles providers and decorators.- Overrides:
preBuildPrototypein classTaskConfig.BuilderBase<BUILDER extends CronConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends CronConfig>
-
validatePrototype
protected void validatePrototype()Validates required properties.- Overrides:
validatePrototypein classTaskConfig.BuilderBase<BUILDER extends CronConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends CronConfig>
-
config(io.helidon.config.Config)