Search in sources :

Example 1 with CleanerEvent

use of org.gluu.service.cdi.event.CleanerEvent in project oxTrust by GluuFederation.

the class CleanerTimer method initTimer.

public void initTimer() {
    log.debug("Initializing Cleaner Timer");
    cleanUpLogger.addNewLogLine("Initializing Cleaner Timer at:" + new Date());
    this.isActive = new AtomicBoolean(false);
    // Schedule to start cleaner every 1 minute
    cleanerEvent.fire(new TimerEvent(new TimerSchedule(DEFAULT_INTERVAL, DEFAULT_INTERVAL), new CleanerEvent(), Scheduled.Literal.INSTANCE));
    cleanUpLogger.addNewLogLine("Initialization Done at :" + new Date());
}
Also used : CleanerEvent(org.gluu.service.cdi.event.CleanerEvent) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) TimerSchedule(org.gluu.service.timer.schedule.TimerSchedule) TimerEvent(org.gluu.service.timer.event.TimerEvent) Date(java.util.Date)

Example 2 with CleanerEvent

use of org.gluu.service.cdi.event.CleanerEvent in project oxAuth by GluuFederation.

the class CleanerTimer method initTimer.

public void initTimer() {
    log.debug("Initializing Cleaner Timer");
    this.isActive = new AtomicBoolean(false);
    // Schedule to start cleaner every 30 seconds
    cleanerEvent.fire(new TimerEvent(new TimerSchedule(DEFAULT_INTERVAL, DEFAULT_INTERVAL), new CleanerEvent(), Scheduled.Literal.INSTANCE));
    this.lastFinishedTime = System.currentTimeMillis();
}
Also used : CleanerEvent(org.gluu.service.cdi.event.CleanerEvent) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) TimerSchedule(org.gluu.service.timer.schedule.TimerSchedule) TimerEvent(org.gluu.service.timer.event.TimerEvent)

Aggregations

AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)2 CleanerEvent (org.gluu.service.cdi.event.CleanerEvent)2 TimerEvent (org.gluu.service.timer.event.TimerEvent)2 TimerSchedule (org.gluu.service.timer.schedule.TimerSchedule)2 Date (java.util.Date)1