- java.lang.Object
-
- org.apache.logging.log4j.util.ServiceLoaderUtil
-
@InternalApi public final class ServiceLoaderUtil extends Object
This class should be considered internal.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Method Detail
-
loadServices
public static <T> Stream<T> loadServices(Class<T> serviceType, MethodHandles.Lookup lookup)
Retrieves the available services from the caller's classloader. Broken services will be ignored.- Type Parameters:
T
- The service type.- Parameters:
serviceType
- The class of the service.lookup
- The calling class data.- Returns:
- A stream of service instances.
-
loadServices
public 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. Broken services will be ignored.- Type Parameters:
T
- The service type.- Parameters:
serviceType
- The class of the service.lookup
- The calling class data.useTccl
- If true the thread context classloader will also be used.- Returns:
- A stream of service instances.
-
-