java.lang.Object
io.helidon.service.registry.GlobalServiceRegistry
Application wide service registry backed by
Context.-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanWhether a service registry instance is configured.static ServiceRegistryregistry()Current global service registry, will create a new instance if one is not configured.static ServiceRegistryregistry(ServiceRegistry newGlobalRegistry) Set the current global registry.static ServiceRegistryregistry(Supplier<ServiceRegistry> registrySupplier) Current global registry if configured, will replace the current global registry with the one provided by supplier if none registered.
-
Method Details
-
configured
public static boolean configured()Whether a service registry instance is configured.- Returns:
trueif a registry instance was already created
-
registry
Current global service registry, will create a new instance if one is not configured.- Returns:
- global service registry
-
registry
Current global registry if configured, will replace the current global registry with the one provided by supplier if none registered.- Parameters:
registrySupplier- supplier of new global registry if not yet configured- Returns:
- global service registry
-
registry
Set the current global registry. This method always returns the same instance as provided, though the next call toregistry()may return a different instance if the instance is replaced by another thread.- Parameters:
newGlobalRegistry- global registry to set- Returns:
- the same instance
-