Package io.opentelemetry.sdk.internal
Class ComponentRegistry<V>
- java.lang.Object
-
- io.opentelemetry.sdk.internal.ComponentRegistry<V>
-
- Type Parameters:
V
- the type of the registered value.
public final class ComponentRegistry<V> extends Object
Base class for all the provider classes (TracerProvider, MeterProvider, etc.).
-
-
Constructor Summary
Constructors Constructor Description ComponentRegistry(Function<InstrumentationLibraryInfo,V> factory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description V
get(String instrumentationName)
Returns the registered value associated with this name andnull
version if any, otherwise creates a new instance and associates it with the given name andnull
version.V
get(String instrumentationName, String instrumentationVersion)
Returns the registered value associated with this name and version if any, otherwise creates a new instance and associates it with the given name and version.Collection<V>
getComponents()
Returns aCollection
view of the registered components.
-
-
-
Constructor Detail
-
ComponentRegistry
public ComponentRegistry(Function<InstrumentationLibraryInfo,V> factory)
-
-
Method Detail
-
get
public final V get(String instrumentationName)
Returns the registered value associated with this name andnull
version if any, otherwise creates a new instance and associates it with the given name andnull
version.- Parameters:
instrumentationName
- the name of the instrumentation library.- Returns:
- the registered value associated with this name and
null
version.
-
get
public final V get(String instrumentationName, @Nullable String instrumentationVersion)
Returns the registered value associated with this name and version if any, otherwise creates a new instance and associates it with the given name and version.- Parameters:
instrumentationName
- the name of the instrumentation library.instrumentationVersion
- the version of the instrumentation library.- Returns:
- the registered value associated with this name and version.
-
getComponents
public final Collection<V> getComponents()
Returns aCollection
view of the registered components.- Returns:
- a
Collection
view of the registered components.
-
-