B - The declaring typeR - The result of the method call@Internal public class InterceptorChain<B,R> extends java.lang.Object implements InvocationContext<B,R>
Interceptor chain. This class implements InvocationContext and is
consumed by the framework itself and should not be used directly in application code.| Modifier and Type | Field and Description |
|---|---|
protected io.micronaut.core.convert.value.MutableConvertibleValues<java.lang.Object> |
attributes |
protected io.micronaut.inject.ExecutableMethod<B,R> |
executionHandle |
protected int |
index |
protected int |
interceptorCount |
protected Interceptor<B,R>[] |
interceptors |
protected static org.slf4j.Logger |
LOG |
protected java.lang.Object[] |
originalParameters |
protected java.util.Map<java.lang.String,io.micronaut.core.type.MutableArgumentValue<?>> |
parameters |
protected B |
target |
| Constructor and Description |
|---|
InterceptorChain(Interceptor<B,R>[] interceptors,
B target,
io.micronaut.inject.ExecutableMethod<B,R> method,
java.lang.Object... originalParameters)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
io.micronaut.core.annotation.AnnotationMetadata |
getAnnotationMetadata() |
io.micronaut.core.type.Argument[] |
getArguments() |
io.micronaut.core.convert.value.MutableConvertibleValues<java.lang.Object> |
getAttributes() |
java.util.Map<java.lang.String,io.micronaut.core.type.MutableArgumentValue<?>> |
getParameters()
Returns the current parameters as a map of mutable argument values.
|
java.lang.Object[] |
getParameterValues()
Returns the current state of the parameters as an array by parameter index.
|
B |
getTarget() |
R |
invoke(B instance,
java.lang.Object... arguments) |
R |
proceed()
Proceeds with the invocation.
|
R |
proceed(Interceptor from)
Proceeds with the invocation using the given interceptor as a position to start from.
|
static Interceptor[] |
resolveAroundInterceptors(io.micronaut.context.BeanContext beanContext,
io.micronaut.inject.ExecutableMethod<?,?> method,
Interceptor... interceptors)
Deprecated.
|
static Interceptor[] |
resolveAroundInterceptors(io.micronaut.context.BeanContext beanContext,
io.micronaut.inject.ExecutableMethod<?,?> method,
java.util.List<io.micronaut.context.BeanRegistration<Interceptor<?,?>>> interceptors)
Resolves the
Around interceptors for a method. |
static Interceptor[] |
resolveIntroductionInterceptors(io.micronaut.context.BeanContext beanContext,
io.micronaut.inject.ExecutableMethod<?,?> method,
Interceptor... interceptors)
Deprecated.
|
static Interceptor[] |
resolveIntroductionInterceptors(io.micronaut.context.BeanContext beanContext,
io.micronaut.inject.ExecutableMethod<?,?> method,
java.util.List<io.micronaut.context.BeanRegistration<Interceptor<?,?>>> interceptors)
Resolves the
Introduction interceptors for a method. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDeclaringType, getKind, getParameters, getParameterValueMap, getParameterValues, proceed, setAttributebooleanValue, booleanValue, booleanValue, booleanValue, classValue, classValue, classValue, classValue, classValues, classValues, classValues, classValues, doubleValue, doubleValue, doubleValue, enumValue, enumValue, enumValue, enumValue, enumValues, enumValues, enumValues, enumValues, findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, findRepeatableAnnotation, findRepeatableAnnotation, getAnnotation, getAnnotation, getAnnotationNameByStereotype, getAnnotationNameByStereotype, getAnnotationNames, getAnnotationNamesByStereotype, getAnnotationNamesByStereotype, getAnnotationType, getAnnotationType, getAnnotationTypeByStereotype, getAnnotationTypeByStereotype, getAnnotationTypesByStereotype, getAnnotationTypesByStereotype, getAnnotationTypesByStereotype, getAnnotationValuesByType, getDeclaredAnnotation, getDeclaredAnnotation, getDeclaredAnnotationNameByStereotype, getDeclaredAnnotationNames, getDeclaredAnnotationNamesByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationValuesByType, getDeclaredMetadata, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValues, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValues, getValues, hasAnnotation, hasAnnotation, hasDeclaredAnnotation, hasDeclaredAnnotation, hasDeclaredStereotype, hasDeclaredStereotype, hasDeclaredStereotype, hasPropertyExpressions, hasSimpleAnnotation, hasSimpleDeclaredAnnotation, hasStereotype, hasStereotype, hasStereotype, hasStereotype, intValue, intValue, intValue, isAnnotationPresent, isDeclaredAnnotationPresent, isEmpty, isFalse, isFalse, isPresent, isPresent, isRepeatableAnnotation, isRepeatableAnnotation, isTrue, isTrue, longValue, longValue, stringValue, stringValue, stringValue, stringValue, stringValues, stringValues, stringValues, stringValues, synthesize, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByTypegetAnnotationValuesByName, getDeclaredAnnotationValuesByName, getValues, hasDeclaredStereotype, isAnnotationPresent, isDeclaredAnnotationPresentprotected final B target
protected static final org.slf4j.Logger LOG
protected final Interceptor<B,R>[] interceptors
protected final java.lang.Object[] originalParameters
protected final int interceptorCount
protected io.micronaut.core.convert.value.MutableConvertibleValues<java.lang.Object> attributes
protected int index
protected java.util.Map<java.lang.String,io.micronaut.core.type.MutableArgumentValue<?>> parameters
public InterceptorChain(Interceptor<B,R>[] interceptors, B target, io.micronaut.inject.ExecutableMethod<B,R> method, java.lang.Object... originalParameters)
interceptors - array of interceptorstarget - target typemethod - result methodoriginalParameters - parameterspublic io.micronaut.core.annotation.AnnotationMetadata getAnnotationMetadata()
getAnnotationMetadata in interface io.micronaut.core.annotation.AnnotationMetadataProviderpublic io.micronaut.core.type.Argument[] getArguments()
public B getTarget()
getTarget in interface InvocationContext<B,R>public R proceed() throws java.lang.RuntimeException
InvocationContextproceed in interface InvocationContext<B,R>java.lang.RuntimeException - chain may throw RTE@Internal public static Interceptor[] resolveAroundInterceptors(@Nullable io.micronaut.context.BeanContext beanContext, io.micronaut.inject.ExecutableMethod<?,?> method, java.util.List<io.micronaut.context.BeanRegistration<Interceptor<?,?>>> interceptors)
Around interceptors for a method.beanContext - bean context passed inmethod - The methodinterceptors - The array of interceptors@Internal public static Interceptor[] resolveIntroductionInterceptors(@Nullable io.micronaut.context.BeanContext beanContext, io.micronaut.inject.ExecutableMethod<?,?> method, java.util.List<io.micronaut.context.BeanRegistration<Interceptor<?,?>>> interceptors)
Introduction interceptors for a method.beanContext - bean context passed inmethod - The methodinterceptors - The array of interceptors@Internal @Deprecated public static Interceptor[] resolveAroundInterceptors(@Nullable io.micronaut.context.BeanContext beanContext, io.micronaut.inject.ExecutableMethod<?,?> method, Interceptor... interceptors)
resolveAroundInterceptors(BeanContext, ExecutableMethod, List)Around interceptors for a method.beanContext - bean context passed inmethod - The methodinterceptors - The array of interceptors@Internal @Deprecated public static Interceptor[] resolveIntroductionInterceptors(@Nullable io.micronaut.context.BeanContext beanContext, io.micronaut.inject.ExecutableMethod<?,?> method, Interceptor... interceptors)
Introduction advise. For Introduction advise
any Around advise interceptors are applied firstbeanContext - Bean Contextmethod - The methodinterceptors - The array of interceptors@NonNull public java.lang.Object[] getParameterValues()
InvocationContextInvocationContext.getParameters() and the MutableArgumentValue interface insteadgetParameterValues in interface InvocationContext<B,R>ArgumentValue instances@NonNull public io.micronaut.core.convert.value.MutableConvertibleValues<java.lang.Object> getAttributes()
getAttributes in interface io.micronaut.core.attr.AttributeHoldergetAttributes in interface io.micronaut.core.attr.MutableAttributeHolder@NonNull public java.util.Map<java.lang.String,io.micronaut.core.type.MutableArgumentValue<?>> getParameters()
InvocationContextInvocationContext.getParameterValues() and Executable.getArguments() directly, hence
should be used with care.getParameters in interface InvocationContext<B,R>ArgumentValue instancespublic R proceed(@NonNull
Interceptor from)
throws java.lang.RuntimeException
InvocationContextIntroduction advise where you want to
invoke the target multiple times or where you want to repeat the entire chain.proceed in interface InvocationContext<B,R>from - The interceptor to start from (note: will not be included in the execution)java.lang.RuntimeException - chain may throw RTE