|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.solder.util.service.ServiceLoader<S>
public class ServiceLoader<S>
This class handles looking up service providers on the class path. It implements the Service Provider section of the JAR File Specification.
The Service Provider programmatic lookup was not specified prior to Java 6 so this interface allows use of the specification prior to Java 6. The API is copied from java.util.ServiceLoader
Method Summary | ||
---|---|---|
Iterator<S> |
iterator()
Lazily loads the available providers of this loader's service. |
|
static
|
load(Class<S> service)
Creates a new service loader for the given service type, using the current thread's context class loader. |
|
static
|
load(Class<S> service,
ClassLoader loader)
Creates a new service loader for the given service type and class loader. |
|
static
|
loadInstalled(Class<S> service)
Creates a new service loader for the given service type, using the extension class loader. |
|
void |
reload()
Clear this loader's provider cache so that all providers will be reloaded. |
|
String |
toString()
Returns a string describing this service. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static <S> ServiceLoader<S> load(Class<S> service)
ServiceLoader.load(service)</code>
is equivalent to
ServiceLoader.load(service,
Thread.currentThread().getContextClassLoader())
service
- The interface or abstract class representing the service
public static <S> ServiceLoader<S> load(Class<S> service, ClassLoader loader)
service
- The interface or abstract class representing the serviceloader
- The class loader to be used to load provider-configuration
files and provider classes, or null if the system class loader
(or, failing that, the bootstrap class loader) is to be used
public static <S> ServiceLoader<S> loadInstalled(Class<S> service)
ServiceLoader.load(service, extClassLoader)
If the extension class loader cannot be found then the system class loader
is used; if there is no system class loader then the bootstrap class
loader is used.
This method is intended for use when only installed providers are desired.
The resulting service will only find and load providers that have been
installed into the current Java virtual machine; providers on the
application's class path will be ignored.
service
- The interface or abstract class representing the service
public void reload()
public Iterator<S> iterator()
iterator
in interface Iterable<S>
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |