Module io.helidon.service.registry


module io.helidon.service.registry
Helidon Service Registry.

This module is a replacement for Java ServiceLoader that supports dependency injections and interception. It is fully build-time based, and when used together with Helidon Declarative features, and Service Maven plugin, it allows creation of applications that have no discovery at startup, and computed bindings.

The concept is based on the following principals:

  • Build time processing - using annotation processors (we use "Codegen" in Helidon)
  • Reflection free where possible - all generated code is reflection free
  • Discovery free - when used together with the Service Maven Plugin and Declarative programming model, there is no runtime discovery (i.e. no classpath scanning, no loading of resources etc.)
This module is a production feature of Helidon (we have moved it from Preview), when used with Helidon SE. It can be used to register custom instances (see Services.set(Class, Object[])), or to get services that are "global" (see Services.get(Class)).

The two main modules that are required to utilize the full power of service registry are the Service Codegen (io.helidon.service:helidon-service-codegen, to set it up as an annotation processor, also needs io.helidon.codegen:helidon-codegen-apt) - this module is required to declare new services, and the Service Maven Plugin (io.helidon.service:helidon-service-maven-plugin) - this module is only needed to bypass discovery and runtime service binding for Helidon Declarative applications.

See Also: