/**
* We are attached a thread, now it's time to performt the job.
*/
public void run() {
httpd server = (httpd) getServer();
int interval = -1;
try {
while ( alive ) {
// Are we still alive ?
interval = getInterval();
alive = ((getFlushLog()
|| getFlushProperties()
|| getFlushConfiguration())
&& (interval > 0 ));
if ( ! alive )
break;
// Wait for something to do:
synchronized(this) {
try {
wait(interval*1000);
} catch (InterruptedException ex) {
}
}
// Do what is to be done:
checkpoint = new Date();
if ( getTraceFlag() )
System.out.println("*** Checkpoint ("+
server.getIdentifier()+
") at "+
checkpoint);
if (alive && getFlushConfiguration() )
server.checkpoint();
if (alive && getFlushLog()) {
Logger logger = ((httpd)getServer()).getLogger();
if ( logger != null)
logger.sync();
}
}
} catch (Exception ex) {
String msg = ("exception while running \""+
ex.getMessage() + "\". Stopped.");
server.errlog(this, msg);
} finally {
thread = null;
}
}