class InterruptedState implements BoltStateMachineState {

    @Override
    public BoltStateMachineState process( RequestMessage message, StateMachineContext context ) throws BoltConnectionFatality
    {
        assertInitialized();
        if ( message instanceof InterruptSignal )
        {
            return this;
        }
        else if ( message instanceof ResetMessage )
        {
            if ( context.connectionState().decrementInterruptCounter() > 0 )
            {
                context.connectionState().markIgnored();
                return this;
            }

            if ( context.resetMachine() )
            {
                context.connectionState().resetPendingFailedAndIgnored();
                return readyState;
            }
            return failedState;
        }
        else
        {
            context.connectionState().markIgnored();
            return this;
        }
    }

}