currentState.setExceptionListener((ExceptionListener)mi.getArguments()[0]);  Client client = getConnectionState(invocation).getRemotingConnection().getInvokingClient();  if (client == null) { throw new java.lang.IllegalStateException("Cannot find remoting client"); }  if (currentState.getExceptionListener() != null) { client.addConnectionListener(this); currentState.setListenerAdded(true); } else { if (currentState.isListenerAdded()) { client.removeConnectionListener(this); } }
ExceptionListener exceptionListener = (ExceptionListener)mi.getArguments()[0]; state.getRemotingConnectionListener().addJMSExceptionListener(exceptionListener);
   public Object handleSetExceptionListener(Invocation invocation) throws Throwable   {      ConnectionState currentState = getConnectionState(invocation);      currentState.setJustCreated(false);            MethodInvocation mi = (MethodInvocation)invocation;            currentState.setExceptionListener((ExceptionListener)mi.getArguments()[0]);            Client client = getConnectionState(invocation).getRemotingConnection().getInvokingClient();            if (client == null)      {         throw new java.lang.IllegalStateException("Cannot find remoting client");      }            if (currentState.getExceptionListener() != null)      {         client.addConnectionListener(this);         currentState.setListenerAdded(true);      }      else      {         if (currentState.isListenerAdded())         {            client.removeConnectionListener(this);         }      }      return null;   }