final int j = i;
Runnable work = new Runnable() {
public void run() {
try {
MInstance anInst = (MInstance) instArray.objectAtIndex(j);
if ( (anInst.isScheduled()) && (anInst.nearNextScheduledShutdown(rightNow)) ) {
if (anInst.isGracefullyScheduled()) {
localMonitor.stopInstance(anInst);
} else {
localMonitor.terminateInstance(anInst);
}