Class GeneratedServiceProviderBuildItem

java.lang.Object
io.quarkus.builder.item.BuildItem
io.quarkus.builder.item.MultiBuildItem
io.quarkus.deployment.builditem.GeneratedServiceProviderBuildItem

public final class GeneratedServiceProviderBuildItem extends io.quarkus.builder.item.MultiBuildItem
Represents a service provider registration to be generated during the build.

Producers of this item declare that a given implementationClassName implements the given serviceInterfaceName and should be discoverable via ServiceLoader.

Packaging build steps consume this item and emit the appropriate output depending on the target:

  • Flat classpath: a META-INF/services/<serviceInterfaceName> resource file
  • JPMS module (future, see #44657): a module-info service entry
  • Constructor Details

    • GeneratedServiceProviderBuildItem

      public GeneratedServiceProviderBuildItem(String serviceInterfaceName, String implementationClassName)
      Parameters:
      serviceInterfaceName - the binary name of the service interface (e.g. io.quarkus.arc.ComponentsProvider)
      implementationClassName - the binary name of the generated implementation class (e.g. io.quarkus.arc.Arc_xxx_ComponentsProviderImpl)
  • Method Details

    • getServiceInterfaceName

      public String getServiceInterfaceName()
      Returns:
      the binary name of the service interface (e.g. io.quarkus.arc.ComponentsProvider)
    • getImplementationClassName

      public String getImplementationClassName()
      Returns:
      the binary name of the generated implementation class