public class Service extends java.lang.Object
Implement the JDK1.3 'Service Provider' specification. ( http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html )
This class supports any VM, including JDK1.1, via org.apache.commons.discover.jdk.JDKHooks. The caller will first configure the discoverer by adding ( in the desired order ) all the places to look for the META-INF/services. Currently we support loaders. The findResources() method will check every loader.Modifier | Constructor | Description |
---|---|---|
protected |
Service() |
Construct a new service discoverer
|
Modifier and Type | Method | Description |
---|---|---|
static <T,S extends T> |
providers(java.lang.Class<T> spiClass) |
as described in
sun/jdk1.3.1/docs/guide/jar/jar.html#Service Provider,
Except this uses
Enumeration
instead of Interator . |
static <T,S extends T> |
providers(SPInterface<T> spi,
ClassLoaders loaders) |
This version lets you specify constructor arguments..
|
protected Service()
public static <T,S extends T> java.util.Enumeration<S> providers(java.lang.Class<T> spiClass)
Enumeration
instead of Interator
.T
- Service Provider Interface typeS
- Any type extends the SPI typespiClass
- Service Provider Interface ClassS
)public static <T,S extends T> java.util.Enumeration<S> providers(SPInterface<T> spi, ClassLoaders loaders)
T
- Service Provider Interface typeS
- Any type extends the SPI typespi
- SPI to look for and load.loaders
- loaders to use in search.
If null
then use ClassLoaders.getAppLoaders().S
)