public final class ServiceLoader
extends java.lang.Object
current ClassLoader
.
ServiceLoader
embedded in JVM uses
System ClassLoader
and cannot be used in Surefire/Failsafe.Constructor and Description |
---|
ServiceLoader() |
Modifier and Type | Method and Description |
---|---|
private static java.io.BufferedReader |
getReader(java.net.URL url) |
<T> java.util.Set<T> |
load(java.lang.Class<T> clazz,
java.lang.ClassLoader classLoader) |
java.util.Set<java.lang.String> |
lookup(java.lang.Class<?> clazz,
java.lang.ClassLoader classLoader) |
private static java.util.Set<java.lang.String> |
lookupSpiImplementations(java.util.Enumeration<java.net.URL> urlEnumeration)
Method loadServices loads the services of a class that are
defined using the SPI mechanism.
|
@Nonnull public <T> java.util.Set<T> load(java.lang.Class<T> clazz, java.lang.ClassLoader classLoader)
@Nonnull public java.util.Set<java.lang.String> lookup(java.lang.Class<?> clazz, java.lang.ClassLoader classLoader) throws java.io.IOException
java.io.IOException
@Nonnull private static java.util.Set<java.lang.String> lookupSpiImplementations(java.util.Enumeration<java.net.URL> urlEnumeration) throws java.io.IOException
urlEnumeration
- The urls from the resourcejava.io.IOException
- When reading the streams fails@Nonnull private static java.io.BufferedReader getReader(@Nonnull java.net.URL url) throws java.io.IOException
java.io.IOException