public interface ServiceRegistry extends AutoCloseable
services.| Modifier and Type | Method and Description |
|---|---|
void |
close() |
ServiceRegistry |
getParentServiceRegistry()
Retrieve this registry's parent registry.
|
<R extends Service> |
getService(Class<R> serviceRole)
Retrieve a service by role.
|
default <R extends Service> |
requireService(Class<R> serviceRole)
Retrieve a service by role.
|
ServiceRegistry getParentServiceRegistry()
<R extends Service> R getService(Class<R> serviceRole)
ServiceInitiator is
registered for this service role, the service will be initialized and returned.
NOTE: We cannot return <R extends Service<T>> here because the service might come from the parent...R - The service role typeserviceRole - The service roleUnknownServiceException - Indicates the service was not known.default <R extends Service> R requireService(Class<R> serviceRole)
ServiceInitiator is
registered for this service role, the service will be initialized and returned.
NOTE: We cannot return <R extends Service<T>> here because the service might come from the parent...R - The service role typeserviceRole - The service roleUnknownServiceException - Indicates the service was not known.NullServiceException - Indicates the service was null.void close()
close in interface AutoCloseableCopyright © 2001-2022 Red Hat, Inc. All Rights Reserved.