Class SafeServiceLoader
java.lang.Object
io.opentelemetry.javaagent.tooling.SafeServiceLoader
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> List<T>load(Class<T> serviceClass, ClassLoader classLoader) Delegates toServiceLoader.load(Class, ClassLoader)and then eagerly iterates over returnedIterable, ignoring any potentialUnsupportedClassVersionError.static <T extends io.opentelemetry.sdk.autoconfigure.spi.Ordered>
List<T>loadOrdered(Class<T> serviceClass, ClassLoader classLoader) Same asload(Class, ClassLoader), but also orders the returned implementations by comparing theirOrdered.order().
-
Method Details
-
load
Delegates toServiceLoader.load(Class, ClassLoader)and then eagerly iterates over returnedIterable, ignoring any potentialUnsupportedClassVersionError.Those errors can happen when some classes returned by
ServiceLoaderwere compiled for later java version than is used by currently running JVM. During normal course of business this should not happen. Please read CONTRIBUTING.md, section "Testing - Java versions" for a background info why this is Ok. -
loadOrdered
public static <T extends io.opentelemetry.sdk.autoconfigure.spi.Ordered> List<T> loadOrdered(Class<T> serviceClass, ClassLoader classLoader) Same asload(Class, ClassLoader), but also orders the returned implementations by comparing theirOrdered.order().
-