public interface ServiceLoader
Enums. See SpiServiceLoader
for default implementation.| Modifier and Type | Method and Description |
|---|---|
<T> Collection<T> |
all(Class<T> serviceClass)
Loads all registered services for given
serviceClass |
<T> T |
onlyOne(Class<T> serviceClass)
Loads a registered service for given
serviceClass |
<T> T |
onlyOne(Class<T> serviceClass,
Class<? extends T> defaultImplementationClass)
Loads a registered service for given
serviceClass. |
<T> Collection<T> all(Class<T> serviceClass) throws IllegalArgumentException
serviceClassserviceClass - IllegalArgumentException - If either classLoader or serviceClass is null<T> T onlyOne(Class<T> serviceClass) throws IllegalArgumentException, IllegalStateException
serviceClassserviceClass - IllegalArgumentException - If serviceClass is nullIllegalStateException - 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 nullIllegalStateException - If more than a single service is registeredCopyright © 2012 JBoss by Red Hat. All Rights Reserved.