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 java.lang.Object
    implements com.yahoo.jrt.MethodHandler, ReplyHandler, com.yahoo.jrt.RequestWaiter, RPCSendAdapter
    Implements the request adapter for method "mbus.send1/mbus.slime".
    Author:
    baldersheim
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      protected class  RPCSend.Params  
    • Constructor Summary

      Constructors 
      Constructor Description
      RPCSend()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void attach​(RPCNetwork net)
      Attaches this adapter to the given network.
      protected abstract com.yahoo.jrt.Method buildMethod()  
      protected abstract Reply createReply​(com.yahoo.jrt.Values ret, java.lang.String serviceName, Trace trace)  
      protected abstract void createResponse​(com.yahoo.jrt.Values ret, Reply reply, com.yahoo.component.Version version, byte[] payload)  
      protected java.lang.Object decode​(com.yahoo.text.Utf8Array protocolName, com.yahoo.component.Version version, byte[] payload)  
      protected abstract com.yahoo.jrt.Request encodeRequest​(com.yahoo.component.Version version, Route route, RPCServiceAddress address, Message msg, long timeRemaining, byte[] payload, int traceLevel)  
      protected abstract java.lang.String getReturnSpec()  
      void handleReply​(Reply reply)
      This function is called when a reply arrives.
      void handleRequestDone​(com.yahoo.jrt.Request req)  
      void invoke​(com.yahoo.jrt.Request request)  
      void send​(RoutingNode recipient, com.yahoo.component.Version version, byte[] payload, long timeRemaining)
      Performs the actual sending to the given recipient.
      protected abstract RPCSend.Params toParams​(com.yahoo.jrt.Values req)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RPCSend

        public RPCSend()
    • Method Detail

      • buildMethod

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

        protected abstract java.lang.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,
                                             java.lang.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)
      • attach

        public final void attach​(RPCNetwork net)
        Description copied from interface: RPCSendAdapter
        Attaches this adapter to the given network.
        Specified by:
        attach in interface RPCSendAdapter
        Parameters:
        net - The network to attach to.
      • 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 java.lang.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.