Package one.nio.rpc

Class RpcClient

  • All Implemented Interfaces:
    java.io.Closeable, java.io.Serializable, java.lang.AutoCloseable, java.lang.Cloneable, java.lang.Iterable<Socket>, java.lang.reflect.InvocationHandler, java.util.Collection<Socket>, java.util.Deque<Socket>, java.util.List<Socket>, java.util.Queue<Socket>, SocketPoolMXBean

    public class RpcClient
    extends SocketPool
    implements java.lang.reflect.InvocationHandler
    See Also:
    Serialized Form
    • Field Detail

      • uidLocks

        protected static final byte[][] uidLocks
      • remoteMarkerElement

        private final java.lang.StackTraceElement remoteMarkerElement
    • Method Detail

      • invoke

        public java.lang.Object invoke​(java.lang.Object request)
                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • invoke

        public java.lang.Object invoke​(java.lang.Object request,
                                       int timeout)
                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • addLocalStack

        private void addLocalStack​(java.lang.Throwable e,
                                   java.lang.Object remoteRequest)
      • invoke

        public java.lang.Object invoke​(java.lang.Object proxy,
                                       java.lang.reflect.Method method,
                                       java.lang.Object... args)
                                throws java.lang.Exception
        Specified by:
        invoke in interface java.lang.reflect.InvocationHandler
        Throws:
        java.lang.Exception
      • uidLockFor

        protected static java.lang.Object uidLockFor​(long uid)
      • provideSerializer

        protected void provideSerializer​(Serializer serializer)
                                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • requestSerializer

        protected Serializer requestSerializer​(long uid)
                                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • invokeServiceRequest

        protected java.lang.Object invokeServiceRequest​(java.lang.Object request)
                                                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • invokeRaw

        private java.lang.Object invokeRaw​(java.lang.Object request,
                                           int timeout)
                                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • serialize

        private byte[] serialize​(java.lang.Object request)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • sendRequest

        private void sendRequest​(Socket socket,
                                 byte[] buffer,
                                 int timeout)
                          throws java.io.IOException
        Throws:
        java.io.IOException