public interface ServiceFinder
Each ServiceFinder is obtained from a specific Module, and the lookup rules are the following:
Both native Polygene services and imported services are considered, with preference to native services.
Modifier and Type | Method and Description |
---|---|
<T> ServiceReference<T> |
findService(Class<T> serviceType)
Find a ServiceReference that implements the given type.
|
<T> ServiceReference<T> |
findService(Type serviceType)
Find a ServiceReference that implements the given type.
|
<T> Stream<ServiceReference<T>> |
findServices(Class<T> serviceType)
Find ServiceReferences that implements the given type.
|
<T> Stream<ServiceReference<T>> |
findServices(Type serviceType)
Find ServiceReferences that implements the given type.
|
<T> ServiceReference<T> findService(Class<T> serviceType) throws NoSuchServiceTypeException
T
- Service typeserviceType
- the type that the Service must implementNoSuchServiceTypeException
- if no service of serviceType is found<T> ServiceReference<T> findService(Type serviceType) throws NoSuchServiceTypeException
T
- Service typeserviceType
- the type that the Service must implementNoSuchServiceTypeException
- if no service of serviceType is found<T> Stream<ServiceReference<T>> findServices(Class<T> serviceType)
The order of the references is such that Services more local to the querying Module is earlier in the list.
T
- Service typeserviceType
- the type that the Services must implement<T> Stream<ServiceReference<T>> findServices(Type serviceType)
The order of the references is such that Services more local to the querying Module is earlier in the list.
T
- Service typeserviceType
- the type that the Services must implement