private boolean postStartupJob() {
LinkedList<Future<Result<Thread>>> futures = appInstanceListener.getFutures();
env.setStatus(ServerEnvironment.Status.starting);
events.send(new Event(EventTypes.SERVER_STARTUP), false);
// finally let's calculate our starting times
long nowTime = System.currentTimeMillis();
logger.log(Level.INFO, KernelLoggerInfo.startupEndMessage,
new Object[] { Version.getVersion(), Version.getBuildVersion(), platform,
(platformInitTime - context.getCreationTime()),
(nowTime - platformInitTime),
nowTime - context.getCreationTime()});
printModuleStatus(systemRegistry, level);
String wallClockStart = System.getProperty("WALL_CLOCK_START");
if (wallClockStart != null) {
try {
// it will only be set when called from AsadminMain and the env. variable AS_DEBUG is set to true
long realstart = Long.parseLong(wallClockStart);
logger.log(Level.INFO, KernelLoggerInfo.startupTotalTime, (System.currentTimeMillis() - realstart));
}
catch(Exception e) {
// do nothing.
}
}
for (Future<Result<Thread>> future : futures) {
try {
try {
// wait for an eventual status, otherwise ignore
if (future.get(3, TimeUnit.SECONDS).isFailure()) {
final Throwable t = future.get().exception();
logger.log(Level.SEVERE, KernelLoggerInfo.startupFatalException, t);
events.send(new Event(EventTypes.SERVER_SHUTDOWN), false);
shutdown();
return false;
}
} catch(TimeoutException e) {
logger.log(Level.WARNING, KernelLoggerInfo.startupWaitTimeout, e);
}
} catch(Throwable t) {
logger.log(Level.SEVERE, KernelLoggerInfo.startupException, t);
}
}
env.setStatus(ServerEnvironment.Status.started);
events.send(new Event(EventTypes.SERVER_READY), false);
pidWriter.writePidFile();
return true;
}