|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.fluxion.spi.utils.SPIUtils
public class SPIUtils
Utils classes for accessing methods related to this implementation of the Sun SPI framework. This class provides static methods for service discovery and instantiation.
For example:
// loop over all providers
for(MyService ms: SPIUtils.getServiceProviders(MyService.class))
{
...
}
| Constructor Summary | |
|---|---|
SPIUtils()
|
|
| Method Summary | ||
|---|---|---|
static
|
getServiceProviderClasses(java.lang.Class<SPI> spi)
Get a Set of all the classes that are providers for this Spi using
the current ClassLoader. |
|
static
|
getServiceProviderClasses(java.lang.ClassLoader loader,
java.lang.Class<SPI> spi)
Get a Set of all the classes that are providers for this Spi using
the supplied ClassLoader. |
|
static
|
getServiceProviders(java.lang.Class<SPI> spi)
Get a Set of all providers in the current classpath for the suppied SPI. |
|
static
|
getServiceProviders(java.lang.ClassLoader loader,
java.lang.Class<SPI> spi)
Get a Set of all providers present in the specified class loader for the given SPI. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SPIUtils()
| Method Detail |
|---|
public static <SPI> java.util.Set<SPI> getServiceProviders(java.lang.Class<SPI> spi)
throws ServiceConfigurationError
spi - the SPI to discover providers for
Set of all providers
ServiceConfigurationError - if any of the providers could not be
loaded
public static <SPI> java.util.Set<SPI> getServiceProviders(java.lang.ClassLoader loader,
java.lang.Class<SPI> spi)
throws ServiceConfigurationError
loader - the ClassLoader to scan for providersspi - The SPI to locate providers for
Set over all providers
ServiceConfigurationError - if any of the providers could not be
loaded
public static <SPI> java.util.Set<java.lang.Class<? extends SPI>> getServiceProviderClasses(java.lang.Class<SPI> spi)
throws ServiceConfigurationError
Set of all the classes that are providers for this Spi using
the current ClassLoader. These classes will be returned directly,
the caller should take responsibility for instantianting them.
spi - the SPI class to locate
Set of the Spi classes
ServiceConfigurationError - if the classes listed as SPIs could not
be loaded
public static <SPI> java.util.Set<java.lang.Class<? extends SPI>> getServiceProviderClasses(java.lang.ClassLoader loader,
java.lang.Class<SPI> spi)
throws ServiceConfigurationError
Set of all the classes that are providers for this Spi using
the supplied ClassLoader. These classes will be returned directly,
the caller should take responsibility for instantianting them.
loader - the ClassLoader to scan for providersspi - the SPI to locate providers for
Iterable over the Spi classes
ServiceConfigurationError - if the classes listed as SPIs could not
be loaded
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||