Package com.io7m.idstore.services.api
Interface IdServiceDirectoryType
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
IdServiceDirectory
The type of service directories.
-
Method Summary
Modifier and TypeMethodDescription<T extends IdServiceType>
Optional<T>optionalService(Class<T> clazz) Get an optional reference to the given service.<T extends IdServiceType>
List<? extends T>optionalServices(Class<T> clazz) Get references to the given services.<T extends IdServiceType>
TrequireService(Class<T> clazz) Get a required reference to the given service.services()
-
Method Details
-
optionalService
Get an optional reference to the given service.- Type Parameters:
T- The service type- Parameters:
clazz- The service interface- Returns:
- A service reference, if a service exists
-
requireService
Get a required reference to the given service.- Type Parameters:
T- The service type- Parameters:
clazz- The service interface- Returns:
- A service reference
- Throws:
IdServiceException- If no service exists
-
optionalServices
<T extends IdServiceType> List<? extends T> optionalServices(Class<T> clazz) throws IdServiceException Get references to the given services.- Type Parameters:
T- The service type- Parameters:
clazz- The service interface- Returns:
- A service list, if services exist
- Throws:
IdServiceException- If no required
-
services
List<IdServiceType> services()- Returns:
- A read-only list of all the services present
-