public void run() { started = true; if (!prepared) { logger.error("The StageRunner was not prepared prior to being started. Aborting!"); return; } if (stageGroup.isEmpty()) { logger.info("Stage group " + stageGroup.getName() + " has no stages, and can not be started."); return; } do { logger.info("Starting stage group " + stageGroup.getName() + ". Times started so far: " + timesStarted); timesStarted++; boolean cleanShutdown = runGroup(); if (cleanShutdown) { return; } if (!hasQueried()) { logger.error("The stage group " + stageGroup.getName() + " did not start. It will not be restarted until configuration changes."); return; } } while ((timesToRetry == -1 || timesToRetry >= timesStarted) && !shutdownHandler.isShuttingDown()); logger.error("Stage group " + stageGroup.getName() + " has failed and cannot be restarted. "); }