// we "cripple" the remoting connection by removing ConnectionListener. This way, failures
// cannot be "cleanly" detected by the client-side pinger, and we'll fail on an invocation
JMSRemotingConnection rc = ((ClientConnectionDelegate)((JBossConnection)conn).
getDelegate()).getRemotingConnection();
rc.removeConnectionListener();
SimpleFailoverListener failoverListener = new SimpleFailoverListener();
((JBossConnection)conn).registerFailoverListener(failoverListener);
// poison the server