Class ServiceLoader
java.lang.Object
org.apache.maven.surefire.providerapi.ServiceLoader
SPI loader for Surefire/Failsafe should use
The
current ClassLoader
.
The
ServiceLoader
embedded in JVM uses
System ClassLoader
and cannot be used in Surefire/Failsafe.- Since:
- 2.20
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static BufferedReader
<T> Set<T>
load
(Class<T> clazz, ClassLoader classLoader) lookup
(Class<?> clazz, ClassLoader classLoader) lookupSpiImplementations
(Enumeration<URL> urlEnumeration) Method loadServices loads the services of a class that are defined using the SPI mechanism.
-
Constructor Details
-
ServiceLoader
public ServiceLoader()
-
-
Method Details
-
load
-
lookup
- Throws:
IOException
-
lookupSpiImplementations
@Nonnull private static Set<String> lookupSpiImplementations(Enumeration<URL> urlEnumeration) throws IOException Method loadServices loads the services of a class that are defined using the SPI mechanism.- Parameters:
urlEnumeration
- The urls from the resource- Returns:
- The set of service provider names
- Throws:
IOException
- When reading the streams fails
-
getReader
- Throws:
IOException
-