T
- The declaring typeR
- The result of the method callpublic interface InvocationContext<T,R> extends Executable<T,R>, AnnotationMetadataDelegate, MutableAttributeHolder
An InvocationContext passed to one or many Interceptor
instances. Attributes can be stored within the
context and shared between multiple Interceptor
implementations. The proceed()
method should be
called to proceed to the next Interceptor
with the last interceptor in the chain being the original
decorated method implementation.
The parameters to pass to the next Interceptor
can be mutated using MutableArgumentValue
interface returned by the getParameters()
method
CLASS_NAME_SUFFIX, EMPTY_METADATA, VALUE_MEMBER
EMPTY
Modifier and Type | Method and Description |
---|---|
default java.lang.Class<T> |
getDeclaringType() |
default InterceptorKind |
getKind() |
java.util.Map<java.lang.String,MutableArgumentValue<?>> |
getParameters()
Returns the current parameters as a map of mutable argument values.
|
default java.util.Map<java.lang.String,java.lang.Object> |
getParameterValueMap()
Returns the current state of the parameters as a map keyed by parameter name.
|
default java.lang.Object[] |
getParameterValues()
Returns the current state of the parameters as an array by parameter index.
|
T |
getTarget() |
R |
proceed()
Proceeds with the invocation.
|
R |
proceed(Interceptor from)
Proceeds with the invocation using the given interceptor as a position to start from.
|
default InvocationContext<T,R> |
setAttribute(java.lang.CharSequence name,
java.lang.Object value)
Sets an attribute on the message.
|
getArguments, invoke
booleanValue, 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, synthesizeDeclaredAnnotationsByType
getAnnotationMetadata
getValues, hasDeclaredStereotype, isAnnotationPresent, isDeclaredAnnotationPresent
getAttributes, removeAttribute
getAttribute, getAttribute
@NonNull java.util.Map<java.lang.String,MutableArgumentValue<?>> getParameters()
getParameterValues()
and Executable.getArguments()
directly, hence
should be used with care.ArgumentValue
instances@Nullable R proceed() throws java.lang.RuntimeException
java.lang.RuntimeException
- chain may throw RTE@Nullable R proceed(Interceptor from) throws java.lang.RuntimeException
Introduction
advise where you want to
invoke the target multiple times or where you want to repeat the entire chain.from
- The interceptor to start from (note: will not be included in the execution)java.lang.RuntimeException
- chain may throw RTE@NonNull default InterceptorKind getKind()
default java.lang.Class<T> getDeclaringType()
getDeclaringType
in interface Executable<T,R>
default InvocationContext<T,R> setAttribute(@NonNull java.lang.CharSequence name, java.lang.Object value)
MutableAttributeHolder
setAttribute
in interface MutableAttributeHolder
name
- The name of the attributevalue
- The value of the attribute@NonNull default java.lang.Object[] getParameterValues()
getParameters()
and the MutableArgumentValue
interface insteadArgumentValue
instances@NonNull default java.util.Map<java.lang.String,java.lang.Object> getParameterValueMap()