Class AopProxyWriter
java.lang.Object
io.micronaut.aop.writer.ProxyingBeanDefinitionWriter
io.micronaut.aop.writer.AopProxyWriter
- All Implemented Interfaces:
ProxyBuilder<ClassElement, MethodElement, List<OutputObjectDef>>, Buildable<List<OutputObjectDef>>, ElementProxyBuilder<OutputObjectDef>, OriginatingElements
A class that generates AOP proxy classes at compile time.
- Since:
- 1.0
- Author:
- Graeme Rocher
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAopProxyWriter(ClassElement targetType, boolean implementInterface, VisitorContext visitorContext, AnnotationValue<?>... interceptorBinding) Constructs a newAopProxyWriterfor the purposes of writingIntroductionadvise.AopProxyWriter(ClassElement targetType, BeanDefinitionWriter parent, OptionalValues<Boolean> settings, VisitorContext visitorContext, AnnotationValue<?>... interceptorBinding) Constructs a newAopProxyWriterfor the given parentBeanDefinitionWriterand starting interceptors types. -
Method Summary
Modifier and TypeMethodDescriptionaddAroundMethod(MethodElement methodElement) Visit a method that is to be proxied.build()Builds the result.Methods inherited from class ProxyingBeanDefinitionWriter
addIntroductionMethod, addOriginatingElement, addProxyMethod, beanDefinitionBuilder, findOverriddenBy, getConstructor, getCustomBeanDefinitionName, getOriginatingElements, getProxyTarget, implementInterface, postConstructor, processAlreadyVisitedMethods, toTypeString, visitInterceptorBinding
-
Field Details
-
ADDITIONAL_PARAMETERS_COUNT
public static final int ADDITIONAL_PARAMETERS_COUNT- See Also:
-
-
Constructor Details
-
AopProxyWriter
public AopProxyWriter(ClassElement targetType, BeanDefinitionWriter parent, OptionalValues<Boolean> settings, VisitorContext visitorContext, AnnotationValue<?>... interceptorBinding) Constructs a new
AopProxyWriterfor the given parentBeanDefinitionWriterand starting interceptors types.Additional
Interceptortypes can be added downstream withProxyingBeanDefinitionWriter.visitInterceptorBinding(AnnotationValue[]).- Parameters:
targetType- The classElementparent- The parentBeanDefinitionWritersettings- optional settingvisitorContext- The visitor contextinterceptorBinding- The interceptor binding of theInterceptorinstances to be injected
-
AopProxyWriter
public AopProxyWriter(ClassElement targetType, boolean implementInterface, VisitorContext visitorContext, AnnotationValue<?>... interceptorBinding) Constructs a newAopProxyWriterfor the purposes of writingIntroductionadvise.- Parameters:
targetType- The source elementimplementInterface- Whether the interface should be implemented. If false theinterfaceTypesargument should contain at least one entryvisitorContext- The visitor contextinterceptorBinding- The interceptor binding
-
-
Method Details
-
addAroundMethod
Visit a method that is to be proxied.- Specified by:
addAroundMethodin interfaceProxyBuilder<ClassElement, MethodElement, List<OutputObjectDef>>- Overrides:
addAroundMethodin classProxyingBeanDefinitionWriter- Parameters:
methodElement- The method element
-
build
Description copied from interface:BuildableBuilds the result.- Specified by:
buildin interfaceBuildable<List<OutputObjectDef>>- Overrides:
buildin classProxyingBeanDefinitionWriter- Returns:
- The builder result
-