Package org.ehcache.spi.service
Interface ServiceProvider<T extends Service>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <U extends T>
UgetService(java.lang.Class<U> serviceType)Looks up theServiceof the givenserviceType.<U extends T>
java.util.Collection<U>getServicesOfType(java.lang.Class<U> serviceType)Looks up allServiceinstances that are subtypes of the givenserviceTypesupplied.
-
-
-
Method Detail
-
getService
<U extends T> U getService(java.lang.Class<U> serviceType)
Looks up theServiceof the givenserviceType.There is no guarantee that services returned here will be started.
- Type Parameters:
U- theServicetype- Parameters:
serviceType- theclassof the service being looked up- Returns:
- a service instance of type
T, ornullif it couldn't be located - Throws:
java.lang.IllegalArgumentException- ifserviceTypeis marked with thePluralServiceannotation- See Also:
Service.start(ServiceProvider)
-
getServicesOfType
<U extends T> java.util.Collection<U> getServicesOfType(java.lang.Class<U> serviceType)
Looks up allServiceinstances that are subtypes of the givenserviceTypesupplied.This method must be used to retrieves service types marked with the
PluralServiceannotation.- Type Parameters:
U- theServicetype- Parameters:
serviceType- theclassof the service being looked up- Returns:
- all the service instances assignable to
serviceType
-
-