String serviceName = in.readString();
long id = in.readI64();
ByteArrayOutputStream bos = new ByteArrayOutputStream( 1024 );
TIOStreamTransport transport = new TIOStreamTransport( bos );
TProtocol protocol = protocolFactory.getProtocol( transport );
TProcessor processor = processorMap.get( serviceName );
if ( processor == null ) {
logger.error(
new StringBuilder( 32 )
.append( "Could not find processor for service " )
.append( serviceName )
.toString() );
return false;
}
// todo if exception
boolean result = processor.process( in, protocol );
ByteArrayOutputStream header = new ByteArrayOutputStream( 512 );
TIOStreamTransport headerTransport = new TIOStreamTransport( header );
TProtocol headerProtocol = protocolFactory.getProtocol( headerTransport );
headerProtocol.writeI16( magic );
headerProtocol.writeI32( Integer.MAX_VALUE );