Class HelidonMetaInfServices

java.lang.Object
io.helidon.service.codegen.HelidonMetaInfServices

public class HelidonMetaInfServices extends Object
Support for reading and writing Helidon services to the resource.

Helidon replacement for Java ServiceLoader. Each service annotated with appropriate annotation (ServiceCodegenTypes.SERVICE_ANNOTATION_PROVIDER) will have a service descriptor generated at build time.

The service descriptor is then discoverable at runtime through our own resource in "META-INF/helidon/service-registry.json".

  • Method Details

    • create

      public static HelidonMetaInfServices create(CodegenFiler filer, String moduleName)
      Create new instance from the current filer.
      Parameters:
      filer - filer to find the file, and to write it
      moduleName - module that is being built
      Returns:
      a new instance of the service metadata manager
    • addAll

      public void addAll(Collection<DescriptorMetadata> services)
      Add all descriptors to the file. This never produces duplicate records. Descriptor type name is always unique within a file.
      Parameters:
      services - service descriptor metadata to add
    • add

      public void add(DescriptorMetadata service)
      Add a single descriptors to the file. This never produces duplicate records. Descriptor type name is always unique within a file.
      Parameters:
      service - service descriptor metadata to add
    • write

      public void write()
      Write the file to output.