本文整理汇总了Java中org.xdi.service.timer.schedule.TimerSchedule类的典型用法代码示例。如果您正苦于以下问题:Java TimerSchedule类的具体用法?Java TimerSchedule怎么用?Java TimerSchedule使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TimerSchedule类属于org.xdi.service.timer.schedule包,在下文中一共展示了TimerSchedule类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initTimer
import org.xdi.service.timer.schedule.TimerSchedule; //导入依赖的package包/类
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();
}
示例2: schedule
import org.xdi.service.timer.schedule.TimerSchedule; //导入依赖的package包/类
public void schedule(@Observes TimerEvent timerEvent) {
checkInitialized();
JobDataMap dataMap = new JobDataMap();
dataMap.put(TimerJob.KEY_TIMER_EVENT, timerEvent);
String uuid = UUID.randomUUID().toString();
JobDetail timerJob = JobBuilder.newJob(TimerJob.class)
.withIdentity(TimerJob.class.getSimpleName() + "_" + uuid, TimerJob.TIMER_JOB_GROUP)
.usingJobData(dataMap).build();
TimerSchedule timerSchedule = timerEvent.getSchedule();
Date triggerStartTime = new Date(System.currentTimeMillis() + timerSchedule.getDelay() * 1000L);
Trigger timerTrigger = TriggerBuilder.newTrigger().withIdentity(uuid, TimerJob.TIMER_JOB_GROUP)
.startAt(triggerStartTime)
.withSchedule(SimpleScheduleBuilder.repeatSecondlyForever(timerSchedule.getInterval())).build();
try {
scheduler.scheduleJob(timerJob, timerTrigger);
} catch (SchedulerException ex) {
throw new IllegalStateException("Failed to schedule Timer Event", ex);
}
}
示例3: initTimer
import org.xdi.service.timer.schedule.TimerSchedule; //导入依赖的package包/类
public void initTimer() {
log.info("Initializing Ldap Status Timer");
this.isActive = new AtomicBoolean(false);
timerEvent.fire(new TimerEvent(new TimerSchedule(DEFAULT_INTERVAL, DEFAULT_INTERVAL), new LdapStatusEvent(),
Scheduled.Literal.INSTANCE));
}
示例4: initTimer
import org.xdi.service.timer.schedule.TimerSchedule; //导入依赖的package包/类
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));
}
示例5: initTimer
import org.xdi.service.timer.schedule.TimerSchedule; //导入依赖的package包/类
public void initTimer() {
log.info("Initializing Daily Status Cheker Timer");
this.isActive = new AtomicBoolean(false);
final int delay = 1 * 60;
final int interval = DEFAULT_INTERVAL;
timerEvent.fire(new TimerEvent(new TimerSchedule(delay, interval), new StatusCheckerDailyEvent(),
Scheduled.Literal.INSTANCE));
}
示例6: initTimer
import org.xdi.service.timer.schedule.TimerSchedule; //导入依赖的package包/类
public void initTimer() {
log.debug("Initializing Metadata Validation Timer");
final int delay = 30;
final int interval = DEFAULT_INTERVAL;
timerEvent.fire(new TimerEvent(new TimerSchedule(delay, interval), new MetadataValidationEvent(),
Scheduled.Literal.INSTANCE));
}
示例7: initTimer
import org.xdi.service.timer.schedule.TimerSchedule; //导入依赖的package包/类
public void initTimer() {
log.debug("Initializing EntityId Monitoring Timer");
this.isActive = new AtomicBoolean(false);
final int delay = 30;
final int interval = DEFAULT_INTERVAL;
timerEvent.fire(new TimerEvent(new TimerSchedule(delay, interval), new EntityIdMonitoringEvent(),
Scheduled.Literal.INSTANCE));
}
示例8: initTimer
import org.xdi.service.timer.schedule.TimerSchedule; //导入依赖的package包/类
public void initTimer() {
log.debug("Initializing SVN Sync Timer");
if (!appConfiguration.isPersistSVN()) {
return;
}
final int delay = 30;
final int interval = DEFAULT_INTERVAL;
timerEvent.fire(new TimerEvent(new TimerSchedule(delay, interval), new SvnSyncEvent(),
Scheduled.Literal.INSTANCE));
}
示例9: initTimer
import org.xdi.service.timer.schedule.TimerSchedule; //导入依赖的package包/类
public void initTimer() {
log.info("Initializing Daily Status Cheker Timer");
this.isActive = new AtomicBoolean(false);
final int delay = 1 * 60;
final int interval = DEFAULT_INTERVAL;
timerEvent.fire(new TimerEvent(new TimerSchedule(delay, interval), new StatusCheckerTimerEvent(),
Scheduled.Literal.INSTANCE));
}
示例10: initTimer
import org.xdi.service.timer.schedule.TimerSchedule; //导入依赖的package包/类
public void initTimer() {
log.info("Initializing Log File Size Checker Timer");
this.isActive = new AtomicBoolean(false);
final int delay = 2 * 60;
final int interval = DEFAULT_INTERVAL;
timerEvent.fire(new TimerEvent(new TimerSchedule(delay, interval), new LogFileSizeChekerEvent(),
Scheduled.Literal.INSTANCE));
}
示例11: initTimer
import org.xdi.service.timer.schedule.TimerSchedule; //导入依赖的package包/类
@Asynchronous
public void initTimer(List<CustomScriptType> supportedCustomScriptTypes) {
this.supportedCustomScriptTypes = supportedCustomScriptTypes;
this.isActive = new AtomicBoolean(false);
this.lastFinishedTime = System.currentTimeMillis();
final int delay = 30;
final int interval = DEFAULT_INTERVAL;
reload();
timerEvent.fire(new TimerEvent(new TimerSchedule(delay, interval), new UpdateScriptEvent(), Scheduled.Literal.INSTANCE));
}
示例12: TimerEvent
import org.xdi.service.timer.schedule.TimerSchedule; //导入依赖的package包/类
public TimerEvent(TimerSchedule schedule, Object targetEvent, Annotation... qualifiers) {
if (schedule == null) {
throw new IllegalArgumentException("Schedule must not be null");
}
if (targetEvent == null) {
throw new IllegalArgumentException("Target event must not be null");
}
this.schedule = schedule;
this.targetEvent = targetEvent;
this.qualifiers = qualifiers;
}
示例13: initTimer
import org.xdi.service.timer.schedule.TimerSchedule; //导入依赖的package包/类
public void initTimer() {
log.debug("Initializing Key Generator Timer");
this.isActive = new AtomicBoolean(false);
int interval = appConfiguration.getKeyRegenerationInterval();
if (interval <= 0) {
interval = DEFAULT_INTERVAL;
}
interval = interval * 3600;
timerEvent.fire(new TimerEvent(new TimerSchedule(interval, interval), new KeyGenerationEvent(),
Scheduled.Literal.INSTANCE));
}
示例14: initTimer
import org.xdi.service.timer.schedule.TimerSchedule; //导入依赖的package包/类
public void initTimer() {
this.isActive = new AtomicBoolean(false);
this.lastFinishedTime = System.currentTimeMillis();
timerEvent.fire(new TimerEvent(new TimerSchedule(60, DEFAULT_INTERVAL), new AuthConfigurationEvent(),
Scheduled.Literal.INSTANCE));
}
示例15: initTimer
import org.xdi.service.timer.schedule.TimerSchedule; //导入依赖的package包/类
public void initTimer() {
log.debug("Initializing Cleaner Timer");
this.isActive = new AtomicBoolean(false);
int interval = appConfiguration.getCleanServiceInterval();
if (interval <= 0) {
interval = DEFAULT_INTERVAL;
}
cleanerEvent.fire(new TimerEvent(new TimerSchedule(interval, interval), new CleanerEvent(), Scheduled.Literal.INSTANCE));
}