T
- The bean type@Internal public final class ConstructorInterceptorChain<T> extends java.lang.Object implements ConstructorInvocationContext<T>
InvocationContext
for constructor interception.Modifier and Type | Field and Description |
---|---|
protected io.micronaut.core.convert.value.MutableConvertibleValues<java.lang.Object> |
attributes |
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 |
Modifier and Type | Method and Description |
---|---|
io.micronaut.core.type.Argument<?>[] |
getArguments() |
io.micronaut.core.convert.value.MutableConvertibleValues<java.lang.Object> |
getAttributes() |
io.micronaut.core.beans.BeanConstructor<T> |
getConstructor() |
InterceptorKind |
getKind() |
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.
|
T |
getTarget() |
static <T1> T1 |
instantiate(io.micronaut.context.BeanResolutionContext resolutionContext,
io.micronaut.context.BeanContext beanContext,
java.util.List<io.micronaut.context.BeanRegistration<Interceptor<T1,T1>>> interceptors,
io.micronaut.inject.BeanDefinition<T1> definition,
io.micronaut.core.beans.BeanConstructor<T1> constructor,
int additionalProxyConstructorParametersCount,
java.lang.Object... parameters)
Internal methods that handles the logic of instantiating a bean that has constructor interception applied.
|
static <T1> T1 |
instantiate(io.micronaut.context.BeanResolutionContext resolutionContext,
io.micronaut.context.BeanContext beanContext,
java.util.List<io.micronaut.context.BeanRegistration<Interceptor<T1,T1>>> interceptors,
io.micronaut.inject.BeanDefinition<T1> definition,
io.micronaut.core.beans.BeanConstructor<T1> constructor,
java.lang.Object... parameters)
Deprecated.
|
T |
invoke(T instance,
java.lang.Object... arguments) |
T |
proceed()
Proceeds with the invocation.
|
R |
proceed(Interceptor from)
Proceeds with the invocation using the given interceptor as a position to start from.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDeclaringType, proceed
getParameters, getParameterValueMap, getParameterValues, setAttribute
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
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
@NonNull public InterceptorKind getKind()
getKind
in interface InvocationContext<T,T>
public T getTarget()
getTarget
in interface InvocationContext<T,T>
public T proceed() throws java.lang.RuntimeException
InvocationContext
proceed
in interface ConstructorInvocationContext<T>
proceed
in interface InvocationContext<T,T>
java.lang.RuntimeException
- chain may throw RTE@NonNull public io.micronaut.core.type.Argument<?>[] getArguments()
@NonNull public io.micronaut.core.beans.BeanConstructor<T> getConstructor()
getConstructor
in interface ConstructorInvocationContext<T>
@Internal @NonNull @Deprecated public static <T1> T1 instantiate(@NonNull io.micronaut.context.BeanResolutionContext resolutionContext, @NonNull io.micronaut.context.BeanContext beanContext, @Nullable java.util.List<io.micronaut.context.BeanRegistration<Interceptor<T1,T1>>> interceptors, @NonNull io.micronaut.inject.BeanDefinition<T1> definition, @NonNull io.micronaut.core.beans.BeanConstructor<T1> constructor, @NonNull java.lang.Object... parameters)
T1
- The bean typeresolutionContext
- The resolution contextbeanContext
- The bean contextinterceptors
- The interceptors. Can be null and if so should be resolved from the context.definition
- The definitionconstructor
- The bean constructorparameters
- Th resolved parameters@Internal @NonNull public static <T1> T1 instantiate(@NonNull io.micronaut.context.BeanResolutionContext resolutionContext, @NonNull io.micronaut.context.BeanContext beanContext, @Nullable java.util.List<io.micronaut.context.BeanRegistration<Interceptor<T1,T1>>> interceptors, @NonNull io.micronaut.inject.BeanDefinition<T1> definition, @NonNull io.micronaut.core.beans.BeanConstructor<T1> constructor, int additionalProxyConstructorParametersCount, @NonNull java.lang.Object... parameters)
T1
- The bean typeresolutionContext
- The resolution contextbeanContext
- The bean contextinterceptors
- The interceptors. Can be null and if so should be resolved from the context.definition
- The definitionconstructor
- The bean constructoradditionalProxyConstructorParametersCount
- The additional proxy constructor parameters countparameters
- The resolved parameters@NonNull public java.lang.Object[] getParameterValues()
InvocationContext
InvocationContext.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.AttributeHolder
getAttributes
in interface io.micronaut.core.attr.MutableAttributeHolder
@NonNull public java.util.Map<java.lang.String,io.micronaut.core.type.MutableArgumentValue<?>> getParameters()
InvocationContext
InvocationContext.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
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)java.lang.RuntimeException
- chain may throw RTE