RPCProtos.RpcRequestBody rpcRequest, long receiveTime) throws IOException {
try {
String methodName = rpcRequest.getMethodName();
Method method = getMethod(protocol, methodName);
if (method == null) {
throw new UnknownProtocolException("Method " + methodName
+ " doesn't exist in protocol " + protocol.getName());
}
long clientVersion = rpcRequest.getClientProtocolVersion();
// get an instance of the method arg type
Message protoType = getMethodArgType(method);
Message param = protoType.newBuilderForType()
.mergeFrom(rpcRequest.getRequest()).build();
Message result;
Object impl = null;
if (protocol.isAssignableFrom(this.implementation)) {
impl = this.instance;
} else {
throw new UnknownProtocolException(protocol, "the server class is "
+ this.implementation.getName());
}
long startTime = System.currentTimeMillis();
if (method.getParameterTypes().length == 2) {