if (!canAutoRecycle(doWindowCheck)) {
return;
}
// get Global lock and check if safeToRecycle
GlobalLockingService service = GlobalLocking.getService();
GlobalLock lock = null;
try {
lock = service.acquireLock(globalLockName);
if (lock == null) {
// do nothing. We will try to recycle later.
Log.shutdown.debug("Could not acquire global lock");
return;
}
// Iterate through all the agents
// If any of them says not safe to recycle, just return aborting
// the recycle
for (int i = 0; i < agents.size(); i++) {
RecycleIfc agent = (RecycleIfc)agents.get(i);
if (agent.isSafeToRecycle() == false) {
Log.shutdown.debug("Auto recycle pending: waiting for agent: %s",
agent);
return;
}
}
// Since some agents can be long running, check again if we can auto recycle.
if (!canAutoRecycle(doWindowCheck)) {
return;
}
// Starting auto recycle shutdown.
Log.shutdown.info(9831);
ShutdownManager.setNodeStatus(ShutdownManager.StatusNodeAutoRecycle);
}
finally {
if ( lock != null && lock.isValid()) {
releaseLock(lock);
}
}
for (int i = 0; i < agents.size(); i++) {