public final class ServiceLoaderUtil extends Object
Modifier and Type | Method and Description |
---|---|
static <T> Stream<T> |
loadServices(Class<T> serviceType,
MethodHandles.Lookup lookup)
Retrieves the available services from the caller's classloader.
|
static <T> Stream<T> |
loadServices(Class<T> serviceType,
MethodHandles.Lookup lookup,
boolean useTccl)
Retrieves the available services from the caller's classloader and possibly
the thread context classloader.
|
public static <T> Stream<T> loadServices(Class<T> serviceType, MethodHandles.Lookup lookup)
T
- The service type.serviceType
- The class of the service.lookup
- The calling class data.public static <T> Stream<T> loadServices(Class<T> serviceType, MethodHandles.Lookup lookup, boolean useTccl)
T
- The service type.serviceType
- The class of the service.lookup
- The calling class data.useTccl
- If true the thread context classloader will also be used. Copyright © 1999-2023 The Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.