Module io.helidon.service.registry
Package io.helidon.service.registry
Annotation Interface Service.Descriptor
- Enclosing class:
Service
@Documented
@Retention(CLASS)
@Target({ANNOTATION_TYPE,TYPE})
public static @interface Service.Descriptor
Annotation to add a custom service descriptor.
The service descriptor will be added as any other service descriptor that is generated, only it is expected
as a source.
The descriptor MUST follow the approach of Helidon service descriptor, and must be public,
provide a public constant called INSTANCE
, and all its dependencies
(Dependency
must be available as public constants (and correctly described in each Ip instance).
-
Required Element Summary
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionType of service registry that should read this descriptor.double
The weight of the service. -
Field Summary
-
Field Details
-
TYPE
Type name of this interface.
-
-
Element Details
-
registryType
String registryTypeType of service registry that should read this descriptor. Defaults to "core", so the descriptor must only implementGeneratedService.Descriptor
.- Returns:
- type of registry this descriptor supports
- Default:
"core"
-
weight
double weightThe weight of the service. This is required for predefined descriptors, as we do not want to instantiate them unless really needed.- Returns:
- weight of this descriptor
- Default:
100.0
-
contracts
Class<?>[] contractsContracts of this service descriptor. Normally these are discovered from the service provider type, but as this is a pre-built descriptor, we need to get them through annotation.- Returns:
- contracts of this service descriptor
-