B
- The declaring typeR
- The result of the method call@Internal public class InterceptorChain<B,R> extends 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 MutableConvertibleValues |
attributes |
protected ExecutableMethod<B,R> |
executionHandle |
protected Interceptor<B,R>[] |
interceptors |
protected Map<String,MutableArgumentValue<?>> |
parameters |
protected B |
target |
CLASS_NAME_SUFFIX, EMPTY_METADATA, VALUE_MEMBER
EMPTY
Constructor and Description |
---|
InterceptorChain(Interceptor<B,R>[] interceptors,
B target,
ExecutableMethod<B,R> method,
Object... originalParameters)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
AnnotationMetadata |
getAnnotationMetadata()
Supplies the metadata.
|
Argument[] |
getArguments()
The required argument types.
|
MutableConvertibleValues<Object> |
getAttributes()
Overrides the default
AttributeHolder.getAttributes() method to return a mutable object. |
Map<String,MutableArgumentValue<?>> |
getParameters() |
B |
getTarget() |
R |
invoke(B instance,
Object... arguments)
Invokes the method.
|
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(BeanContext beanContext,
ExecutableMethod<?,?> method,
Interceptor... interceptors)
Resolves the
Around interceptors for a method. |
static Interceptor[] |
resolveIntroductionInterceptors(BeanContext beanContext,
ExecutableMethod<?,?> method,
Interceptor... interceptors)
Resolves the interceptors for a method for
Introduction advise. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getParameterValueMap, getParameterValues, setAttribute
booleanValue, booleanValue, booleanValue, booleanValue, classValue, classValue, classValue, classValue, classValues, classValues, classValues, classValues, doubleValue, doubleValue, doubleValue, enumValue, enumValue, enumValue, enumValue, findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, getAnnotation, getAnnotation, getAnnotationNameByStereotype, getAnnotationNameByStereotype, getAnnotationNames, getAnnotationNamesByStereotype, getAnnotationNamesByStereotype, getAnnotationType, getAnnotationTypeByStereotype, getAnnotationTypeByStereotype, getAnnotationTypesByStereotype, getAnnotationValuesByType, getDeclaredAnnotation, getDeclaredAnnotation, getDeclaredAnnotationNameByStereotype, getDeclaredAnnotationNames, getDeclaredAnnotationNamesByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationValuesByType, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValues, getValues, hasAnnotation, hasAnnotation, hasDeclaredAnnotation, hasDeclaredAnnotation, hasDeclaredStereotype, hasDeclaredStereotype, hasDeclaredStereotype, hasStereotype, hasStereotype, hasStereotype, hasStereotype, intValue, intValue, intValue, isAnnotationPresent, isDeclaredAnnotationPresent, isEmpty, isFalse, isFalse, isPresent, isPresent, isTrue, isTrue, longValue, longValue, stringValue, stringValue, stringValue, stringValue, stringValues, stringValues, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByType
removeAttribute
getAttribute, getAttribute
protected final Interceptor<B,R>[] interceptors
protected final B target
protected final ExecutableMethod<B,R> executionHandle
protected final MutableConvertibleValues attributes
protected final Map<String,MutableArgumentValue<?>> parameters
public InterceptorChain(Interceptor<B,R>[] interceptors, B target, ExecutableMethod<B,R> method, Object... originalParameters)
interceptors
- array of interceptorstarget
- target typemethod
- result methodoriginalParameters
- parameterspublic AnnotationMetadata getAnnotationMetadata()
AnnotationMetadataProvider
AnnotationMetadata.EMPTY_METADATA
.getAnnotationMetadata
in interface AnnotationMetadataProvider
AnnotationMetadata
public MutableConvertibleValues<Object> getAttributes()
MutableAttributeHolder
AttributeHolder.getAttributes()
method to return a mutable object.getAttributes
in interface AttributeHolder
getAttributes
in interface MutableAttributeHolder
public Argument[] getArguments()
Executable
getArguments
in interface Executable<B,R>
public Map<String,MutableArgumentValue<?>> getParameters()
getParameters
in interface InvocationContext<B,R>
ArgumentValue
instancespublic R invoke(B instance, Object... arguments)
Executable
invoke
in interface Executable<B,R>
instance
- The instancearguments
- The argumentspublic B getTarget()
getTarget
in interface InvocationContext<B,R>
public R proceed() throws RuntimeException
InvocationContext
proceed
in interface InvocationContext<B,R>
RuntimeException
- chain may throw RTEpublic R proceed(Interceptor from) throws RuntimeException
InvocationContext
Introduction
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)RuntimeException
- chain may throw RTE@Internal public static Interceptor[] resolveAroundInterceptors(BeanContext beanContext, ExecutableMethod<?,?> method, Interceptor... interceptors)
Around
interceptors for a method.beanContext
- bean context passed inmethod
- The methodinterceptors
- The array of interceptors@Internal public static Interceptor[] resolveIntroductionInterceptors(BeanContext beanContext, ExecutableMethod<?,?> method, Interceptor... interceptors)
Introduction
advise. For Introduction
advise
any Around
advise interceptors are applied firstbeanContext
- Bean Contextmethod
- The methodinterceptors
- The array of interceptors