Module io.helidon.service.registry
Package io.helidon.service.registry
Interface ServiceDescriptor<T>
- Type Parameters:
T- type of the described service
- All Superinterfaces:
Comparable<Weighted>,ServiceInfo,Weighted
- All Known Implementing Classes:
ExistingInstanceDescriptor,VirtualDescriptor
A descriptor of a service. In addition to providing service metadata, this also allows instantiation
of the service instance, with dependent services as parameters.
-
Field Summary
Fields inherited from interface io.helidon.common.Weighted
DEFAULT_WEIGHT -
Method Summary
Modifier and TypeMethodDescriptiondefault voidinject(DependencyContext ctx, InterceptionMetadata interceptionMetadata, Set<String> injected, T instance) Inject fields and methods.default Objectinstantiate(DependencyContext ctx, InterceptionMetadata interceptionMetadata) Create a new service instance.default voidpostConstruct(T instance) InvokeService.PostConstructannotated method(s).default voidpreDestroy(T instance) InvokeService.PreDestroyannotated method(s).default TypeNamescope()Scope of this service.Methods inherited from interface io.helidon.service.registry.ServiceInfo
contracts, dependencies, descriptorType, factoryContracts, factoryType, isAbstract, providedType, qualifiers, runLevel, serviceType
-
Method Details
-
instantiate
Create a new service instance.- Parameters:
ctx- dependency context with all dependencies of this serviceinterceptionMetadata- metadata handler for interception- Returns:
- a new instance, must be of the type T or a subclass
-
inject
default void inject(DependencyContext ctx, InterceptionMetadata interceptionMetadata, Set<String> injected, T instance) Inject fields and methods.- Parameters:
ctx- injection contextinterceptionMetadata- interception metadata to support interception of field injectioninjected- mutable set of already injected methods from subtypesinstance- instance to update
-
postConstruct
InvokeService.PostConstructannotated method(s).- Parameters:
instance- instance to use
-
preDestroy
InvokeService.PreDestroyannotated method(s).- Parameters:
instance- instance to use
-
scope
Scope of this service.- Specified by:
scopein interfaceServiceInfo- Returns:
- scope of the service
-