/**
* Loops on processing a client forever
*/
public void run() {
TProcessor processor = null;
TTransport inputTransport = null;
TTransport outputTransport = null;
TProtocol inputProtocol = null;
TProtocol outputProtocol = null;
try {
processor = processorFactory_.getProcessor(client_);
inputTransport = inputTransportFactory_.getTransport(client_);
inputProtocol = inputProtocolFactory_.getProtocol(inputTransport);
// THeaderProtocol must be the same instance for both input and output
if (inputProtocol instanceof THeaderProtocol) {
outputProtocol = inputProtocol;
} else {
outputTransport = outputTransportFactory_.getTransport(client_);
outputProtocol = outputProtocolFactory_.getProtocol(outputTransport);
}
// we check stopped_ first to make sure we're not supposed to be shutting
// down. this is necessary for graceful shutdown.
TRpcConnectionContext server_ctx = new TRpcConnectionContext(client_,
inputProtocol,
outputProtocol);
while (!stopped_ && processor.process(inputProtocol, outputProtocol, server_ctx)) {}
} catch (TTransportException ttx) {
// Assume the client died and continue silently
} catch (TException tx) {
LOGGER.error("Thrift error occurred during processing of message.", tx);
} catch (Exception x) {