public void _checkAutoRecoverStartup() {
if (NSLog.debugLoggingAllowedForLevelAndGroups(NSLog.DebugLevelDetailed, NSLog.DebugGroupDeployment))
NSLog.debug.appendln("_checkAutoRecoverStartup START");
theApplication._lock.startReading();
try {
MSiteConfig aConfig = theApplication.siteConfig();
final NSArray appArray = aConfig.applicationArray();
int appArrayCount = appArray.count();
final LocalMonitor localMonitor = this;
Thread[] workers = new Thread[appArrayCount];
for (int i=0; i<workers.length; i++) {
final int j = i;
Runnable work = new Runnable() {
public void run() {
localMonitor._autoRecoverApplication((MApplication) appArray.objectAtIndex(j));
}
};
workers[j] = new Thread(work);
workers[j].start();
}
try {
for (int i=0; i<workers.length; i++) {
workers[i].join();
}
} catch (InterruptedException ie) {}
// That timer will kick off a repeating, hourly, timer for _checkSchedules every hour on the hour
NSTimestamp fireDate = calculateNearestHour();
//NSTimestamp fireDate, long ti, Object aTarget, String aSelectorName, Object userInfo, Class userInfoClass, boolean repeat
aScheduleTimer = new WOTimer(fireDate, (60 * 60 * 1000), this, "_checkSchedules", null, null, true);
aScheduleTimer.schedule();
// This is the regular timer that should do autorecovery
anAutoRecoverTimer = WOTimer.scheduledTimer(aConfig.autoRecoverInterval(), this, "_checkAutoRecover", null, null, true);
} finally {
theApplication._lock.endReading();
}
if (NSLog.debugLoggingAllowedForLevelAndGroups(NSLog.DebugLevelDetailed, NSLog.DebugGroupDeployment))