args.read(iprot);
} catch (TProtocolException e) {
iprot.readMessageEnd();
TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR,
e.getMessage());
oprot.writeMessageBegin(new TMessage(msg.name, TMessageType.EXCEPTION, msg.seqid));
x.write(oprot);
oprot.writeMessageEnd();
oprot.getTransport().flush();
return;
}
iprot.readMessageEnd();
// TODO get rid of following reflection after THRIFT-1465 is fixed.
method = fn.getClass().getDeclaredMethod("getResult", Iface.class, set_ugi_args.class);
method.setAccessible(true);
set_ugi_result result = (set_ugi_result)method.invoke(fn, iface,args);
List<String> principals = result.getSuccess();
// Store the ugi in transport and then continue as usual.
ugiTrans.setClientUGI(shim.createRemoteUser(principals.remove(principals.size()-1),
principals));
oprot.writeMessageBegin(new TMessage(msg.name, TMessageType.REPLY, msg.seqid));
result.write(oprot);
oprot.writeMessageEnd();
oprot.getTransport().flush();
}