@ Override public void sendResponse ( StoreStats performanceStats , boolean isFromLocalZone , long startTimeInMs ) throws Exception { ChannelBuffer responseContent = ChannelBuffers . dynamicBuffer ( this . responseValue . length ) ; responseContent . writeBytes ( responseValue ) ; // 1. Create the Response object HttpResponse response = new DefaultHttpResponse ( HTTP_1_1 , OK ) ; // 2. Set the right headers response . setHeader ( CONTENT_TYPE , "binary" ) ; response . setHeader ( CONTENT_TRANSFER_ENCODING , "binary" ) ; // 3. Copy the data into the payload response . setContent ( responseContent ) ; response . setHeader ( CONTENT_LENGTH , response . getContent ( ) . readableBytes ( ) ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Response = " + response ) ; } // Write the response to the Netty Channel this . messageEvent . getChannel ( ) . write ( response ) ; if ( performanceStats != null && isFromLocalZone ) { recordStats ( performanceStats , startTimeInMs , Tracked . GET ) ; } }
Sends a normal HTTP response containing the serialization information in a XML format