- Type Parameters:
T
- the type that this service provider manages
- All Superinterfaces:
Comparable<Weighted>
,InjectionPointProvider<T>
,Provider<T>
,Weighted
- All Known Subinterfaces:
ConfiguredServiceProvider<T,
,CB> ServiceProviderBindable<T>
- All Known Implementing Classes:
AbstractServiceProvider
,ConfigDrivenServiceProviderBase
,ReflectionBasedSingletonServiceProvider
Provides management lifecycle around services.
-
Field Summary
Fields inherited from interface io.helidon.common.Weighted
DEFAULT_WEIGHT
-
Method Summary
Modifier and TypeMethodDescriptionThe agent responsible for activation - this will be non-null for build-time activators.The current activation phase for this service provider.The agent responsible for deactivation - this will be non-null for build-time activators.io.helidon.inject.api.DependenciesInfo
Provides the dependencies for this service provider if known, or null if not known or not available.Describe the service provider.id()
Identifies the service provider physically and uniquely.boolean
Does the service provide singletons, does it always produce the same result for every call toInjectionPointProvider.get()
.The optional method handling PreDestroy.The optional method handling PostConstruct.io.helidon.inject.api.ServiceInfo
The meta information that describes the service.The agent/instance to be used for binding this service provider to the injectable application that was code generated.Class
<?> The type of the service being managed.Methods inherited from interface io.helidon.inject.api.InjectionPointProvider
first, get, list
-
Method Details
-
id
String id()Identifies the service provider physically and uniquely.- Returns:
- the unique identity of the service provider
-
description
String description()Describe the service provider. This will change based upon activation state.- Returns:
- the logical and immutable description
-
isProvider
boolean isProvider()Does the service provide singletons, does it always produce the same result for every call toInjectionPointProvider.get()
. I.e., if the managed service implements Provider orInjectionPointProvider
then this typically is considered not a singleton provider. I.e., If the managed services is NOTSingleton
, then it will be treated as per request / dependent scope. Note that this is similar in nature to RequestScope, except the "official" request scope is bound to the web request. Here, we are speaking about contextually any caller asking for a new instance of the service in question. The requester in question will ideally be able to identify itself to this provider viaInjectionPointProvider.first(ContextualServiceQuery)
so that this provider can properly service the "provide" request.- Returns:
- true if the service provider provides per-request instances for each caller
-
serviceInfo
io.helidon.inject.api.ServiceInfo serviceInfo()The meta information that describes the service. Must remain immutable for the lifetime of the JVM post binding - ie., afterServiceBinder.bind(ServiceProvider)
is called.- Returns:
- the meta information describing the service
-
dependencies
io.helidon.inject.api.DependenciesInfo dependencies()Provides the dependencies for this service provider if known, or null if not known or not available.- Returns:
- the dependencies this service provider has or null if unknown or unavailable
-
currentActivationPhase
Phase currentActivationPhase()The current activation phase for this service provider.- Returns:
- the activation phase
-
activator
The agent responsible for activation - this will be non-null for build-time activators. If not present then anInjector
must be used to reflectively activate.- Returns:
- the activator
-
deActivator
Optional<DeActivator> deActivator()The agent responsible for deactivation - this will be non-null for build-time activators. If not present then anInjector
must be used to reflectively deactivate.- Returns:
- the deactivator to use or null if the service is not interested in deactivation
-
postConstructMethod
Optional<PostConstructMethod> postConstructMethod()The optional method handling PreDestroy.- Returns:
- the post-construct method or empty if there is none
-
preDestroyMethod
Optional<PreDestroyMethod> preDestroyMethod()The optional method handling PostConstruct.- Returns:
- the pre-destroy method or empty if there is none
-
serviceProviderBindable
Optional<ServiceProviderBindable<T>> serviceProviderBindable()The agent/instance to be used for binding this service provider to the injectable application that was code generated.- Returns:
- the service provider that should be used for binding, or empty if this provider does not support binding
- See Also:
-
serviceType
Class<?> serviceType()The type of the service being managed.- Returns:
- the service type being managed
-