Class ServiceRegistryHolder

java.lang.Object
eu.cloudnetservice.driver.registry.ServiceRegistryHolder

@Internal final class ServiceRegistryHolder extends Object
Holds the singleton instance of the service registry which is returned by ServiceRegistry.registry(). The instance is retrieved from the boot injection layer upon the first invocation of the mentioned method and will not change over the lifetime of the jvm. Injecting the service registry should yield the same result as using the static accessor method. The static method is more of a helper function for internal code which has no direct access to dependency injection, for example to construct builder instances, but still want to facility the instance retrieval for the user.
Since:
4.0
  • Field Details

  • Constructor Details

    • ServiceRegistryHolder

      private ServiceRegistryHolder()
  • Method Details

    • instance

      @NonNull static @NonNull ServiceRegistry instance()
      Returns the jvm-static instance of the service registry, retrieving it from the boot injection layer if the current call is the first call to the method.
      Returns:
      the jvm-static instance of the service registry, retrieved from the boot injection layer.
      See Also: