Class UnaryMethodHandlerSupplier.FutureResponseNoRequest<ReqT,RespT>

Type Parameters:
ReqT - the request type
RespT - the response type
All Implemented Interfaces:
io.grpc.stub.ServerCalls.BidiStreamingMethod<ReqT,RespT>, io.grpc.stub.ServerCalls.ClientStreamingMethod<ReqT,RespT>, io.grpc.stub.ServerCalls.ServerStreamingMethod<ReqT,RespT>, io.grpc.stub.ServerCalls.UnaryMethod<ReqT,RespT>, MethodHandler<ReqT,RespT>
Enclosing class:

public static class UnaryMethodHandlerSupplier.FutureResponseNoRequest<ReqT,RespT> extends UnaryMethodHandlerSupplier.AbstractUnaryHandler<ReqT,RespT>
A unary MethodHandler that calls a handler method of the form.
     CompletableFuture<ResT> invoke()

If the future returned completes normally and has a none null none Void result then that result will be passed to the StreamObserver.onNext(Object) method. If the future completes exceptionally then the error will be passed to the StreamObserver.onError(Throwable) method.

  • Method Details

    • invoke

      protected void invoke(Method method, Object instance, ReqT request, io.grpc.stub.StreamObserver<RespT> observer) throws InvocationTargetException, IllegalAccessException
      Description copied from class: io.helidon.microprofile.grpc.core.AbstractMethodHandlerSupplier.AbstractHandler
      Invoke the actual unary or server streaming gRPC method handler.
      Specified by:
      invoke in class io.helidon.microprofile.grpc.core.AbstractMethodHandlerSupplier.AbstractHandler<ReqT,RespT>
      method - the Method to invoke
      instance - the service instance to invoke the method on
      request - the method request
      observer - the method response observer
      InvocationTargetException - if an error occurs invoking the method
      IllegalAccessException - if the method cannot be accessed
    • unary

      public Object unary(Object[] args, MethodHandler.UnaryClient client)
      Invoke the client call.

      The call is from a method signature:

           CompletableFuture<ResT> invoke()
      so there is no request parameter.
      args - the call arguments.
      client - the MethodHandler.UnaryClient instance to forward the call to
      the method signature return is void so this method always returns null