Module io.helidon.service.registry
Package io.helidon.service.registry
Class ServiceRegistryConfig.BuilderBase.ServiceRegistryConfigImpl
java.lang.Object
io.helidon.service.registry.ServiceRegistryConfig.BuilderBase.ServiceRegistryConfigImpl
- All Implemented Interfaces:
Prototype.Api
,ServiceRegistryConfig
- Enclosing class:
ServiceRegistryConfig.BuilderBase<BUILDER extends ServiceRegistryConfig.BuilderBase<BUILDER,
PROTOTYPE>, PROTOTYPE extends ServiceRegistryConfig>
protected static class ServiceRegistryConfig.BuilderBase.ServiceRegistryConfigImpl
extends Object
implements ServiceRegistryConfig
Generated implementation of the prototype, can be extended by descendant prototype implementations.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.helidon.service.registry.ServiceRegistryConfig
ServiceRegistryConfig.Builder, ServiceRegistryConfig.BuilderBase<BUILDER extends ServiceRegistryConfig.BuilderBase<BUILDER,
PROTOTYPE>, PROTOTYPE extends ServiceRegistryConfig> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ServiceRegistryConfigImpl
(ServiceRegistryConfig.BuilderBase<?, ?> builder) Create an instance providing a builder. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Whether to allow binding via methods, such asServices.set(Class, Object[])
.boolean
Whether to discover services from the class path.boolean
Whether to discover services from Java service loader.boolean
int
hashCode()
boolean
Flag indicating whether runtime interception is enabled.In certain conditions Injection services should be initialized but not started (i.e., avoiding calls toPostConstruct
etc.).boolean
Flag indicating whether service lookups (i.e., viaServiceRegistry.first(io.helidon.service.registry.Lookup)
) are cached.int
Size of the lookup cache whenServiceRegistryConfig.lookupCacheEnabled()
is set totrue
.double
Maximal run level to handle when starting fromServiceRegistryManager.start(Binding)
.Run levels that should be initialized at startup.Manually registered service descriptors to add to the registry.Manually register initial bindings for some of the services in the registry.toString()
boolean
Flag indicating whether compile-time generatedBinding
's should be used at initialization when starting the registry usingServiceRegistryManager.start(Binding)
.
-
Constructor Details
-
ServiceRegistryConfigImpl
Create an instance providing a builder.- Parameters:
builder
- extending builder base of this prototype
-
-
Method Details
-
discoverServices
public boolean discoverServices()Description copied from interface:ServiceRegistryConfig
Whether to discover services from the class path. When set tofalse
, only services added throughServiceRegistryConfig.serviceDescriptors()
and/orServiceRegistryConfig.serviceInstances()
would be available.- Specified by:
discoverServices
in interfaceServiceRegistryConfig
- Returns:
- whether to discover services from classpath, defaults to
true
-
discoverServicesFromServiceLoader
public boolean discoverServicesFromServiceLoader()Description copied from interface:ServiceRegistryConfig
Whether to discover services from Java service loader. SeeServiceDiscovery.SERVICES_LOADER_RESOURCE
.- Specified by:
discoverServicesFromServiceLoader
in interfaceServiceRegistryConfig
- Returns:
- whether to discover Java
ServiceLoader
services from classpath (a curated list only), defaults totrue
-
allowLateBinding
public boolean allowLateBinding()Description copied from interface:ServiceRegistryConfig
Whether to allow binding via methods, such asServices.set(Class, Object[])
. When disabled, attempts at late binding will throw an exception.- Specified by:
allowLateBinding
in interfaceServiceRegistryConfig
- Returns:
- whether late binding is enabled, defaults to
true
-
serviceDescriptors
Description copied from interface:ServiceRegistryConfig
Manually registered service descriptors to add to the registry. This is useful whenServiceRegistryConfig.discoverServices()
is set tofalse
, 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).
- Specified by:
serviceDescriptors
in interfaceServiceRegistryConfig
- Returns:
- services to register
-
serviceInstances
Description copied from interface:ServiceRegistryConfig
Manually register initial bindings for some of the services in the registry.- Specified by:
serviceInstances
in interfaceServiceRegistryConfig
- Returns:
- service instances to register
-
lookupCacheEnabled
public boolean lookupCacheEnabled()Description copied from interface:ServiceRegistryConfig
Flag indicating whether service lookups (i.e., viaServiceRegistry.first(io.helidon.service.registry.Lookup)
) are cached.- Specified by:
lookupCacheEnabled
in interfaceServiceRegistryConfig
- Returns:
- the flag indicating whether service lookups are cached, defaults to
false
-
lookupCacheSize
public int lookupCacheSize()Description copied from interface:ServiceRegistryConfig
Size of the lookup cache whenServiceRegistryConfig.lookupCacheEnabled()
is set totrue
.- Specified by:
lookupCacheSize
in interfaceServiceRegistryConfig
- Returns:
- cache size
-
interceptionEnabled
public boolean interceptionEnabled()Description copied from interface:ServiceRegistryConfig
Flag indicating whether runtime interception is enabled. If set tofalse
, methods will be invoked without any interceptors, even if interceptors are available.- Specified by:
interceptionEnabled
in interfaceServiceRegistryConfig
- Returns:
- whether to intercept calls at runtime, defaults to
true
-
limitActivationPhase
Description copied from interface:ServiceRegistryConfig
In certain conditions Injection services should be initialized but not started (i.e., avoiding calls toPostConstruct
etc.). This can be used in special cases where the normal Injection startup should limit lifecycle up to a given phase.- Specified by:
limitActivationPhase
in interfaceServiceRegistryConfig
- Returns:
- the phase to stop at during lifecycle
-
useBinding
public boolean useBinding()Description copied from interface:ServiceRegistryConfig
Flag indicating whether compile-time generatedBinding
's should be used at initialization when starting the registry usingServiceRegistryManager.start(Binding)
.This option is ignored when starting the service registry in any other way.
- Specified by:
useBinding
in interfaceServiceRegistryConfig
- Returns:
- the flag indicating whether the provider is permitted to use binding generated code from compile-time,
defaults to
true
- See Also:
-
maxRunLevel
public double maxRunLevel()Description copied from interface:ServiceRegistryConfig
Maximal run level to handle when starting fromServiceRegistryManager.start(Binding)
. This setting is ignored when starting registry using other means, as run levels are not handled by default.- Specified by:
maxRunLevel
in interfaceServiceRegistryConfig
- Returns:
- maximal run level to lookup during application startup when using generated binding
-
runLevels
Description copied from interface:ServiceRegistryConfig
Run levels that should be initialized at startup. GeneratedBinding
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.
- Specified by:
runLevels
in interfaceServiceRegistryConfig
- Returns:
- run levels to initialize, up to
ServiceRegistryConfig.maxRunLevel()
, only used when starting the registry throughServiceRegistryManager.start(Binding)
orServiceRegistryManager.start(Binding, ServiceRegistryConfig)
-
toString
-
equals
-
hashCode
public int hashCode()
-