java.lang.Object
io.helidon.service.codegen.HelidonMetaInfServices
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 Summary
Modifier and TypeMethodDescriptionvoid
add
(DescriptorMetadata service) Add a single descriptors to the file.void
addAll
(Collection<DescriptorMetadata> services) Add all descriptors to the file.static HelidonMetaInfServices
create
(CodegenFiler filer, String moduleName) Create new instance from the current filer.void
write()
Write the file to output.
-
Method Details
-
create
Create new instance from the current filer.- Parameters:
filer
- filer to find the file, and to write itmoduleName
- module that is being built- Returns:
- a new instance of the service metadata manager
-
addAll
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
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.
-