public interface ServiceRegistry extends java.lang.Iterable<Service>
| Modifier and Type | Method and Description |
|---|---|
<S extends Service> |
add(java.lang.Class<S> type,
S service)
Add a service
|
void |
addAll(java.util.Collection<java.util.Map.Entry<java.lang.Class<? extends Service>,Service>> services)
Add services
|
void |
cleanup()
Clear up the services registered, by calling
Service.cleanup() on each registered service |
void |
cleanupAfterBoot()
Clean up
BootstrapServices by calling BootstrapService.cleanupAfterBoot() on each registered
BootstrapService. |
<S extends Service> |
contains(java.lang.Class<S> type)
Check if a service is registered
|
java.util.Set<java.util.Map.Entry<java.lang.Class<? extends Service>,Service>> |
entrySet() |
<S extends Service> |
get(java.lang.Class<S> type)
Retrieve a service implementation
|
<S extends Service> |
getOptional(java.lang.Class<S> type)
Retrieve a service implementation wrapped in
Optional. |
<S extends Service> void add(java.lang.Class<S> type, S service)
S - the service type to addtype - the service type to addservice - the service implementationServicevoid addAll(java.util.Collection<java.util.Map.Entry<java.lang.Class<? extends Service>,Service>> services)
services - services to be added<S extends Service> S get(java.lang.Class<S> type)
S - the service typetype - the service type<S extends Service> java.util.Optional<S> getOptional(java.lang.Class<S> type)
Optional.S - the service typetype - the service typeOptional<S extends Service> boolean contains(java.lang.Class<S> type)
S - the service typetype - the service typevoid cleanup()
Service.cleanup() on each registered servicevoid cleanupAfterBoot()
BootstrapServices by calling BootstrapService.cleanupAfterBoot() on each registered
BootstrapService.Copyright © 2015. All Rights Reserved.