public void stopClusterManagerThread(long waitTime, OperationResult parentResult) {

    OperationResult result =
        parentResult.createSubresult(ClusterManager.class.getName() + ".stopClusterManagerThread");
    result.addParam("waitTime", waitTime);

    if (clusterManagerThread != null) {
      clusterManagerThread.signalShutdown();
      try {
        clusterManagerThread.join(waitTime);
      } catch (InterruptedException e) {
        LoggingUtils.logException(
            LOGGER, "Waiting for ClusterManagerThread shutdown was interrupted", e);
      }
      if (clusterManagerThread.isAlive()) {
        result.recordWarning(
            "ClusterManagerThread shutdown requested but after "
                + waitTime
                + " ms it is still running.");
      } else {
        result.recordSuccess();
      }
    } else {
      result.recordSuccess();
    }
  }
 public boolean isClusterManagerThreadActive() {
   return clusterManagerThread != null && clusterManagerThread.isAlive();
 }
 public void startClusterManagerThread() {
   clusterManagerThread = new ClusterManagerThread();
   clusterManagerThread.setName("ClusterManagerThread");
   clusterManagerThread.start();
 }