本文整理匯總了Java中org.quartz.Trigger.setJobDataMap方法的典型用法代碼示例。如果您正苦於以下問題:Java Trigger.setJobDataMap方法的具體用法?Java Trigger.setJobDataMap怎麽用?Java Trigger.setJobDataMap使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.quartz.Trigger
的用法示例。
在下文中一共展示了Trigger.setJobDataMap方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: triggerJob
import org.quartz.Trigger; //導入方法依賴的package包/類
/**
* <p>
* Trigger the identified <code>{@link org.quartz.Job}</code> (execute it
* now) - with a non-volatile trigger.
* </p>
*/
public void triggerJob(SchedulingContext ctxt, String jobName,
String groupName, JobDataMap data) throws SchedulerException {
validateState();
if(groupName == null) {
groupName = Scheduler.DEFAULT_GROUP;
}
Trigger trig = new org.quartz.SimpleTrigger(newTriggerId(),
Scheduler.DEFAULT_MANUAL_TRIGGERS, jobName, groupName,
new Date(), null, 0, 0);
trig.setVolatility(false);
trig.computeFirstFireTime(null);
if(data != null) {
trig.setJobDataMap(data);
}
boolean collision = true;
while (collision) {
try {
resources.getJobStore().storeTrigger(ctxt, trig, false);
collision = false;
} catch (ObjectAlreadyExistsException oaee) {
trig.setName(newTriggerId());
}
}
notifySchedulerThread(trig.getNextFireTime().getTime());
notifySchedulerListenersSchduled(trig);
}
示例2: triggerJobWithVolatileTrigger
import org.quartz.Trigger; //導入方法依賴的package包/類
/**
* <p>
* Trigger the identified <code>{@link org.quartz.Job}</code> (execute it
* now) - with a volatile trigger.
* </p>
*/
public void triggerJobWithVolatileTrigger(SchedulingContext ctxt,
String jobName, String groupName, JobDataMap data) throws SchedulerException {
validateState();
if(groupName == null) {
groupName = Scheduler.DEFAULT_GROUP;
}
Trigger trig = new org.quartz.SimpleTrigger(newTriggerId(),
Scheduler.DEFAULT_MANUAL_TRIGGERS, jobName, groupName,
new Date(), null, 0, 0);
trig.setVolatility(true);
trig.computeFirstFireTime(null);
if(data != null) {
trig.setJobDataMap(data);
}
boolean collision = true;
while (collision) {
try {
resources.getJobStore().storeTrigger(ctxt, trig, false);
collision = false;
} catch (ObjectAlreadyExistsException oaee) {
trig.setName(newTriggerId());
}
}
notifySchedulerThread(trig.getNextFireTime().getTime());
notifySchedulerListenersSchduled(trig);
}