|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ops4j.spi.ServiceProviderFinder
public class ServiceProviderFinder
Convenience methods for obtaining implementations of a given service via ServiceLoader.
A service is defined by an interface or an abstract class.
| Constructor Summary | |
|---|---|
ServiceProviderFinder()
|
|
| Method Summary | ||
|---|---|---|
static
|
findAnyServiceProvider(Class<T> klass)
Finds any provider for a given service. |
|
static
|
findServiceProviders(Class<T> klass)
Finds all providers for a given service. |
|
static
|
loadAnyServiceProvider(Class<T> klass)
Returns any provider for a given service and throws an exception when no provider is found on the classpath. |
|
static
|
loadUniqueServiceProvider(Class<T> klass)
Returns the unique service provider for a given service and throws an exception if there is no unique provider |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ServiceProviderFinder()
| Method Detail |
|---|
public static <T> List<T> findServiceProviders(Class<T> klass)
klass - service interface or class
public static <T> T findAnyServiceProvider(Class<T> klass)
klass - service interface or class
public static <T> T loadAnyServiceProvider(Class<T> klass)
klass - service interface or class
NoServiceProviderExceptionpublic static <T> T loadUniqueServiceProvider(Class<T> klass)
klass - service interface or class
NoServiceProviderException
NonUniqueServiceProviderException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||