class MessageProcessingHandler implements BoltResponseHandler {

    @Override
    public void onFinish()
    {
        try
        {
            if ( ignored )
            {
                messageWriter.write( IGNORED_MESSAGE );
            }
            else if ( error != null )
            {
                publishError( messageWriter, error );
            }
            else
            {
                messageWriter.write( new SuccessMessage( getMetadata() ) );
            }
        }
        catch ( Throwable e )
        {
            connection.stop();
            log.error( "Failed to write response to driver", e );
        }
        finally
        {
            clearState();
        }
    }

    public  MessageProcessingHandler( BoltResponseMessageWriter messageWriter, BoltConnection connection, Log logger );

}