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

    Required Elements
    Modifier and Type
    Required Element
    Description
    Class<?>[]
    Contracts of this service descriptor.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Type of service registry that should read this descriptor.
    double
    The weight of the service.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final TypeName
    Type name of this interface.
  • Field Details

    • TYPE

      static final TypeName TYPE
      Type name of this interface.
  • Element Details

    • registryType

      String registryType
      Type of service registry that should read this descriptor. Defaults to "core", so the descriptor must only implement GeneratedService.Descriptor.
      Returns:
      type of registry this descriptor supports
      Default:
      "core"
    • weight

      double weight
      The 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<?>[] contracts
      Contracts 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