}
return 0;
}
for (int i = 0; i < ids.length; i++) {
InstanceResource resource;
try {
resource = this.home.find(ids[i]);
} catch (Exception e) {
logger.error(Lager.id(ids[i]), e);
try {
this.scheduler.stateNotification(ids[i], STATE_DESTROYING);
} catch (ManageException e2) {
logger.error("", e2);
}
continue;
}
resource.setOpsEnabled(false);
try {
// serialize request is invalid right now
if (resource.getVM().getRequestedShutdownMechanism()
== DEFAULT_SHUTDOWN_TRASH) {
if (lager.eventLog) {
logger.info(Lager.ev(ids[i]) + "Running time has" +
" expired, client requested default" +
" shutdown mechanism of Trash," +
" destroying resource");
}
this.home.destroy(ids[i]);
} else if (resource.getState() > STATE_STAGED_OUT) {
if (lager.eventLog) {
logger.info(Lager.ev(ids[i]) + "Running time has" +
" expired, client requested default shutdown" +
" mechanism of Normal, but the resource is" +
" either being destroyed or has been corrupted," +
" nothing to do");
}
} else {
if (lager.eventLog) {
logger.info(Lager.ev(ids[i]) + "Running time has" +
" expired, client requested default shutdown" +
" mechanism of Normal, setting target state" +
" to StagedOut");
}
resource.setTargetState(STATE_STAGED_OUT);
}
this.scheduler.markShutdown(ids[i]);
} catch (ManageException e) {