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
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumPossible result types. -
Method Summary
Modifier and TypeMethodDescriptionhandleException(Exception exception) Handle the exception that should be thrown out of the invocation.@Nullable ObjecthandleResult(@Nullable Object result) Handle the value that should be the result of the invocation.@Nullable ObjectProceeds with invocation ofInvocationContext.proceed()and converts result to appropriate type.@Nullable ObjectinterceptResult(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 InterceptedMethodof(MethodInvocationContext<?, ?> context) Deprecated, for removal: This API element is subject to removal in a future version.static InterceptedMethodof(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 ObjectIndicated 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- TheMethodInvocationContextconversionService- The conversion service- Returns:
- The
InterceptedMethod
-
resultType
InterceptedMethod.ResultType resultType()Returns result type of the method.- Returns:
- The
InterceptedMethod.ResultType
-
returnTypeValue
-
interceptResult
@Nullable 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
-
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)