Interface InterceptedMethod

All Known Subinterfaces:
KotlinInterceptedMethod

public interface InterceptedMethod
The intercept method supporting intercepting different reactive invocations.
Since:
2.1.0
  • Method Details

    • of

      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a new instance of intercept method supporting intercepting different reactive invocations.
      Parameters:
      context - The MethodInvocationContext
      Returns:
      The InterceptedMethod
    • of

      static InterceptedMethod of(MethodInvocationContext<?,?> context, io.micronaut.core.convert.ConversionService conversionService)
      Creates a new instance of intercept method supporting intercepting different reactive invocations.
      Parameters:
      context - The MethodInvocationContext
      conversionService - The conversion service
      Returns:
      The InterceptedMethod
    • resultType

      Returns result type of the method.
      Returns:
      The InterceptedMethod.ResultType
    • returnTypeValue

      io.micronaut.core.type.Argument<?> returnTypeValue()
      Returns result type value.
      Returns:
      The return type value.
    • interceptResult

      Object interceptResult()
      Proceeds with invocation of InvocationContext.proceed() and converts result to appropriate type.
      Returns:
      The intercepted result
    • interceptResult

      Object interceptResult(Interceptor<?,?> from)
      Proceeds with invocation of InvocationContext.proceed(Interceptor) and converts result to appropriate type.
      Parameters:
      from - The interceptor to start from
      Returns:
      The intercepted result
    • interceptResultAsCompletionStage

      default CompletionStage<?> interceptResultAsCompletionStage()
      Proceeds with invocation of InvocationContext.proceed() and converts result to CompletionStage.
      Returns:
      The intercepted result
    • interceptResultAsPublisher

      default org.reactivestreams.Publisher<?> interceptResultAsPublisher()
      Proceeds with invocation of InvocationContext.proceed() and converts result to Publisher.
      Returns:
      The intercepted result
    • interceptResultAsPublisher

      default org.reactivestreams.Publisher<?> interceptResultAsPublisher(ExecutorService executorService)
      Proceeds with invocation of InvocationContext.proceed() and converts result to Publisher.
      Parameters:
      executorService - The executor service to subscribe on
      Returns:
      The intercepted result
    • interceptResultAsCompletionStage

      default CompletionStage<?> interceptResultAsCompletionStage(Interceptor<?,?> from)
      Proceeds with invocation of InvocationContext.proceed(Interceptor) and converts result to CompletionStage.
      Parameters:
      from - The interceptor to start from
      Returns:
      The intercepted result
    • interceptResultAsPublisher

      default org.reactivestreams.Publisher<?> interceptResultAsPublisher(Interceptor<?,?> from)
      Proceeds with invocation of InvocationContext.proceed(Interceptor) and converts result to Publisher.
      Parameters:
      from - The interceptor to start from
      Returns:
      The intercepted result
    • handleResult

      Object handleResult(Object result)
      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

      <E extends Throwable> Object handleException(Exception exception) throws E
      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

      default Object unsupported()
      Indicated unsupported return type.
      Returns:
      The result of the invocation being returned from the interceptor