Package io.opentelemetry.common
Interface ComponentLoader
public interface ComponentLoader
A loader for components that are discovered via SPI.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ComponentLoaderforClassLoader(ClassLoader classLoader) Create an instance for theclassLoaderusingServiceLoader.load(Class, ClassLoader).<T> Iterable<T> Load implementations of an SPI.static <T> List<T> loadList(ComponentLoader componentLoader, Class<T> spiClass) Convenience method to load a list of SPI implementations rather than the iterable returned byload(Class).
-
Method Details
-
load
Load implementations of an SPI.- Type Parameters:
T- the SPI type- Parameters:
spiClass- the SPI class- Returns:
- iterable of SPI implementations
-
forClassLoader
Create an instance for theclassLoaderusingServiceLoader.load(Class, ClassLoader). -
loadList
Convenience method to load a list of SPI implementations rather than the iterable returned byload(Class).- Since:
- 1.61.0
-