public void beforeRecover ( ) { if ( data . getPeriod ( ) > 0 ) { final long now = System . currentTimeMillis ( ) ; long startTime = data . getStartTime ( ) ; while ( startTime <= now ) { startTime += data . getPeriod ( ) ; data . setStartTime ( startTime ) ; } if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Task with id " + data . getTaskID ( ) + " start time reset to " + data . getStartTime ( ) ) ; } } }
Invoked before a task is recovered after fail over by default simply adjust start time if it is a periodic timer .