/** Get matching method. */ private MethodDescriptor getMethod( SocketRpcProtos.Request rpcRequest, ServiceDescriptor descriptor) throws RpcException { MethodDescriptor method = descriptor.findMethodByName(rpcRequest.getMethodName()); if (method == null) { throw new RpcException( ErrorReason.METHOD_NOT_FOUND, String.format( "Could not find method %s in service %s", rpcRequest.getMethodName(), descriptor.getFullName()), null); } return method; }