if (runLevelController.getCurrentRunLevel() < StartupRunLevel.VAL - 1 || isShutdown()) {
return;
}
env.setStatus(ServerEnvironment.Status.starting);
events.send(new Event(EventTypes.SERVER_STARTUP), false);
// finally let's calculate our starting times
logger.info(localStrings.getLocalString("startup_end_message",
"{0} ({1}) startup time : {2} ({3}ms), startup services({4}ms), total({5}ms)",
Version.getVersion(), Version.getBuildVersion(), platform,
(platformInitTime - context.getCreationTime()),
(System.currentTimeMillis() - platformInitTime),
System.currentTimeMillis() - context.getCreationTime()));
printModuleStatus(systemRegistry, level);
try {
// it will only be set when called from AsadminMain and the env. variable AS_DEBUG is set to true
long realstart = Long.parseLong(System.getProperty("WALL_CLOCK_START"));
logger.info("TOTAL TIME INCLUDING CLI: " + (System.currentTimeMillis() - realstart));
}
catch(Exception e) {
// do nothing.
}
if (logger.isLoggable(level)) {
for (Map.Entry<Class, Long> service : servicesTiming.entrySet()) {
logger.log(level, "Service : " + service.getKey() + " took " + service.getValue() + " ms");
}
}
for (Future<Result<Thread>> future : futures) {
try {
try {
// wait for an eventual status, otherwise ignore
if (future.get(timeout, unit).isFailure()) {
final Throwable t = future.get().exception();
logger.log(Level.SEVERE,
localStrings.getLocalString("startupfatalstartup",
"Shutting down server due to startup exception : "),
t);
events.send(new Event(EventTypes.SERVER_SHUTDOWN), false);
forceShutdown();
return;
}
} catch(TimeoutException e) {
logger.warning(localStrings.getLocalString("startupwaittimeout",
"Timed out, ignoring some startup service status"));
}
} catch(Throwable t) {
logger.log(Level.SEVERE, t.getMessage(), t);
}
}
env.setStatus(ServerEnvironment.Status.started);
events.send(new Event(EventTypes.SERVER_READY), false);
pidWriter.writePidFile();
}