use of org.gluu.oxtrust.service.cdi.event.CacheRefreshEvent in project oxTrust by GluuFederation.
the class CacheRefreshTimer method initTimer.
public void initTimer() {
log.info("Initializing Cache Refresh Timer");
this.isActive = new AtomicBoolean(false);
// Clean up previous Inum cache
CacheRefreshConfiguration cacheRefreshConfiguration = configurationFactory.getCacheRefreshConfiguration();
if (cacheRefreshConfiguration != null) {
String snapshotFolder = cacheRefreshConfiguration.getSnapshotFolder();
if (StringHelper.isNotEmpty(snapshotFolder)) {
String inumCachePath = getInumCachePath(cacheRefreshConfiguration);
objectSerializationService.cleanup(inumCachePath);
}
}
// Schedule to start cache refresh every 1 minute
final int delay = 1 * 60;
final int interval = DEFAULT_INTERVAL;
timerEvent.fire(new TimerEvent(new TimerSchedule(delay, DEFAULT_INTERVAL), new CacheRefreshEvent(), Scheduled.Literal.INSTANCE));
this.lastFinishedTime = System.currentTimeMillis();
}
Aggregations