Interface Prototype.ConfiguredBuilder<BUILDER,PROTOTYPE>

Type Parameters:
BUILDER - type of the builder
PROTOTYPE - type of the prototype to be built
All Superinterfaces:
Prototype.Builder<BUILDER,PROTOTYPE>
All Known Implementing Classes:
AccessLogConfig.Builder, AccessLogConfig.BuilderBase, AllowListConfig.Builder, AllowListConfig.BuilderBase, AsyncConfig.Builder, AsyncConfig.BuilderBase, BulkheadConfig.Builder, BulkheadConfig.BuilderBase, CircuitBreakerConfig.Builder, CircuitBreakerConfig.BuilderBase, ConfigObserverConfig.Builder, ConfigObserverConfig.BuilderBase, ConnectionConfig.Builder, ConnectionConfig.BuilderBase, ContentEncodingContextConfig.Builder, ContentEncodingContextConfig.BuilderBase, ContextFeatureConfig.Builder, ContextFeatureConfig.BuilderBase, CorsConfig.Builder, CorsConfig.BuilderBase, CronConfig.Builder, CronConfig.BuilderBase, FixedRateConfig.Builder, FixedRateConfig.BuilderBase, GrpcConfig.Builder, GrpcConfig.BuilderBase, HealthObserverConfig.Builder, HealthObserverConfig.BuilderBase, Http1ClientConfig.Builder, Http1ClientConfig.BuilderBase, Http1ClientProtocolConfig.Builder, Http1ClientProtocolConfig.BuilderBase, Http1Config.Builder, Http1Config.BuilderBase, Http2ClientConfig.Builder, Http2ClientConfig.BuilderBase, Http2ClientProtocolConfig.Builder, Http2ClientProtocolConfig.BuilderBase, Http2Config.Builder, Http2Config.BuilderBase, HttpClientConfig.Builder, HttpClientConfig.BuilderBase, HttpConfigBase.Builder, HttpConfigBase.BuilderBase, InfoObserverConfig.Builder, InfoObserverConfig.BuilderBase, JdbcParametersConfig.Builder, JdbcParametersConfig.BuilderBase, KeyPerformanceIndicatorMetricsConfig.Builder, KeyPerformanceIndicatorMetricsConfig.BuilderBase, Keys.Builder, Keys.BuilderBase, KeystoreKeys.Builder, KeystoreKeys.BuilderBase, ListenerConfig.Builder, ListenerConfig.BuilderBase, LogObserverConfig.Builder, LogObserverConfig.BuilderBase, LogStreamConfig.Builder, LogStreamConfig.BuilderBase, LruCacheConfig.Builder, LruCacheConfig.BuilderBase, MediaContextConfig.Builder, MediaContextConfig.BuilderBase, MetricsConfig.Builder, MetricsConfig.BuilderBase, MetricsObserverConfig.Builder, MetricsObserverConfig.BuilderBase, MpOpenApiManagerConfig.Builder, MpOpenApiManagerConfig.BuilderBase, ObserveFeatureConfig.Builder, ObserveFeatureConfig.BuilderBase, ObserverConfigBase.Builder, ObserverConfigBase.BuilderBase, OciCertificatesTlsManagerConfig.Builder, OciCertificatesTlsManagerConfig.BuilderBase, OciConfig.Builder, OciConfig.BuilderBase, OpenApiFeatureConfig.Builder, OpenApiFeatureConfig.BuilderBase, OpenApiUiConfig.Builder, OpenApiUiConfig.BuilderBase, PathsConfig.Builder, PathsConfig.BuilderBase, PemKeys.Builder, PemKeys.BuilderBase, ResourceConfig.Builder, ResourceConfig.BuilderBase, RetryConfig.Builder, RetryConfig.BuilderBase, ScheduledThreadPoolConfig.Builder, ScheduledThreadPoolConfig.BuilderBase, ScopeConfig.Builder, ScopeConfig.BuilderBase, ScopingConfig.Builder, ScopingConfig.BuilderBase, SecurityFeatureConfig.Builder, SecurityFeatureConfig.BuilderBase, SecurityHandlerConfig.Builder, SecurityHandlerConfig.BuilderBase, SocketOptions.Builder, SocketOptions.BuilderBase, TaskConfig.Builder, TaskConfig.BuilderBase, ThreadPoolConfig.Builder, ThreadPoolConfig.BuilderBase, TimeoutConfig.Builder, TimeoutConfig.BuilderBase, TlsConfig.Builder, TlsConfig.BuilderBase, TracingObserverConfig.Builder, TracingObserverConfig.BuilderBase, WebClientConfig.Builder, WebClientConfig.BuilderBase, WebClientCookieManagerConfig.Builder, WebClientCookieManagerConfig.BuilderBase, WebServerConfig.Builder, WebServerConfig.BuilderBase, WsClientConfig.Builder, WsClientConfig.BuilderBase, WsClientProtocolConfig.Builder, WsClientProtocolConfig.BuilderBase, WsConfig.Builder, WsConfig.BuilderBase
Enclosing class:
Prototype

public static interface Prototype.ConfiguredBuilder<BUILDER,PROTOTYPE> extends Prototype.Builder<BUILDER,PROTOTYPE>
Extension of Prototype.Builder that supports configuration. If a blueprint is marked as @Configured, build will accept configuration.
  • Method Details

    • config

      BUILDER config(Config config)
      Update builder from configuration. Any configured option that is defined on this prototype will be checked in configuration, and if it exists, it will override current value for that option on this builder. Options that do not exist in the provided config will not impact current values. The config instance is kept and may be used in builder decorator, it is not available in prototype implementation.
      Parameters:
      config - configuration to use
      Returns:
      updated builder instance
    • discoverServices

      default <S extends NamedService, T extends ConfiguredProvider<S>> List<S> discoverServices(Config config, String configKey, HelidonServiceLoader<T> serviceLoader, Class<T> providerType, Class<S> configType, boolean allFromServiceLoader, List<S> existingInstances)
      Discover services from configuration. If already configured instances already contain a service of the same type and name that would be added from configuration, the configuration would be ignored (e.g. the user must make a choice whether to configure, or set using an API).
      Type Parameters:
      S - type of the expected service
      T - type of the configured service provider that creates instances of S
      Parameters:
      config - configuration located at the parent node of the service providers
      configKey - configuration key of the provider list (either a list node, or object, where each child is one service)
      serviceLoader - helidon service loader for the expected type
      providerType - type of the service provider interface
      configType - type of the configured service
      allFromServiceLoader - whether all services from service loader should be used, or only the ones with configured node
      existingInstances - already configured instances
      Returns:
      list of discovered services, ordered by Weight (highest weight is first in the list)
    • discoverService

      default <S extends NamedService, T extends ConfiguredProvider<S>> Optional<S> discoverService(Config config, String configKey, HelidonServiceLoader<T> serviceLoader, Class<T> providerType, Class<S> configType, boolean allFromServiceLoader, Optional<S> existingValue)
      Discover service from configuration. If an instance is already configured using a builder, it will not be discovered from configuration (e.g. the user must make a choice whether to configure, or set using API).
      Type Parameters:
      S - type of the expected service
      T - type of the configured service provider that creates instances of S
      Parameters:
      config - configuration located at the parent node of the service providers
      configKey - configuration key of the provider list (either a list node, or object, where each child is one service - this method requires * zero to one configured services)
      serviceLoader - helidon service loader for the expected type
      providerType - type of the service provider interface
      configType - type of the configured service
      allFromServiceLoader - whether all services from service loader should be used, or only the ones with configured node
      existingValue - value already configured, if the name is same as discovered from configuration
      Returns:
      the first service (ordered by Weight that is discovered, or empty optional if none is found