public interface ServiceRegistry extends AutoCloseable
A registry of 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()
Retrieve this registry’s parent registry.
<R extends Service> R getService(Class<R> serviceRole)
Retrieve a service by role. If service is not found, but a ServiceInitiator is
registered for this service role, the service will be initialized and returned.
<p/>
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)
Retrieve a service by role. If service is not found, but a ServiceInitiator is
registered for this service role, the service will be initialized and returned.
<p/>
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-2018 Red Hat, Inc. All Rights Reserved.