|
ShrinkWrap Resolver SPI 2.0.0-cr-1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ServiceLoader
ServiceLoader allows to load services available on classpath implementing given service interface.
All service are required to have a non-argument public constructor.
All ServiceLoader are required to handle registration of services implemented as Enums. See SpiServiceLoader
for default implementation.
| Method Summary | ||
|---|---|---|
|
all(Class<T> serviceClass)
Loads all registered services for given serviceClass |
|
|
onlyOne(Class<T> serviceClass)
Loads a registered service for given serviceClass |
|
|
onlyOne(Class<T> serviceClass,
Class<? extends T> defaultImplementationClass)
Loads a registered service for given serviceClass. |
|
| Method Detail |
|---|
<T> Collection<T> all(Class<T> serviceClass)
throws IllegalArgumentException
serviceClass
serviceClass -
IllegalArgumentException - If either classLoader or serviceClass is null
<T> T onlyOne(Class<T> serviceClass)
throws IllegalArgumentException,
IllegalStateException
serviceClass
serviceClass -
IllegalArgumentException - If serviceClass is null
IllegalStateException - If more than a single service is registered
<T> T onlyOne(Class<T> serviceClass,
Class<? extends T> defaultImplementationClass)
throws IllegalArgumentException,
IllegalStateException
serviceClass. Reverts to the defaultImplementationClass if no
other service is registered. If defaultImplemenationClass is registered as well, it simply ignores it during
resolution.
serviceClass - defaultImplementationClass -
IllegalArgumentException - If either serviceClass or defaultImplementationClass is null
IllegalStateException - If more than a single service is registered
|
ShrinkWrap Resolver SPI 2.0.0-cr-1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||