Class TracerResolver
- java.lang.Object
-
- io.smallrye.opentracing.contrib.resolver.TracerResolver
-
public abstract class TracerResolver extends Object
TracerResolverAPI definition looks for one or more registeredTracerResolverimplementations using theServiceLoader.If no
TracerResolverimplementations are found, theresolveTracer()method will fallback toServiceLoaderlookup of theTracerservice itself.Available
TracerConverterimplementations are applied to the resolvedTracerinstance.None of this happens if there is an existing
GlobalTracerexplicit registration. That will always be returned (as-is) by the resolver, if available.- Author:
- Sjoerd Talsma
-
-
Constructor Summary
Constructors Constructor Description TracerResolver()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static voidreload()Deprecated.This method is now no-op.protected abstract io.opentracing.Tracerresolve()Deprecated.Tracers are encouraged to use theTracerFactoryinterface to provide tracersstatic io.opentracing.TracerresolveTracer()Attempts to resolve a Tracer viaServiceLoaderusing a variety of mechanisms, from the most recommended to the least recommended:static io.opentracing.TracerresolveTracer(ClassLoader classloader)Attempts to resolve a Tracer viaServiceLoaderusing a variety of mechanisms, from the most recommended to the least recommended:
-
-
-
Method Detail
-
resolve
@Deprecated protected abstract io.opentracing.Tracer resolve()
Deprecated.Tracers are encouraged to use theTracerFactoryinterface to provide tracersResolves theTracerimplementation.- Returns:
- The resolved Tracer or
nullif none was resolved.
-
resolveTracer
public static io.opentracing.Tracer resolveTracer()
Attempts to resolve a Tracer viaServiceLoaderusing a variety of mechanisms, from the most recommended to the least recommended:- based on the available
TracerFactory - based on subclasses of
TracerResolver - based on classes of
Tracer
Whenever a Tracer can be resolved by any of the methods above, the resolution stops. It means that if a Factory is found, no Resolvers are attempted to be loaded.
If a
GlobalTracerhas been previously registered, it will be returned before attempting to resolve a Tracer on our own.If more than one
TracerFactoryorTracerResolveris found, the one with the highest priority is returned. Note that if aTracerResolverhas a higher priority than all availableTracerFactory, the factory still wins.- Returns:
- The resolved Tracer or
nullif none was resolved.
- based on the available
-
resolveTracer
public static io.opentracing.Tracer resolveTracer(ClassLoader classloader)
Attempts to resolve a Tracer viaServiceLoaderusing a variety of mechanisms, from the most recommended to the least recommended:- based on the available
TracerFactory - based on subclasses of
TracerResolver - based on classes of
Tracer
Whenever a Tracer can be resolved by any of the methods above, the resolution stops. It means that if a Factory is found, no Resolvers are attempted to be loaded.
If a
GlobalTracerhas been previously registered, it will be returned before attempting to resolve a Tracer on our own.If more than one
TracerFactoryorTracerResolveris found, the one with the highest priority is returned. Note that if aTracerResolverhas a higher priority than all availableTracerFactory, the factory still wins.- Parameters:
classloader- The class loader to be used to load provider-configuration files and provider classes, or null if the thread context class loader to be used.- Returns:
- The resolved Tracer or
nullif none was resolved.
- based on the available
-
reload
@Deprecated public static void reload()
Deprecated.This method is now no-op. It's safe to just remove this method call, as there's no caching anymore.Reloads the lazily found resolvers and the fallback resolver.
-
-