public void setRunningStatus() throws Exception {
    GemFireException ex = null;
    try {
      initializeEventDispatcher();
    } catch (GemFireException e) {
      ex = e;
    }
    synchronized (runningStateLock) {
      if (ex != null) {
        setException(ex);
        setIsStopped(true);
      } else {
        setIsStopped(false);
      }
      runningStateLock.notifyAll();
    }
    if (ex != null) {
      throw ex;
    }
  }
In case of BatchException we expect that the dispatcher has removed all the events till the
event that threw BatchException.
geode-core/src/main/java/org/apache/geode/internal/cache/wan/AbstractGatewaySenderEventProcessor.java