public void handleRestorationCalculation ( ) { if ( nextExpiration == null ) { return ; } //next expiration in the future, we don't care if ( nextExpiration . getTime ( ) >= System . currentTimeMillis ( ) ) { return ; } //just set the next expiration to 1ms in the past //this means it will run to catch up the missed expiration //and then the next calculated expiration will be in the future nextExpiration = new Date ( System . currentTimeMillis ( ) - 1 ) ; }
Makes sure that the timer is only run once after being restored .