protected void waitForResumption() throws InterruptedException {
    synchronized (pausedLock) {
      if (!isPaused) {
        return;
      }
      if (logger.isDebugEnabled()) {
        logger.debug("GatewaySenderEventProcessor is paused. Waiting for Resumption");
      }
      isDispatcherWaiting = true;
      pausedLock.notifyAll();
      while (isPaused) {
        pausedLock.wait();
      }
      isDispatcherWaiting = false;
    }
  }
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