本文整理了Java中org.quartz.Trigger.equals()
方法的一些代码示例,展示了Trigger.equals()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Trigger.equals()
方法的具体详情如下:
包路径:org.quartz.Trigger
类名称:Trigger
方法名:equals
[英]Trigger equality is based upon the equality of the TriggerKey.
[中]触发器相等基于触发器键的相等。
代码示例来源:origin: org.apache.camel/camel-quartz2
private boolean hasTriggerChanged(Trigger oldTrigger, Trigger newTrigger) {
if (newTrigger instanceof CronTrigger && oldTrigger instanceof CronTrigger) {
CronTrigger newCron = (CronTrigger) newTrigger;
CronTrigger oldCron = (CronTrigger) oldTrigger;
return !newCron.getCronExpression().equals(oldCron.getCronExpression());
} else if (newTrigger instanceof SimpleTrigger && oldTrigger instanceof SimpleTrigger) {
SimpleTrigger newSimple = (SimpleTrigger) newTrigger;
SimpleTrigger oldSimple = (SimpleTrigger) oldTrigger;
return newSimple.getRepeatInterval() != oldSimple.getRepeatInterval()
|| newSimple.getRepeatCount() != oldSimple.getRepeatCount();
} else {
return !newTrigger.getClass().equals(oldTrigger.getClass()) || !newTrigger.equals(oldTrigger);
}
}
代码示例来源:origin: org.apache.camel/camel-quartz
private static boolean hasTriggerChanged(Trigger oldTrigger, Trigger newTrigger) {
if (newTrigger instanceof CronTrigger && oldTrigger instanceof CronTrigger) {
CronTrigger newCron = (CronTrigger) newTrigger;
CronTrigger oldCron = (CronTrigger) oldTrigger;
return !newCron.getCronExpression().equals(oldCron.getCronExpression());
} else if (newTrigger instanceof SimpleTrigger && oldTrigger instanceof SimpleTrigger) {
SimpleTrigger newSimple = (SimpleTrigger) newTrigger;
SimpleTrigger oldSimple = (SimpleTrigger) oldTrigger;
return newSimple.getRepeatInterval() != oldSimple.getRepeatInterval()
|| newSimple.getRepeatCount() != oldSimple.getRepeatCount();
} else {
return !newTrigger.getClass().equals(oldTrigger.getClass()) || !newTrigger.equals(oldTrigger);
}
}
代码示例来源:origin: org.apache.camel/camel-quartz2
private boolean hasTriggerChanged(Trigger oldTrigger, Trigger newTrigger) {
if (newTrigger instanceof CronTrigger && oldTrigger instanceof CronTrigger) {
CronTrigger newCron = (CronTrigger) newTrigger;
CronTrigger oldCron = (CronTrigger) oldTrigger;
return !newCron.getCronExpression().equals(oldCron.getCronExpression());
} else if (newTrigger instanceof SimpleTrigger && oldTrigger instanceof SimpleTrigger) {
SimpleTrigger newSimple = (SimpleTrigger) newTrigger;
SimpleTrigger oldSimple = (SimpleTrigger) oldTrigger;
return newSimple.getRepeatInterval() != oldSimple.getRepeatInterval()
|| newSimple.getRepeatCount() != oldSimple.getRepeatCount();
} else {
return !newTrigger.getClass().equals(oldTrigger.getClass()) || !newTrigger.equals(oldTrigger);
}
}
代码示例来源:origin: stackoverflow.com
String executingFireInstanceId = executingJob.getFireInstanceId();
String currentFireInstanceId = jobContext.getFireInstanceId();
if (executingJobTrigger.equals(currentJobTrigger) && executingJobDetail.equals(currentJobDetail) && executingJobKey.equals(currentJobKey) && !(executingFireInstanceId.equals(currentFireInstanceId))) {
LOGGER.warn("Job " + String.valueOf(currentJobKey) + " is already executing, returning thread control.");
return;
代码示例来源:origin: com.sangupta/jerry-services
if (jec.getTrigger().equals(trigger)) {
triggerInfo.setRunning(true);
triggerInfo.setRunTime(jec.getJobRunTime());
代码示例来源:origin: com.sangupta/jerry
if(jec.getTrigger().equals(trigger)) {
triggerInfo.setRunning(true);
triggerInfo.setRunTime(jec.getJobRunTime());
代码示例来源:origin: bingoohuang/quartz-glass
public static TriggerWrapperForView fromTrigger(Trigger trigger, Scheduler scheduler) throws SchedulerException {
List<JobExecutionContext> runningJobs = scheduler.getCurrentlyExecutingJobs();
TriggerWrapperForView wrapper = new TriggerWrapperForView();
wrapper.trigger = trigger;
wrapper.group = trigger.getKey().getGroup();
wrapper.name = trigger.getKey().getName();
wrapper.triggerKey = Keys.desc(trigger.getKey());
wrapper.startTime = trigger.getStartTime();
wrapper.endTime = trigger.getEndTime();
wrapper.paused = scheduler.getTriggerState(trigger.getKey()) == Trigger.TriggerState.PAUSED;
wrapper.dataMap = JobDataMapUtils.toProperties(trigger.getJobDataMap());
wrapper.glassScheduler = trigger.getJobDataMap().getString(GlassConstants.GLASS_SCHEDULER);
if ( wrapper.glassScheduler == null && trigger instanceof CronTrigger) {
CronTrigger cronTrigger = (CronTrigger) trigger;
wrapper.glassScheduler = cronTrigger.getCronExpression();
}
if ( wrapper.glassScheduler == null) wrapper.glassScheduler = "";
for (JobExecutionContext executionContext : runningJobs) {
if (executionContext.getTrigger().equals(trigger)) {
wrapper.running = true;
break;
}
}
return wrapper;
}
内容来源于网络,如有侵权,请联系作者删除!