Class RPCSend

  • All Implemented Interfaces:
    com.yahoo.jrt.MethodHandler, com.yahoo.jrt.RequestWaiter, RPCSendAdapter, ReplyHandler
    Direct Known Subclasses:
    RPCSendV1, RPCSendV2

    public abstract class RPCSend
    extends Object
    implements com.yahoo.jrt.MethodHandler, ReplyHandler, com.yahoo.jrt.RequestWaiter, RPCSendAdapter
    Implements the request adapter for method "mbus.send1/mbus.slime".
    Author:
    baldersheim
    • Constructor Detail

    • Method Detail

      • buildMethod

        protected abstract com.yahoo.jrt.Method buildMethod()
      • getReturnSpec

        protected abstract String getReturnSpec()
      • encodeRequest

        protected abstract com.yahoo.jrt.Request encodeRequest​(com.yahoo.component.Version version,
                                                               Route route,
                                                               RPCServiceAddress address,
                                                               Message msg,
                                                               long timeRemaining,
                                                               byte[] payload,
                                                               int traceLevel)
      • createReply

        protected abstract Reply createReply​(com.yahoo.jrt.Values ret,
                                             String serviceName,
                                             Trace trace)
      • toParams

        protected abstract RPCSend.Params toParams​(com.yahoo.jrt.Values req)
      • createResponse

        protected abstract void createResponse​(com.yahoo.jrt.Values ret,
                                               Reply reply,
                                               com.yahoo.component.Version version,
                                               byte[] payload)
      • send

        public final void send​(RoutingNode recipient,
                               com.yahoo.component.Version version,
                               byte[] payload,
                               long timeRemaining)
        Description copied from interface: RPCSendAdapter
        Performs the actual sending to the given recipient.
        Specified by:
        send in interface RPCSendAdapter
        Parameters:
        recipient - The recipient to send to.
        version - The version for which the payload is serialized.
        payload - The already serialized payload of the message to send.
        timeRemaining - The time remaining until the message expires.
      • decode

        protected final Object decode​(com.yahoo.text.Utf8Array protocolName,
                                      com.yahoo.component.Version version,
                                      byte[] payload)
      • handleRequestDone

        public final void handleRequestDone​(com.yahoo.jrt.Request req)
        Specified by:
        handleRequestDone in interface com.yahoo.jrt.RequestWaiter
      • invoke

        public final void invoke​(com.yahoo.jrt.Request request)
        Specified by:
        invoke in interface com.yahoo.jrt.MethodHandler
      • handleReply

        public final void handleReply​(Reply reply)
        Description copied from interface: ReplyHandler
        This function is called when a reply arrives.
        Specified by:
        handleReply in interface ReplyHandler
        Parameters:
        reply - The reply that arrived.