本文整理了Java中org.quartz.Trigger.getKey()
方法的一些代码示例,展示了Trigger.getKey()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Trigger.getKey()
方法的具体详情如下:
包路径:org.quartz.Trigger
类名称:Trigger
方法名:getKey
暂无
代码示例来源:origin: quartz-scheduler/quartz
public void triggerFinalized(Trigger trigger) {
Map<String, String> map = new HashMap<String, String>();
map.put("triggerName", trigger.getKey().getName());
map.put("triggerGroup", trigger.getKey().getGroup());
sendNotification(TRIGGER_FINALIZED, map);
}
代码示例来源:origin: quartz-scheduler/quartz
/**
* Trigger equality is based upon the equality of the TriggerKey.
*
* @return true if the key of this Trigger equals that of the given Trigger.
*/
@Override
public boolean equals(Object o) {
if(!(o instanceof Trigger))
return false;
Trigger other = (Trigger)o;
return !(other.getKey() == null || getKey() == null) && getKey().equals(other.getKey());
}
代码示例来源:origin: quartz-scheduler/quartz
/**
* Trigger equality is based upon the equality of the TriggerKey.
*
* @return true if the key of this Trigger equals that of the given Trigger.
*/
@Override
public boolean equals(Object o) {
if(!(o instanceof Trigger))
return false;
Trigger other = (Trigger)o;
return !(other.getKey() == null || getKey() == null) && getKey().equals(other.getKey());
}
代码示例来源:origin: quartz-scheduler/quartz
public void notifySchedulerListenersSchduled(Trigger trigger) {
// build a list of all scheduler listeners that are to be notified...
List<SchedulerListener> schedListeners = buildSchedulerListenerList();
// notify all scheduler listeners
for(SchedulerListener sl: schedListeners) {
try {
sl.jobScheduled(trigger);
} catch (Exception e) {
getLog().error(
"Error while notifying SchedulerListener of scheduled job."
+ " Triger=" + trigger.getKey(), e);
}
}
}
代码示例来源:origin: quartz-scheduler/quartz
public void notifySchedulerListenersSchduled(Trigger trigger) {
// build a list of all scheduler listeners that are to be notified...
List<SchedulerListener> schedListeners = buildSchedulerListenerList();
// notify all scheduler listeners
for(SchedulerListener sl: schedListeners) {
try {
sl.jobScheduled(trigger);
} catch (Exception e) {
getLog().error(
"Error while notifying SchedulerListener of scheduled job."
+ " Triger=" + trigger.getKey(), e);
}
}
}
代码示例来源:origin: quartz-scheduler/quartz
public void notifySchedulerListenersFinalized(Trigger trigger) {
// build a list of all scheduler listeners that are to be notified...
List<SchedulerListener> schedListeners = buildSchedulerListenerList();
// notify all scheduler listeners
for(SchedulerListener sl: schedListeners) {
try {
sl.triggerFinalized(trigger);
} catch (Exception e) {
getLog().error(
"Error while notifying SchedulerListener of finalized trigger."
+ " Triger=" + trigger.getKey(), e);
}
}
}
代码示例来源:origin: quartz-scheduler/quartz
public int compare(Trigger t1, Trigger t2) {
return compare(t1.getNextFireTime(), t1.getPriority(), t1.getKey(), t2.getNextFireTime(), t2.getPriority(), t2.getKey());
}
}
代码示例来源:origin: quartz-scheduler/quartz
public void notifySchedulerListenersFinalized(Trigger trigger) {
// build a list of all scheduler listeners that are to be notified...
List<SchedulerListener> schedListeners = buildSchedulerListenerList();
// notify all scheduler listeners
for(SchedulerListener sl: schedListeners) {
try {
sl.triggerFinalized(trigger);
} catch (Exception e) {
getLog().error(
"Error while notifying SchedulerListener of finalized trigger."
+ " Triger=" + trigger.getKey(), e);
}
}
}
代码示例来源:origin: quartz-scheduler/quartz
public int compare(Trigger t1, Trigger t2) {
return compare(t1.getNextFireTime(), t1.getPriority(), t1.getKey(), t2.getNextFireTime(), t2.getPriority(), t2.getKey());
}
}
代码示例来源:origin: quartz-scheduler/quartz
public void triggerFired(Trigger trigger, JobExecutionContext context) {
if (!getLog().isInfoEnabled()) {
return;
}
Object[] args = {
trigger.getKey().getName(), trigger.getKey().getGroup(),
trigger.getPreviousFireTime(), trigger.getNextFireTime(),
new java.util.Date(), context.getJobDetail().getKey().getName(),
context.getJobDetail().getKey().getGroup(),
Integer.valueOf(context.getRefireCount())
};
getLog().info(MessageFormat.format(getTriggerFiredMessage(), args));
}
代码示例来源:origin: spring-projects/spring-framework
boolean triggerExists = (getScheduler().getTrigger(trigger.getKey()) != null);
if (triggerExists && !this.overwriteExistingJobs) {
return false;
getScheduler().rescheduleJob(trigger.getKey(), trigger);
getScheduler().rescheduleJob(trigger.getKey(), trigger);
代码示例来源:origin: quartz-scheduler/quartz
public void triggerFired(Trigger trigger, JobExecutionContext context) {
if (!getLog().isInfoEnabled()) {
return;
}
Object[] args = {
trigger.getKey().getName(), trigger.getKey().getGroup(),
trigger.getPreviousFireTime(), trigger.getNextFireTime(),
new java.util.Date(), context.getJobDetail().getKey().getName(),
context.getJobDetail().getKey().getGroup(),
Integer.valueOf(context.getRefireCount())
};
getLog().info(MessageFormat.format(getTriggerFiredMessage(), args));
}
代码示例来源:origin: quartz-scheduler/quartz
private boolean notifyJobListenersComplete(JobExecutionContext jobExCtxt, JobExecutionException jobExEx) {
try {
qs.notifyJobListenersWasExecuted(jobExCtxt, jobExEx);
} catch (SchedulerException se) {
qs.notifySchedulerListenersError(
"Unable to notify JobListener(s) of Job that was executed: "
+ "(error will be ignored). trigger= "
+ jobExCtxt.getTrigger().getKey() + " job= "
+ jobExCtxt.getJobDetail().getKey(), se);
return false;
}
return true;
}
代码示例来源:origin: quartz-scheduler/quartz
private boolean notifyJobListenersComplete(JobExecutionContext jobExCtxt, JobExecutionException jobExEx) {
try {
qs.notifyJobListenersWasExecuted(jobExCtxt, jobExEx);
} catch (SchedulerException se) {
qs.notifySchedulerListenersError(
"Unable to notify JobListener(s) of Job that was executed: "
+ "(error will be ignored). trigger= "
+ jobExCtxt.getTrigger().getKey() + " job= "
+ jobExCtxt.getJobDetail().getKey(), se);
return false;
}
return true;
}
代码示例来源:origin: quartz-scheduler/quartz
public void triggerMisfired(Trigger trigger) {
if (!getLog().isInfoEnabled()) {
return;
}
Object[] args = {
trigger.getKey().getName(), trigger.getKey().getGroup(),
trigger.getPreviousFireTime(), trigger.getNextFireTime(),
new java.util.Date(), trigger.getJobKey().getName(),
trigger.getJobKey().getGroup()
};
getLog().info(MessageFormat.format(getTriggerMisfiredMessage(), args));
}
代码示例来源:origin: quartz-scheduler/quartz
public void triggerMisfired(Trigger trigger) {
if (!getLog().isInfoEnabled()) {
return;
}
Object[] args = {
trigger.getKey().getName(), trigger.getKey().getGroup(),
trigger.getPreviousFireTime(), trigger.getNextFireTime(),
new java.util.Date(), trigger.getJobKey().getName(),
trigger.getJobKey().getGroup()
};
getLog().info(MessageFormat.format(getTriggerMisfiredMessage(), args));
}
代码示例来源:origin: quartz-scheduler/quartz
private boolean notifyTriggerListenersComplete(JobExecutionContext jobExCtxt, CompletedExecutionInstruction instCode) {
try {
qs.notifyTriggerListenersComplete(jobExCtxt, instCode);
} catch (SchedulerException se) {
qs.notifySchedulerListenersError(
"Unable to notify TriggerListener(s) of Job that was executed: "
+ "(error will be ignored). trigger= "
+ jobExCtxt.getTrigger().getKey() + " job= "
+ jobExCtxt.getJobDetail().getKey(), se);
return false;
}
if (jobExCtxt.getTrigger().getNextFireTime() == null) {
qs.notifySchedulerListenersFinalized(jobExCtxt.getTrigger());
}
return true;
}
代码示例来源:origin: azkaban/azkaban
public synchronized boolean isJobPaused(final String jobName, final String groupName)
throws SchedulerException {
final JobKey jobKey = new JobKey(jobName, groupName);
final JobDetail jobDetail = this.scheduler.getJobDetail(jobKey);
final List<? extends Trigger> triggers = this.scheduler.getTriggersOfJob(jobDetail.getKey());
for (final Trigger trigger : triggers) {
final TriggerState triggerState = this.scheduler.getTriggerState(trigger.getKey());
if (TriggerState.PAUSED.equals(triggerState)) {
return true;
}
}
return false;
}
代码示例来源:origin: quartz-scheduler/quartz
@Override
public String toString() {
return "JobExecutionContext:" + " trigger: '"
+ getTrigger().getKey() + " job: "
+ getJobDetail().getKey() + " fireTime: '" + getFireTime()
+ " scheduledFireTime: " + getScheduledFireTime()
+ " previousFireTime: '" + getPreviousFireTime()
+ " nextFireTime: " + getNextFireTime() + " isRecovering: "
+ isRecovering() + " refireCount: " + getRefireCount();
}
代码示例来源:origin: quartz-scheduler/quartz
@Override
public String toString() {
return "JobExecutionContext:" + " trigger: '"
+ getTrigger().getKey() + " job: "
+ getJobDetail().getKey() + " fireTime: '" + getFireTime()
+ " scheduledFireTime: " + getScheduledFireTime()
+ " previousFireTime: '" + getPreviousFireTime()
+ " nextFireTime: " + getNextFireTime() + " isRecovering: "
+ isRecovering() + " refireCount: " + getRefireCount();
}
内容来源于网络,如有侵权,请联系作者删除!