Search in sources :

Example 1 with CibaRequestsProcessorEvent

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

the class CibaRequestsProcessorJob method initTimer.

/**
 * Method invoked from the appInitializer to start processing every some time.
 */
public void initTimer() {
    log.debug("Initializing CIBA requests processor");
    this.isActive = new AtomicBoolean(false);
    int intervalSec = appConfiguration.getBackchannelRequestsProcessorJobIntervalSec();
    // Schedule to start processor every N seconds
    processorEvent.fire(new TimerEvent(new TimerSchedule(intervalSec, intervalSec), new CibaRequestsProcessorEvent(), Scheduled.Literal.INSTANCE));
    this.lastFinishedTime = System.currentTimeMillis();
    this.executorService = Executors.newCachedThreadPool(ServerUtil.daemonThreadFactory());
}
Also used : AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) TimerSchedule(org.gluu.service.timer.schedule.TimerSchedule) CibaRequestsProcessorEvent(org.gluu.service.cdi.event.CibaRequestsProcessorEvent) TimerEvent(org.gluu.service.timer.event.TimerEvent)

Aggregations

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