Package de.espirit.firstspirit.access
Interface ServicesBroker
- All Known Subinterfaces:
Connection
public interface ServicesBroker
Interface for a class that brokers services.
Example:
Example:
ServicesBroker servicesBroker =SpecialistBroker
.requireSpecialist(ServicesBroker.TYPE)
; MyService myService = servicesBroker.getService(MyService.class)
;
- Since:
- 4.2.34
-
Field Summary
Modifier and TypeFieldDescriptionstatic final SpecialistType<ServicesBroker>
An agent providing means to broker services of a specific type. -
Method Summary
Modifier and TypeMethodDescription<T> T
getService
(Class<T> serviceClass) Returns a service instance as requested by a given class.
-
Field Details
-
TYPE
An agent providing means to broker services of a specific type.
-
-
Method Details
-
getService
Returns a service instance as requested by a given class.- Type Parameters:
T
- The Java type of the service.- Parameters:
serviceClass
- The class of the service to look up.- Returns:
- The service instance, if available for the given class.
- Throws:
ServiceNotFoundException
- If no appropriate service was found.- Since:
- 4.0.17
-