Search in sources :

Example 1 with Asynchronous

use of org.gluu.service.cdi.async.Asynchronous in project oxAuth by GluuFederation.

the class StatTimer method initTimer.

@Asynchronous
public void initTimer() {
    log.info("Initializing Stat Service Timer");
    this.isActive = new AtomicBoolean(false);
    timerEvent.fire(new TimerEvent(new TimerSchedule(TIMER_TICK_INTERVAL_IN_SECONDS, TIMER_TICK_INTERVAL_IN_SECONDS), new StatEvent(), Scheduled.Literal.INSTANCE));
    this.lastFinishedTime = System.currentTimeMillis();
    log.info("Initialized Stat Service Timer");
}
Also used : AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) TimerSchedule(org.gluu.service.timer.schedule.TimerSchedule) TimerEvent(org.gluu.service.timer.event.TimerEvent) StatEvent(org.gluu.oxauth.service.cdi.event.StatEvent) Asynchronous(org.gluu.service.cdi.async.Asynchronous)

Example 2 with Asynchronous

use of org.gluu.service.cdi.async.Asynchronous in project oxCore by GluuFederation.

the class CustomScriptManager method initTimer.

@Asynchronous
public void initTimer(List<CustomScriptType> supportedCustomScriptTypes) {
    this.supportedCustomScriptTypes = supportedCustomScriptTypes;
    configure();
    final int delay = 30;
    final int interval = DEFAULT_INTERVAL;
    reload(true);
    timerEvent.fire(new TimerEvent(new TimerSchedule(delay, interval), new UpdateScriptEvent(), Scheduled.Literal.INSTANCE));
}
Also used : TimerSchedule(org.gluu.service.timer.schedule.TimerSchedule) TimerEvent(org.gluu.service.timer.event.TimerEvent) UpdateScriptEvent(org.gluu.service.cdi.event.UpdateScriptEvent) Asynchronous(org.gluu.service.cdi.async.Asynchronous)

Aggregations

Asynchronous (org.gluu.service.cdi.async.Asynchronous)2 TimerEvent (org.gluu.service.timer.event.TimerEvent)2 TimerSchedule (org.gluu.service.timer.schedule.TimerSchedule)2 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1 StatEvent (org.gluu.oxauth.service.cdi.event.StatEvent)1 UpdateScriptEvent (org.gluu.service.cdi.event.UpdateScriptEvent)1