code: public static synchronized void runOperations() {
          try {
              for (Runnable shutdownOperation : shutdownOperations) {
                  try {
                      shutdownOperation.run();
                  } catch (Exception e) {
                      LOG.warn("Error occurred running shutdown operation: " + e.getMessage(), e);
                  }
              }
          } finally {
              shutdownOperations.clear();
              shutdownOperations.addAll(preservedShutdownOperations);
          }
      }
docs: Runs the shutdown operations