Package io.micronaut.aop
Interface ConstructorInterceptor<T>
- Type Parameters:
T
- The bean type
- All Superinterfaces:
Interceptor<T,
,T> Ordered
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A
ConstructorInterceptor
extends the default Interceptor
interface and allows intercepting constructors.- Since:
- 3.0.0
- Author:
- graemerocher
-
Field Summary
Fields inherited from interface io.micronaut.aop.Interceptor
ARGUMENT, CACHEABLE_LAZY_TARGET, HOTSWAP, LAZY, PROXY_TARGET
Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Method Summary
Modifier and TypeMethodDescriptionintercept
(@NonNull ConstructorInvocationContext<T> context) Extended version of theintercept(InvocationContext)
method that accepts aConstructorInvocationContext
.default T
intercept
(@NonNull InvocationContext<T, T> context) Intercepts an execution from a declaredAround
advice.
-
Method Details
-
intercept
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
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
-