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 void
inject
(DependencyContext ctx, InterceptionMetadata interceptionMetadata, Set<String> injected, T instance) Inject fields and methods.default Object
instantiate
(DependencyContext ctx, InterceptionMetadata interceptionMetadata) Create a new service instance.default void
postConstruct
(T instance) InvokeService.PostConstruct
annotated method(s).default void
preDestroy
(T instance) InvokeService.PreDestroy
annotated method(s).default TypeName
scope()
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.PostConstruct
annotated method(s).- Parameters:
instance
- instance to use
-
preDestroy
InvokeService.PreDestroy
annotated method(s).- Parameters:
instance
- instance to use
-
scope
Scope of this service.- Specified by:
scope
in interfaceServiceInfo
- Returns:
- scope of the service
-