Search in sources :

Example 1 with TimerEvent

use of org.gluu.service.timer.event.TimerEvent in project oxAuth by GluuFederation.

the class ConfigurationFactory method initTimer.

public void initTimer() {
    log.debug("Initializing Configuration Timer");
    final int delay = 30;
    final int interval = DEFAULT_INTERVAL;
    timerEvent.fire(new TimerEvent(new TimerSchedule(delay, interval), new ConfigurationEvent(), Scheduled.Literal.INSTANCE));
}
Also used : TimerSchedule(org.gluu.service.timer.schedule.TimerSchedule) TimerEvent(org.gluu.service.timer.event.TimerEvent)

Example 2 with TimerEvent

use of org.gluu.service.timer.event.TimerEvent 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 3 with TimerEvent

use of org.gluu.service.timer.event.TimerEvent 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)

Example 4 with TimerEvent

use of org.gluu.service.timer.event.TimerEvent in project oxCore by GluuFederation.

the class LoggerService method initTimer.

public void initTimer() {
    log.info("Initializing Logger Update Timer");
    final int delay = 15;
    final int interval = DEFAULT_INTERVAL;
    timerEvent.fire(new TimerEvent(new TimerSchedule(delay, interval), new LoggerUpdateEvent(), Scheduled.Literal.INSTANCE));
}
Also used : TimerSchedule(org.gluu.service.timer.schedule.TimerSchedule) TimerEvent(org.gluu.service.timer.event.TimerEvent) LoggerUpdateEvent(org.gluu.service.cdi.event.LoggerUpdateEvent)

Example 5 with TimerEvent

use of org.gluu.service.timer.event.TimerEvent in project oxCore by GluuFederation.

the class TimerJob method execute.

@Override
public void execute(JobExecutionContext context) throws JobExecutionException {
    try {
        TimerEvent timerEvent = (TimerEvent) context.getJobDetail().getJobDataMap().get(KEY_TIMER_EVENT);
        if (timerEvent == null) {
            return;
        }
        log.trace("Fire timer event [{}] with qualifiers {} from instance {}", timerEvent.getTargetEvent().getClass().getName(), timerEvent.getQualifiers(), System.identityHashCode(this));
        beanManager.fireEvent(timerEvent.getTargetEvent(), timerEvent.getQualifiers());
    } catch (Exception ex) {
        throw new JobExecutionException(ex);
    }
}
Also used : JobExecutionException(org.quartz.JobExecutionException) TimerEvent(org.gluu.service.timer.event.TimerEvent) JobExecutionException(org.quartz.JobExecutionException)

Aggregations

TimerEvent (org.gluu.service.timer.event.TimerEvent)22 TimerSchedule (org.gluu.service.timer.schedule.TimerSchedule)21 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)15 StatusCheckerTimerEvent (org.gluu.oxtrust.service.cdi.event.StatusCheckerTimerEvent)2 Asynchronous (org.gluu.service.cdi.async.Asynchronous)2 CleanerEvent (org.gluu.service.cdi.event.CleanerEvent)2 LdapStatusEvent (org.gluu.service.cdi.event.LdapStatusEvent)2 Date (java.util.Date)1 CacheRefreshConfiguration (org.gluu.config.oxtrust.CacheRefreshConfiguration)1 AuthConfigurationEvent (org.gluu.oxauth.service.cdi.event.AuthConfigurationEvent)1 ExpirationEvent (org.gluu.oxauth.service.cdi.event.ExpirationEvent)1 KeyGenerationEvent (org.gluu.oxauth.service.cdi.event.KeyGenerationEvent)1 StatEvent (org.gluu.oxauth.service.cdi.event.StatEvent)1 CacheRefreshEvent (org.gluu.oxtrust.service.cdi.event.CacheRefreshEvent)1 EntityIdMonitoringEvent (org.gluu.oxtrust.service.cdi.event.EntityIdMonitoringEvent)1 LogFileSizeChekerEvent (org.gluu.oxtrust.service.cdi.event.LogFileSizeChekerEvent)1 MetadataValidationEvent (org.gluu.oxtrust.service.cdi.event.MetadataValidationEvent)1 StatusCheckerDailyEvent (org.gluu.oxtrust.service.cdi.event.StatusCheckerDailyEvent)1 TranscodingRulesUpdateEvent (org.gluu.oxtrust.service.cdi.event.TranscodingRulesUpdateEvent)1 CibaRequestsProcessorEvent (org.gluu.service.cdi.event.CibaRequestsProcessorEvent)1