Package io.micronaut.aop.runtime
Annotation Interface RuntimeProxy
@Documented
@Retention(SOURCE)
@Target({ANNOTATION_TYPE,TYPE,METHOD})
public @interface RuntimeProxy
The annotation used to declare a runtime proxy.
- Since:
- 5.0
- Author:
- Denis Stepanov
-
Required Element Summary
Required ElementsModifier and TypeRequired ElementDescriptionClass<? extends RuntimeProxyCreator> The runtime proxy creator bean class that should be used at runtime to create a proxy. -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanBy default Micronaut will compile subclasses of the target class and call super.foo(..) to invoke the original method since this is more efficient and allows proxied methods to work for calls from within the class.
-
Element Details
-
value
Class<? extends RuntimeProxyCreator> valueThe runtime proxy creator bean class that should be used at runtime to create a proxy.- Returns:
- The runtime proxy creator bean class
-
proxyTarget
boolean proxyTargetBy default Micronaut will compile subclasses of the target class and call super.foo(..) to invoke the original method since this is more efficient and allows proxied methods to work for calls from within the class.
However certain cases it may be useful to be able to to instead proxy all public methods of the original implementation. By setting the value here to
truetheInterceptorcan specify that it requires proxying of the classGenerated subclasses will implement
InterceptedProxyif this attribute is set to true- Returns:
- True if the original implementation should be proxied. Defaults to false.
- Default:
false
-