public class FaultToleranceUtils extends Object
Constructor and Description |
---|
FaultToleranceUtils() |
Modifier and Type | Method and Description |
---|---|
static <A extends Annotation> |
getAnnotatedMethodClass(javax.interceptor.InvocationContext context,
Class<A> annotationClass)
Returns either the CDI Proxy class (for cases where a class extends another without overriding the target method),
or the actual declaring class if the annotation isn't present on the proxy class.
|
static <A extends Annotation> |
getAnnotation(Stereotypes sterotypes,
Class<A> annotationClass,
javax.interceptor.InvocationContext context)
Gets the annotation from the method that triggered the interceptor.
|
static String |
getCanonicalMethodName(javax.interceptor.InvocationContext context)
Gets the full method signature from an invocation context, stripping out any Weld proxy name gubbins.
|
static <A extends Annotation> |
getEnabledOverrideValue(org.eclipse.microprofile.config.Config config,
Class<A> annotationType,
javax.interceptor.InvocationContext context,
boolean defaultValue)
Gets overriding config enabled parameter value if it's present from an invocation context.
|
static <A extends Annotation,T> |
getOverrideValue(org.eclipse.microprofile.config.Config config,
Class<A> annotationType,
String parameterName,
javax.interceptor.InvocationContext context,
Class<T> parameterType,
T defaultValue)
Gets overriding config parameter values if they're present from an invocation context.
|
static <A extends Annotation> |
getPlainCanonicalName(Class<?> type)
Helper method that gets the canonical name of an annotated class.
|
static boolean |
isAnnotatedWithFaultToleranceAnnotations(javax.enterprise.inject.spi.Annotated element) |
static <T> Class<? extends T>[] |
toClassArray(String classNames,
String attributeName,
Class<? extends T>[] defaultValue) |
public static <A extends Annotation> A getAnnotation(Stereotypes sterotypes, Class<A> annotationClass, javax.interceptor.InvocationContext context)
A
- The annotation type to returnsterotypes
- The invoking interceptor's context on sterotype annotationsannotationClass
- The class of the annotation to getcontext
- The context of the method invocationpublic static <A extends Annotation,T> T getOverrideValue(org.eclipse.microprofile.config.Config config, Class<A> annotationType, String parameterName, javax.interceptor.InvocationContext context, Class<T> parameterType, T defaultValue)
A
- The annotation typeconfig
- The config to get the overriding parameter values fromannotationType
- The annotation classparameterName
- The name of the parameter to get the override value ofcontext
- The context of the invoking requestparameterType
- The type of the parameter to get the override value ofpublic static <A extends Annotation> boolean getEnabledOverrideValue(org.eclipse.microprofile.config.Config config, Class<A> annotationType, javax.interceptor.InvocationContext context, boolean defaultValue)
A
- The annotation typeconfig
- The config to get the overriding enabled value fromannotationType
- The annotation classcontext
- The context of the invoking requestpublic static <A extends Annotation> Class<?> getAnnotatedMethodClass(javax.interceptor.InvocationContext context, Class<A> annotationClass)
A
- The class of the annotationcontext
- The context of the method invocationannotationClass
- The class of the annotationpublic static <A extends Annotation> String getPlainCanonicalName(Class<?> type)
A
- The class of the annotationtype
- The class of the annotationpublic static String getCanonicalMethodName(javax.interceptor.InvocationContext context)
context
- The context of the method invocationmy.pack.MyClass.myMethod
public static boolean isAnnotatedWithFaultToleranceAnnotations(javax.enterprise.inject.spi.Annotated element)
Copyright © 2019. All rights reserved.