class Server extends SimpleChannelHandler implements ChannelPipelineFactory, Lifecycle,
        ChannelCloser {

    @Override
    public void messageReceived( ChannelHandlerContext ctx, MessageEvent event )
    {
        try
        {
            ChannelBuffer message = (ChannelBuffer) event.getMessage();
            handleRequest( message, event.getChannel() );
        }
        catch ( Throwable e )
        {
            msgLog.error( "Error handling request", e );

            // Attempt to reply to the client
            ChunkingChannelBuffer buffer = newChunkingBuffer( event.getChannel() );
            buffer.clear( /* failure = */true );
            writeFailureResponse( e, buffer );

            ctx.getChannel().close();
            tryToCloseChannel( ctx.getChannel() );
            throw e;
        }
    }

    public  Server( T requestTarget, Configuration config, LogProvider logProvider, int frameLength,
                   ProtocolVersion protocolVersion, TxChecksumVerifier txVerifier, Clock clock, ByteCounterMonitor
            byteCounterMonitor, RequestMonitor requestMonitor );

}