Class AsyncConfig.BuilderBase<BUILDER extends AsyncConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends AsyncConfig>

java.lang.Object
io.helidon.faulttolerance.AsyncConfig.BuilderBase<BUILDER,PROTOTYPE>
Type Parameters:
BUILDER - type of the builder extending this abstract builder
PROTOTYPE - type of the prototype interface that would be built by Prototype.Builder.buildPrototype()
All Implemented Interfaces:
Prototype.Builder<BUILDER,PROTOTYPE>, Prototype.ConfiguredBuilder<BUILDER,PROTOTYPE>
Direct Known Subclasses:
AsyncConfig.Builder
Enclosing interface:
AsyncConfig

public abstract static class AsyncConfig.BuilderBase<BUILDER extends AsyncConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends AsyncConfig> extends Object implements Prototype.ConfiguredBuilder<BUILDER,PROTOTYPE>
Fluent API builder base for Async.
  • Constructor Details

    • BuilderBase

      protected BuilderBase()
      Protected to support extensibility.
  • Method Details

    • from

      public BUILDER from(AsyncConfig prototype)
      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

      public BUILDER from(AsyncConfig.BuilderBase<?,?> builder)
      Update this builder from an existing prototype builder instance.
      Parameters:
      builder - existing builder prototype to update this builder from
      Returns:
      updated builder instance
    • config

      public BUILDER config(Config config)
      Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.
      Specified by:
      config in interface Prototype.ConfiguredBuilder<BUILDER extends AsyncConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends AsyncConfig>
      Parameters:
      config - configuration instance used to obtain values to update this builder
      Returns:
      updated builder instance
    • clearName

      public BUILDER clearName()
      Clear existing value of this property.
      Returns:
      updated builder instance
      See Also:
    • name

      public BUILDER name(String name)
      Name for debugging, error reporting, monitoring.
      Parameters:
      name - name of this async
      Returns:
      updated builder instance
      See Also:
    • clearExecutorName

      public BUILDER clearExecutorName()
      Clear existing value of this property.
      Returns:
      updated builder instance
      See Also:
    • executorName

      public BUILDER executorName(String executorName)
      Name of an executor service. This is only honored when service registry is used.
      Parameters:
      executorName - name fo the ExecutorService to lookup
      Returns:
      updated builder instance
      See Also:
    • clearExecutor

      public BUILDER clearExecutor()
      Clear existing value of this property.
      Returns:
      updated builder instance
      See Also:
    • executor

      public BUILDER executor(ExecutorService executor)
      Executor service. Will be used to run the asynchronous tasks.
      Parameters:
      executor - explicit executor service
      Returns:
      updated builder instance
      See Also:
    • clearOnStart

      public BUILDER clearOnStart()
      Clear existing value of this property.
      Returns:
      updated builder instance
      See Also:
    • onStart

      public BUILDER onStart(CompletableFuture<Async> onStart)
      A future that is completed when execution of the asynchronous task starts.
      Parameters:
      onStart - future that will be completed by the asynchronous processing
      Returns:
      updated builder instance
      See Also:
    • name

      public Optional<String> name()
      Name for debugging, error reporting, monitoring.
      Returns:
      the name
    • executorName

      public Optional<String> executorName()
      Name of an executor service. This is only honored when service registry is used.
      Returns:
      the executor name
      See Also:
    • executor

      public Optional<ExecutorService> executor()
      Executor service. Will be used to run the asynchronous tasks.
      Returns:
      the executor
    • onStart

      public Optional<CompletableFuture<Async>> onStart()
      A future that is completed when execution of the asynchronous task starts.
      Returns:
      the on start
    • config

      public Optional<Config> config()
      If this instance was configured, this would be the config instance used.
      Returns:
      config node used to configure this builder, or empty if not configured
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • preBuildPrototype

      protected void preBuildPrototype()
      Handles providers and decorators.
    • validatePrototype

      protected void validatePrototype()
      Validates required properties.