public class ServiceLoader<S> extends Object implements Iterable<org.jboss.weld.bootstrap.spi.Metadata<S>>
Metadata
contract.Modifier and Type | Method and Description |
---|---|
Iterator<org.jboss.weld.bootstrap.spi.Metadata<S>> |
iterator()
Lazily loads the available providers of this loader's service.
|
static <S> ServiceLoader<S> |
load(Class<S> service)
Creates a new service loader for the given service type, using the current
thread's context class loader.
|
static <S> ServiceLoader<S> |
load(Class<S> service,
ClassLoader loader)
Creates a new service loader for the given service type and class loader.
|
static <S> ServiceLoader<S> |
load(Class<S> service,
org.jboss.weld.resources.spi.ResourceLoader loader) |
static <S> ServiceLoader<S> |
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
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 servicepublic 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 usedpublic static <S> ServiceLoader<S> load(Class<S> service, org.jboss.weld.resources.spi.ResourceLoader loader)
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 servicepublic void reload()
public Iterator<org.jboss.weld.bootstrap.spi.Metadata<S>> iterator()
Copyright © 2016. All Rights Reserved.