Package io.micronaut.aop
Interface InterceptedMethod
- All Known Subinterfaces:
KotlinInterceptedMethod
public interface InterceptedMethod
The intercept method supporting intercepting different reactive invocations.
- Since:
- 2.1.0
- Author:
- Denis Stepanov
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
Possible result types. -
Method Summary
Modifier and TypeMethodDescriptionhandleException
(Exception exception) Handle the exception that should be thrown out of the invocation.handleResult
(Object result) Handle the value that should be the result of the invocation.Proceeds with invocation ofInvocationContext.proceed()
and converts result to appropriate type.interceptResult
(Interceptor<?, ?> from) Proceeds with invocation ofInvocationContext.proceed(Interceptor)
and converts result to appropriate type.default CompletionStage<?>
Proceeds with invocation ofInvocationContext.proceed()
and converts result toCompletionStage
.default CompletionStage<?>
interceptResultAsCompletionStage
(Interceptor<?, ?> from) Proceeds with invocation ofInvocationContext.proceed(Interceptor)
and converts result toCompletionStage
.default Publisher<?>
Proceeds with invocation ofInvocationContext.proceed()
and converts result toPublisher
.default Publisher<?>
interceptResultAsPublisher
(Interceptor<?, ?> from) Proceeds with invocation ofInvocationContext.proceed(Interceptor)
and converts result toPublisher
.default Publisher<?>
interceptResultAsPublisher
(ExecutorService executorService) Proceeds with invocation ofInvocationContext.proceed()
and converts result toPublisher
.static InterceptedMethod
of
(MethodInvocationContext<?, ?> context) Deprecated, for removal: This API element is subject to removal in a future version.static InterceptedMethod
of
(MethodInvocationContext<?, ?> context, ConversionService conversionService) Creates a new instance of intercept method supporting intercepting different reactive invocations.Returns result type of the method.Argument<?>
Returns result type value.default Object
Indicated unsupported return type.
-
Method Details
-
of
@Deprecated(since="4", forRemoval=true) static InterceptedMethod of(MethodInvocationContext<?, ?> context) Deprecated, for removal: This API element is subject to removal in a future version.replaced withof(MethodInvocationContext, ConversionService)
Creates a new instance of intercept method supporting intercepting different reactive invocations.- Parameters:
context
- TheMethodInvocationContext
- Returns:
- The
InterceptedMethod
-
of
static InterceptedMethod of(MethodInvocationContext<?, ?> context, ConversionService conversionService) Creates a new instance of intercept method supporting intercepting different reactive invocations.- Parameters:
context
- TheMethodInvocationContext
conversionService
- The conversion service- Returns:
- The
InterceptedMethod
-
resultType
InterceptedMethod.ResultType resultType()Returns result type of the method.- Returns:
- The
InterceptedMethod.ResultType
-
returnTypeValue
Argument<?> returnTypeValue()Returns result type value.- Returns:
- The return type value.
-
interceptResult
Object interceptResult()Proceeds with invocation ofInvocationContext.proceed()
and converts result to appropriate type.- Returns:
- The intercepted result
-
interceptResult
Proceeds with invocation ofInvocationContext.proceed(Interceptor)
and converts result to appropriate type.- Parameters:
from
- The interceptor to start from- Returns:
- The intercepted result
-
interceptResultAsCompletionStage
Proceeds with invocation ofInvocationContext.proceed()
and converts result toCompletionStage
.- Returns:
- The intercepted result
-
interceptResultAsPublisher
Proceeds with invocation ofInvocationContext.proceed()
and converts result toPublisher
.- Returns:
- The intercepted result
-
interceptResultAsPublisher
Proceeds with invocation ofInvocationContext.proceed()
and converts result toPublisher
.- Parameters:
executorService
- The executor service to subscribe on- Returns:
- The intercepted result
-
interceptResultAsCompletionStage
Proceeds with invocation ofInvocationContext.proceed(Interceptor)
and converts result toCompletionStage
.- Parameters:
from
- The interceptor to start from- Returns:
- The intercepted result
-
interceptResultAsPublisher
Proceeds with invocation ofInvocationContext.proceed(Interceptor)
and converts result toPublisher
.- Parameters:
from
- The interceptor to start from- Returns:
- The intercepted result
-
handleResult
Handle the value that should be the result of the invocation.- Parameters:
result
- The result of the invocation- Returns:
- The result of the invocation being returned from the interceptor
-
handleException
Handle the exception that should be thrown out of the invocation.- Type Parameters:
E
- Sneaky throws helper- Parameters:
exception
- The exception- Returns:
- The result of the invocation being returned from the interceptor
- Throws:
E
- The exception
-
unsupported
Indicated unsupported return type.- Returns:
- The result of the invocation being returned from the interceptor
-
of(MethodInvocationContext, ConversionService)