Package io.micronaut.aop
Interface ConstructorInterceptor<T>
-
- Type Parameters:
T- The bean type
- All Superinterfaces:
Interceptor<T,T>,io.micronaut.core.order.Ordered
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface ConstructorInterceptor<T> extends Interceptor<T,T>
AConstructorInterceptorextends the defaultInterceptorinterface and allows intercepting constructors.- Since:
- 3.0.0
-
-
Field Summary
-
Fields inherited from interface io.micronaut.aop.Interceptor
ARGUMENT, CACHEABLE_LAZY_TARGET, HOTSWAP, LAZY, PROXY_TARGET
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Tintercept(ConstructorInvocationContext<T> context)Extended version of theintercept(InvocationContext)method that accepts aConstructorInvocationContext.default Tintercept(InvocationContext<T,T> context)Intercepts an execution from a declaredAroundadvice.
-
-
-
Method Detail
-
intercept
@NonNull T intercept(@NonNull ConstructorInvocationContext<T> context)
Extended version of theintercept(InvocationContext)method that accepts aConstructorInvocationContext.It is illegal for constructor interceptors to return
nulland an exception will be thrown if this occurs.- Parameters:
context- The context- Returns:
- The constructed object. Should never be
null.
-
intercept
@NonNull default T intercept(@NonNull InvocationContext<T,T> context)
Description copied from interface:InterceptorIntercepts an execution from a declaredAroundadvice. The implementation can either callInvocationContext.proceed()to return the original value or provide a replacement value- Specified by:
interceptin interfaceInterceptor<T,T>- Parameters:
context- The interception context- Returns:
- result type
-
-