private void doWork() {
    try { // handle handle exceptions
      if (file.exists()) {
        // see if file is accessible
        try (FileReader fileReader = new FileReader(file)) {
          try { // always check stopAfterRequest after handleRequest
            handleRequest(fileReader);
          } finally {
            if (stopAfterRequest) {
              stopMe();
            }
          }
        } catch (FileNotFoundException e) {
          logger.warn(e);
        }
      }
      Thread.sleep(LOOP_INTERVAL_MILLIS);
    } catch (InterruptedException ignored) {
      Thread.currentThread().interrupt();
      // allow to loop around and check isAlive()
    } catch (IOException ignored) {
      logger.error(
          "Unable to control process with {}. Please add tools.jar from JDK to classpath for improved process control.",
          file);
      // allow to loop around and check isAlive()
    }
  }
Invokes a ControlRequestHandler when a control file has been created.

@since GemFire 8.0
geode-core/src/main/java/org/apache/geode/internal/process/ControlFileWatchdog.java