- Type Parameters:
T- the type that this service provider manages
- All Superinterfaces:
Comparable<Weighted>,InjectionPointProvider<T>,Provider<T>,ServiceProvider<T>,Weighted
- All Known Implementing Classes:
AbstractServiceProvider,ConfigDrivenServiceProviderBase,ReflectionBasedSingletonServiceProvider
An extension to
ServiceProvider that allows for startup binding from a Injection$$Application,
and thereby works in conjunction with the ServiceBinder during injection service registry
initialization.
The only guarantee the provider implementation has is ensuring that ModuleComponent instances
are bound to the Services instances, as well as informed on the module name.
Generally this class should be called internally by the framework, and typically occurs only during initialization sequences.
- See Also:
-
Field Summary
Fields inherited from interface io.helidon.common.Weighted
DEFAULT_WEIGHT -
Method Summary
Modifier and TypeMethodDescriptionThe binder can be provided by the service provider to deterministically set the injection plan at compile-time, and subsequently loaded at early startup initialization.Returns the previously assignedInjectionServicesinstance.voidinjectionServices(Optional<InjectionServices> injectionServices) Assigns the services instance this provider is bound to.Returns the service provider that intercepts this provider.default voidinterceptor(ServiceProvider<?> interceptor) Sets the interceptor for this service provider.default booleanReturnstrueif this service provider is intercepted.default booleanReturns true if this service provider instance is anInterceptor.default booleanReturns true if this provider is the root provider.voidmoduleName(String moduleName) Called to inform a service provider the module name it is bound to.default Optional<ServiceProvider<?>> Gets the root/parent provider for this service.default voidrootProvider(ServiceProvider<T> rootProvider) Sets the root/parent provider for this instance.Methods inherited from interface io.helidon.inject.api.InjectionPointProvider
first, get, listMethods inherited from interface io.helidon.inject.api.ServiceProvider
activator, currentActivationPhase, deActivator, dependencies, description, id, isProvider, postConstructMethod, preDestroyMethod, serviceInfo, serviceProviderBindable, serviceType
-
Method Details
-
moduleName
Called to inform a service provider the module name it is bound to. Will only be called when there is a non-null module name associated for the givenModuleComponent. A service provider can be associated with 0..1 modules.- Parameters:
moduleName- the non-null module name
-
isInterceptor
default boolean isInterceptor()Returns true if this service provider instance is anInterceptor.- Returns:
- true if this service provider is an interceptor
-
isIntercepted
default boolean isIntercepted()Returnstrueif this service provider is intercepted.- Returns:
- flag indicating whether this service provider is intercepted
-
interceptor
Optional<ServiceProvider<?>> interceptor()Returns the service provider that intercepts this provider.- Returns:
- the service provider that intercepts this provider
-
interceptor
Sets the interceptor for this service provider.- Parameters:
interceptor- the interceptor for this provider
-
rootProvider
Gets the root/parent provider for this service. A root/parent provider is intended to manage it's underlying providers. Note that "root" and "parent" are interchangeable here since there is at most one level of depth that occurs whenServiceProvider's are wrapped by other providers.- Returns:
- the root/parent provider or empty if this instance is the root provider
-
isRootProvider
default boolean isRootProvider()Returns true if this provider is the root provider.- Returns:
- indicates whether this provider is a root provider - the default is true
-
rootProvider
Sets the root/parent provider for this instance.- Parameters:
rootProvider- sets the root provider
-
injectionServices
Optional<InjectionServices> injectionServices()Returns the previously assignedInjectionServicesinstance.- Returns:
- the previously assigned injection services instance, or empty if never assigned
- See Also:
-
injectionServices
Assigns the services instance this provider is bound to. A service provider can be associated with 0..1 services instance. If not set, the service provider should useInjectionServices.injectionServices()to ascertain the instance.- Parameters:
injectionServices- the injection services instance, or empty to clear any active binding
-
injectionPlanBinder
The binder can be provided by the service provider to deterministically set the injection plan at compile-time, and subsequently loaded at early startup initialization.- Returns:
- binder used for this service provider, or empty if not capable or ineligible of being bound
-