本文整理匯總了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));
}