Hi Genius,

I don't understand the following code segment in the server.java:

              value =
                call.connection.user.doAs
                  (new PrivilegedExceptionAction<Writable>() {
                     @Override
                     public Writable run() throws Exception {
                       // make the call
                       return call(call.rpcKind,
call.connection.protocolName,
                                   call.getRpcRequest(), call.timestamp);

                     }
                   }
                  );


I know that it will call the following code in the RPC.java:
    public Writable call(RPC.RpcKind rpcKind, String protocol,
        Writable rpcRequest, long receiveTime) throws Exception {
      return getRpcInvoker(rpcKind).call(this, protocol, rpcRequest,
          receiveTime);
    }


Could you please explain how it is related between server.java and
RPC.java, and why the call in the server.java will call the call in the
RPC.java? Thanks a lot in advance.

Reply via email to