Interface MethodHandler<ReqT,​RespT>

  • Type Parameters:
    ReqT - the request type
    RespT - the response type
    All Superinterfaces:
    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>

    public interface MethodHandler<ReqT,​RespT>
    extends io.grpc.stub.ServerCalls.UnaryMethod<ReqT,​RespT>, io.grpc.stub.ServerCalls.ClientStreamingMethod<ReqT,​RespT>, io.grpc.stub.ServerCalls.ServerStreamingMethod<ReqT,​RespT>, io.grpc.stub.ServerCalls.BidiStreamingMethod<ReqT,​RespT>
    A gRPC method call handler.
    • Method Detail

      • type

        io.grpc.MethodDescriptor.MethodType type()
        Obtain the gRPC method tyoe that this MethodHandler handles.
        Returns:
        the gRPC method type that this MethodHandler handles
      • getRequestType

        Class<?> getRequestType()
        Obtain the request type.
        Returns:
        the request type
      • getResponseType

        Class<?> getResponseType()
        Obtain the response type.
        Returns:
        the response type
      • javaMethodName

        String javaMethodName()
        Obtain the name of the underlying Java method that this handler maps to.
        Returns:
        the name of the underlying Java method that this handler maps to
      • clientOnly

        default boolean clientOnly()
        Determine whether this is a client side only handler.
        Returns:
        true if this handler can only be used on the client
      • invoke

        default void invoke​(ReqT request,
                            io.grpc.stub.StreamObserver<RespT> observer)
        Specified by:
        invoke in interface io.grpc.stub.ServerCalls.ServerStreamingMethod<ReqT,​RespT>
        Specified by:
        invoke in interface io.grpc.stub.ServerCalls.UnaryMethod<ReqT,​RespT>
      • invoke

        default io.grpc.stub.StreamObserver<ReqT> invoke​(io.grpc.stub.StreamObserver<RespT> observer)
        Specified by:
        invoke in interface io.grpc.stub.ServerCalls.BidiStreamingMethod<ReqT,​RespT>
        Specified by:
        invoke in interface io.grpc.stub.ServerCalls.ClientStreamingMethod<ReqT,​RespT>