Class OpenTracingCdiUtils
- java.lang.Object
-
- fish.payara.microprofile.telemetry.tracing.OpenTracingCdiUtils
-
public class OpenTracingCdiUtils extends Object
Utilities class for various CDI-based operations used by the OpenTracing Service classes.- Author:
- Andrew Pielage
, Arjan Tijms
-
-
Constructor Summary
Constructors Constructor Description OpenTracingCdiUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <A extends Annotation>
AgetAnnotation(jakarta.enterprise.inject.spi.BeanManager beanManager, Class<A> annotationClass, jakarta.interceptor.InvocationContext invocationContext)
Gets the annotation from the method that triggered the interceptor.static <A extends Annotation>
AgetAnnotation(jakarta.enterprise.inject.spi.BeanManager beanManager, Class<A> annotationClass, jakarta.ws.rs.container.ResourceInfo resourceInfo)
Gets the annotation from the method that triggered the interceptor.static <A extends Annotation>
AgetAnnotation(jakarta.enterprise.inject.spi.BeanManager beanManager, Class<A> annotationClass, Class<?> annotatedClass, Method method)
static <A extends Annotation,T>
Optional<T>getConfigOverrideValue(Class<A> annotationClass, String parameterName, jakarta.interceptor.InvocationContext invocationContext, Class<T> parameterType)
Gets overriding config parameter values if they're present from an invocation context.static <A extends Annotation,T>
Optional<T>getConfigOverrideValue(Class<A> annotationClass, String parameterName, jakarta.ws.rs.container.ResourceInfo resourceInfo, Class<T> parameterType)
Gets overriding config parameter values if they're present from an invocation context.static <A extends Annotation,T>
Optional<T>getConfigOverrideValue(Class<A> annotationClass, String parameterName, Method method, Class<T> parameterType)
Gets overriding config parameter values if they're present from an invocation context.
-
-
-
Method Detail
-
getAnnotation
public static <A extends Annotation> A getAnnotation(jakarta.enterprise.inject.spi.BeanManager beanManager, Class<A> annotationClass, jakarta.interceptor.InvocationContext invocationContext)
Gets the annotation from the method that triggered the interceptor.- Type Parameters:
A
- The annotation type to return- Parameters:
beanManager
- The invoking interceptor's BeanManagerannotationClass
- The class of the annotation to getinvocationContext
- The context of the method invocation- Returns:
- The annotation that triggered the interceptor.
-
getAnnotation
public static <A extends Annotation> A getAnnotation(jakarta.enterprise.inject.spi.BeanManager beanManager, Class<A> annotationClass, jakarta.ws.rs.container.ResourceInfo resourceInfo)
Gets the annotation from the method that triggered the interceptor.- Type Parameters:
A
- The annotation type to return- Parameters:
beanManager
- The invoking interceptor's BeanManagerannotationClass
- The class of the annotation to getresourceInfo
- The targeted jaxrs resource- Returns:
- The annotation that triggered the interceptor.
-
getAnnotation
public static <A extends Annotation> A getAnnotation(jakarta.enterprise.inject.spi.BeanManager beanManager, Class<A> annotationClass, Class<?> annotatedClass, Method method)
-
getConfigOverrideValue
public static <A extends Annotation,T> Optional<T> getConfigOverrideValue(Class<A> annotationClass, String parameterName, jakarta.interceptor.InvocationContext invocationContext, Class<T> parameterType)
Gets overriding config parameter values if they're present from an invocation context.- Type Parameters:
A
- The annotation type- Parameters:
annotationClass
- The annotation classparameterName
- The name of the parameter to get the override value ofinvocationContext
- The context of the invoking requestparameterType
- The type of the parameter to get the override value of- Returns:
- An Optional containing the override value from the config if there is one
-
getConfigOverrideValue
public static <A extends Annotation,T> Optional<T> getConfigOverrideValue(Class<A> annotationClass, String parameterName, Method method, Class<T> parameterType)
Gets overriding config parameter values if they're present from an invocation context.- Type Parameters:
A
- The annotation type- Parameters:
annotationClass
- The annotation classparameterName
- The name of the parameter to get the override value ofmethod
- The method to be invokedparameterType
- The type of the parameter to get the override value of- Returns:
- An Optional containing the override value from the config if there is one
-
getConfigOverrideValue
public static <A extends Annotation,T> Optional<T> getConfigOverrideValue(Class<A> annotationClass, String parameterName, jakarta.ws.rs.container.ResourceInfo resourceInfo, Class<T> parameterType)
Gets overriding config parameter values if they're present from an invocation context.- Type Parameters:
A
- The annotation type- Parameters:
annotationClass
- The annotation classparameterName
- The name of the parameter to get the override value ofresourceInfo
- The targeted jaxrs resourceparameterType
- The type of the parameter to get the override value of- Returns:
- An Optional containing the override value from the config if there is one
-
-