in daemon/src/main/java/org/mvndaemon/mvnd/daemon/Server.java [322:354]
private void expirationCheck() {
if (expirationLock.tryLock()) {
try {
LOGGER.debug("Expiration check running");
final DaemonExpirationResult result = strategy.checkExpiration(this);
switch (result.getStatus()) {
case DO_NOT_EXPIRE:
break;
case QUIET_EXPIRE:
requestStop(result.getReason());
break;
case GRACEFUL_EXPIRE:
onExpire(result.getReason(), result.getStatus());
requestStop(result.getReason());
break;
case IMMEDIATE_EXPIRE:
onExpire(result.getReason(), result.getStatus());
requestForcefulStop(result.getReason());
break;
}
} catch (Throwable t) {
LOGGER.error("Problem in daemon expiration check", t);
if (t instanceof Error) {
// never swallow java.lang.Error
throw (Error) t;
}
} finally {
expirationLock.unlock();
}
} else {
LOGGER.warn("Previous DaemonExpirationPeriodicCheck was still running when the next run was scheduled.");
}
}