if (errorCode == AMQConstant.NOT_ALLOWED || (errorCode == AMQConstant.ACCESS_REFUSED))
{
_logger.info("Error :" + errorCode +":"+ Thread.currentThread().getName());
// todo ritchiem : Why do this here when it is going to be done in the finally block?
session.closeProtocolSession();
// todo this is a bit of a fudge (could be conssidered such as each new connection needs a new state manager or at least a fresh state.
stateManager.changeState(AMQState.CONNECTION_NOT_STARTED);
throw new AMQAuthenticationException(errorCode, (reason == null) ? null : reason.toString());