Class ServiceRegistryHolder
java.lang.Object
eu.cloudnetservice.driver.registry.ServiceRegistryHolder
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static @NonNull ServiceRegistryinstance()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.
-
Field Details
-
instance
-
-
Constructor Details
-
ServiceRegistryHolder
private ServiceRegistryHolder()
-
-
Method Details
-
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:
-