Interface ServiceRegistryConfig

All Superinterfaces:
Prototype.Api
All Known Implementing Classes:
ServiceRegistryConfig.BuilderBase.ServiceRegistryConfigImpl

public interface ServiceRegistryConfig extends Prototype.Api
Helidon service registry configuration.
See Also:
  • Method Details

    • builder

      Create a new fluent API builder to customize configuration.
      Returns:
      a new builder
    • builder

      Create a new fluent API builder from an existing instance.
      Parameters:
      instance - an existing instance used as a base for the builder
      Returns:
      a builder based on an instance
    • create

      static ServiceRegistryConfig create()
      Create a new instance with default values.
      Returns:
      a new instance
    • discoverServices

      boolean discoverServices()
      Whether to discover services from the class path. When set to false, only services added through serviceDescriptors() and/or serviceInstances() would be available.
      Returns:
      whether to discover services from classpath, defaults to true
    • discoverServicesFromServiceLoader

      boolean discoverServicesFromServiceLoader()
      Whether to discover services from Java service loader. See ServiceDiscovery.SERVICES_LOADER_RESOURCE.
      Returns:
      whether to discover Java ServiceLoader services from classpath (a curated list only), defaults to true
    • allowLateBinding

      boolean allowLateBinding()
      Whether to allow binding via methods, such as Services.set(Class, Object[]). When disabled, attempts at late binding will throw an exception.
      Returns:
      whether late binding is enabled, defaults to true
    • serviceDescriptors

      List<ServiceDescriptor<?>> serviceDescriptors()
      Manually registered service descriptors to add to the registry. This is useful when discoverServices() is set to false, to register only hand-picked services into the registry.

      Even when service discovery is used, this can be used to add service descriptors that are not part of a service discovery mechanism (such as testing services).

      Returns:
      services to register
    • serviceInstances

      Map<ServiceDescriptor<?>,Object> serviceInstances()
      Manually register initial bindings for some of the services in the registry.
      Returns:
      service instances to register
    • lookupCacheEnabled

      boolean lookupCacheEnabled()
      Flag indicating whether service lookups (i.e., via ServiceRegistry.first(io.helidon.service.registry.Lookup)) are cached.
      Returns:
      the flag indicating whether service lookups are cached, defaults to false
    • lookupCacheSize

      int lookupCacheSize()
      Size of the lookup cache when ServiceRegistryConfigBlueprint.lookupCacheEnabled() is set to true.
      Returns:
      cache size
    • interceptionEnabled

      boolean interceptionEnabled()
      Flag indicating whether runtime interception is enabled. If set to false, methods will be invoked without any interceptors, even if interceptors are available.
      Returns:
      whether to intercept calls at runtime, defaults to true
    • limitActivationPhase

      ActivationPhase limitActivationPhase()
      In certain conditions Injection services should be initialized but not started (i.e., avoiding calls to PostConstruct etc.). This can be used in special cases where the normal Injection startup should limit lifecycle up to a given phase.
      Returns:
      the phase to stop at during lifecycle
    • useBinding

      boolean useBinding()
      Flag indicating whether compile-time generated Binding's should be used at initialization when starting the registry using ServiceRegistryManager.start(Binding).

      This option is ignored when starting the service registry in any other way.

      Returns:
      the flag indicating whether the provider is permitted to use binding generated code from compile-time, defaults to true
      See Also:
    • maxRunLevel

      double maxRunLevel()
      Maximal run level to handle when starting from ServiceRegistryManager.start(Binding). This setting is ignored when starting registry using other means, as run levels are not handled by default.
      Returns:
      maximal run level to lookup during application startup when using generated binding
    • runLevels

      List<Double> runLevels()
      Run levels that should be initialized at startup. Generated Binding will configure all declared run levels of services in the application.

      Note that the result WILL be ordered before use, so initialization will always be handled from the smallest run level to the highest.

      Returns:
      run levels to initialize, up to maxRunLevel(), only used when starting the registry through ServiceRegistryManager.start(Binding) or ServiceRegistryManager.start(Binding, ServiceRegistryConfig)