ejb3/src/main/java/org/jboss/as/ejb3/timerservice/CalendarTimer.java
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);
    }
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);
    }
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.
Makes sure that the timer is only run once after being restored .