本文整理汇总了Java中org.quartz.Scheduler.DEFAULT_GROUP属性的典型用法代码示例。如果您正苦于以下问题:Java Scheduler.DEFAULT_GROUP属性的具体用法?Java Scheduler.DEFAULT_GROUP怎么用?Java Scheduler.DEFAULT_GROUP使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.quartz.Scheduler
的用法示例。
在下文中一共展示了Scheduler.DEFAULT_GROUP属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
/**
* Check that all properties are properly set
*/
public void init() throws SchedulerException
{
PropertyCheck.mandatory(this, "scheduler", scheduler);
PropertyCheck.mandatory(this, "transactionService", transactionService);
PropertyCheck.mandatory(this, "repoUsageComponent", repoUsageComponent);
PropertyCheck.mandatory(this, "jobLockService", jobLockService);
// Trigger the scheduled updates
final JobDetail jobDetail = new JobDetail("rmj", Scheduler.DEFAULT_GROUP, RepoUsageMonitorJob.class);
jobDetail.getJobDataMap().put("RepoUsageMonitor", this);
final Trigger trigger = TriggerUtils.makeHourlyTrigger(12); // every 12 hours
trigger.setStartTime(new Date(System.currentTimeMillis() + 60L * 60L * 1000L)); // one hour from now
trigger.setName("rmt");
trigger.setGroup(Scheduler.DEFAULT_GROUP);
repoUsageComponent.observeRestrictions(this);
// Unschedule in case it was scheduled in an earlier retry of the transaction
scheduler.unscheduleJob("rmt", Scheduler.DEFAULT_GROUP);
scheduler.scheduleJob(jobDetail, trigger);
}
示例2: getTrigger
/**
* Build the cron trigger
*
* @return The trigger
* @throws Exception
*/
public Trigger getTrigger() throws Exception
{
Trigger trigger = new CronTrigger(getBeanName(), Scheduler.DEFAULT_GROUP, getCronExpression());
if (this.startDelay > 0)
{
trigger.setStartTime(new Date(System.currentTimeMillis() + this.startDelay));
}
JobDetail jd = super.getJobDetail();
if (jd != null)
{
String jobName = super.getJobDetail().getKey().getName();
if (jobName != null && !jobName.isEmpty())
{
trigger.setJobName(jobName);
}
String jobGroup = super.getJobDetail().getKey().getGroup();
if (jobGroup != null && !jobGroup.isEmpty())
{
trigger.setJobGroup(jobGroup);
}
}
return trigger;
}
示例3: rescheduleJob
/**
* <p>
* Remove (delete) the <code>{@link org.quartz.Trigger}</code> with the
* given name, and store the new given one - which must be associated
* with the same job.
* </p>
*
* @param triggerName
* The name of the <code>Trigger</code> to be removed.
* @param groupName
* The group name of the <code>Trigger</code> to be removed.
* @param newTrigger
* The new <code>Trigger</code> to be stored.
* @return <code>null</code> if a <code>Trigger</code> with the given
* name & group was not found and removed from the store, otherwise
* the first fire time of the newly scheduled trigger.
*/
public Date rescheduleJob(SchedulingContext ctxt, String triggerName,
String groupName, Trigger newTrigger) throws SchedulerException {
validateState();
if(groupName == null) {
groupName = Scheduler.DEFAULT_GROUP;
}
newTrigger.validate();
Calendar cal = null;
if (newTrigger.getCalendarName() != null) {
cal = resources.getJobStore().retrieveCalendar(ctxt,
newTrigger.getCalendarName());
}
Date ft = newTrigger.computeFirstFireTime(cal);
if (ft == null) {
throw new SchedulerException(
"Based on configured schedule, the given trigger will never fire.",
SchedulerException.ERR_CLIENT_ERROR);
}
if (resources.getJobStore().replaceTrigger(ctxt, triggerName, groupName, newTrigger)) {
notifySchedulerThread(newTrigger.getNextFireTime().getTime());
notifySchedulerListenersUnscheduled(triggerName, groupName);
notifySchedulerListenersSchduled(newTrigger);
} else {
return null;
}
return ft;
}
示例4: triggerJob
/**
* <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);
}
示例5: triggerJobWithVolatileTrigger
/**
* <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);
}
示例6: getTriggerState
/**
* <p>
* Get the current state of the identified <code>{@link Trigger}</code>.
* </p>
*
* @see Trigger#STATE_NORMAL
* @see Trigger#STATE_PAUSED
* @see Trigger#STATE_COMPLETE
* @see Trigger#STATE_ERROR
*/
public int getTriggerState(SchedulingContext ctxt, String triggerName,
String triggerGroup) throws SchedulerException {
validateState();
if(triggerGroup == null) {
triggerGroup = Scheduler.DEFAULT_GROUP;
}
return resources.getJobStore().getTriggerState(ctxt, triggerName,
triggerGroup);
}
示例7: checkProblems
@Override
public void checkProblems(List<String> problems) {
super.checkProblems(problems);
try {
new CronTrigger("0", Scheduler.DEFAULT_GROUP, cron);
} catch (Exception e) {
problems.add(prob_cronSyntax);
problems.add("###[" + e.getMessage() + "]");
}
}
示例8: getTriggersOfJob
/**
* <p>
* Get all <code>{@link Trigger}</code> s that are associated with the
* identified <code>{@link org.quartz.JobDetail}</code>.
* </p>
*/
public Trigger[] getTriggersOfJob(SchedulingContext ctxt, String jobName,
String groupName) throws SchedulerException {
validateState();
if(groupName == null) {
groupName = Scheduler.DEFAULT_GROUP;
}
return resources.getJobStore().getTriggersForJob(ctxt, jobName,
groupName);
}
示例9: setGroup
/**
* <p>
* Set the name of this <code>Trigger</code>.
* </p>
*
* @param group if <code>null</code>, Scheduler.DEFAULT_GROUP will be used.
*
* @exception IllegalArgumentException
* if group is an empty string.
*/
public void setGroup(String group) {
if (group != null && group.trim().length() == 0) {
throw new IllegalArgumentException(
"Group name cannot be an empty string.");
}
if(group == null) {
group = Scheduler.DEFAULT_GROUP;
}
this.group = group;
this.key = null;
}
示例10: setJobGroup
/**
* <p>
* Set the name of the associated <code>{@link org.quartz.JobDetail}</code>'s
* group.
* </p>
*
* @param jobGroup if <code>null</code>, Scheduler.DEFAULT_GROUP will be used.
*
* @exception IllegalArgumentException
* if group is an empty string.
*/
public void setJobGroup(String jobGroup) {
if (jobGroup != null && jobGroup.trim().length() == 0) {
throw new IllegalArgumentException(
"Group name cannot be null or empty.");
}
if(jobGroup == null) {
jobGroup = Scheduler.DEFAULT_GROUP;
}
this.jobGroup = jobGroup;
}
示例11: getTrigger
/**
* <p>
* Get the <code>{@link Trigger}</code> instance with the given name and
* group.
* </p>
*/
public Trigger getTrigger(SchedulingContext ctxt, String triggerName,
String triggerGroup) throws SchedulerException {
validateState();
if(triggerGroup == null) {
triggerGroup = Scheduler.DEFAULT_GROUP;
}
return resources.getJobStore().retrieveTrigger(ctxt, triggerName,
triggerGroup);
}
示例12: getJobNames
/**
* <p>
* Get the names of all the <code>{@link org.quartz.Job}s</code> in the
* given group.
* </p>
*/
public String[] getJobNames(SchedulingContext ctxt, String groupName)
throws SchedulerException {
validateState();
if(groupName == null) {
groupName = Scheduler.DEFAULT_GROUP;
}
return resources.getJobStore().getJobNames(ctxt, groupName);
}
示例13: pauseTrigger
/**
* <p>
* Pause the <code>{@link Trigger}</code> with the given name.
* </p>
*
*/
public void pauseTrigger(SchedulingContext ctxt, String triggerName,
String groupName) throws SchedulerException {
validateState();
if(groupName == null) {
groupName = Scheduler.DEFAULT_GROUP;
}
resources.getJobStore().pauseTrigger(ctxt, triggerName, groupName);
notifySchedulerThread(0L);
notifySchedulerListenersPausedTrigger(triggerName, groupName);
}
示例14: pauseTriggerGroup
/**
* <p>
* Pause all of the <code>{@link Trigger}s</code> in the given group.
* </p>
*
*/
public void pauseTriggerGroup(SchedulingContext ctxt, String groupName)
throws SchedulerException {
validateState();
if(groupName == null) {
groupName = Scheduler.DEFAULT_GROUP;
}
resources.getJobStore().pauseTriggerGroup(ctxt, groupName);
notifySchedulerThread(0L);
notifySchedulerListenersPausedTrigger(null, groupName);
}
示例15: pauseJob
/**
* <p>
* Pause the <code>{@link org.quartz.JobDetail}</code> with the given
* name - by pausing all of its current <code>Trigger</code>s.
* </p>
*
*/
public void pauseJob(SchedulingContext ctxt, String jobName,
String groupName) throws SchedulerException {
validateState();
if(groupName == null) {
groupName = Scheduler.DEFAULT_GROUP;
}
resources.getJobStore().pauseJob(ctxt, jobName, groupName);
notifySchedulerThread(0L);
notifySchedulerListenersPausedJob(jobName, groupName);
}