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>
AConstructorInterceptor
extends the defaultInterceptor
interface 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 T
intercept(ConstructorInvocationContext<T> context)
Extended version of theintercept(InvocationContext)
method that accepts aConstructorInvocationContext
.default T
intercept(InvocationContext<T,T> context)
Intercepts an execution from a declaredAround
advice.
-
-
-
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
null
and 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:Interceptor
Intercepts an execution from a declaredAround
advice. The implementation can either callInvocationContext.proceed()
to return the original value or provide a replacement value- Specified by:
intercept
in interfaceInterceptor<T,T>
- Parameters:
context
- The interception context- Returns:
- result type
-
-