本文整理了Java中org.quartz.Trigger.setName()
方法的一些代码示例,展示了Trigger.setName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Trigger.setName()
方法的具体详情如下:
包路径:org.quartz.Trigger
类名称:Trigger
方法名:setName
[英]Set the name of this Trigger
.
[中]设置此Trigger
的名称。
代码示例来源:origin: quartz/quartz-all
/**
* <p>
* Set the given <code>Trigger</code>'s name to the given value, and its
* group to the default group (<code>Scheduler.DEFAULT_GROUP</code>).
* </p>
*
* @deprecated use org.quartz.TriggerUtils instead!
*
*/
public static void setTriggerIdentity(Trigger trig, String name) {
trig.setName(name);
trig.setGroup(Scheduler.DEFAULT_GROUP);
}
代码示例来源:origin: com.opensymphony.quartz/com.springsource.org.quartz
/**
* <p>
* Set the given <code>Trigger</code>'s name to the given value, and its
* group to the default group (<code>Scheduler.DEFAULT_GROUP</code>).
* </p>
*
* @deprecated use org.quartz.TriggerUtils instead!
*
*/
public static void setTriggerIdentity(Trigger trig, String name) {
trig.setName(name);
trig.setGroup(Scheduler.DEFAULT_GROUP);
}
代码示例来源:origin: com.opensymphony.quartz/com.springsource.org.quartz
/**
* <p>
* Set the given <code>Trigger</code>'s name to the given value, and its
* group to the given group.
* </p>
*
* @deprecated use org.quartz.TriggerUtils instead!
*
*/
public static void setTriggerIdentity(Trigger trig, String name,
String group) {
trig.setName(name);
trig.setGroup(group);
}
代码示例来源:origin: quartz/quartz-all
/**
* <p>
* Set the given <code>Trigger</code>'s name to the given value, and its
* group to the given group.
* </p>
*
* @deprecated use org.quartz.TriggerUtils instead!
*
*/
public static void setTriggerIdentity(Trigger trig, String name,
String group) {
trig.setName(name);
trig.setGroup(group);
}
代码示例来源:origin: com.opensymphony.quartz/com.springsource.org.quartz
/**
* <p>
* Set the given <code>Trigger</code>'s name to the given value, and its
* group to the given group.
* </p>
*
* @param trig the tigger to change name to
* @param name the new trigger name
* @param group the new trigger group
*/
public static void setTriggerIdentity(
Trigger trig, String name, String group) {
trig.setName(name);
trig.setGroup(group);
}
代码示例来源:origin: quartz/quartz-all
/**
* <p>
* Set the given <code>Trigger</code>'s name to the given value, and its
* group to the given group.
* </p>
*
* @param trig the tigger to change name to
* @param name the new trigger name
* @param group the new trigger group
*/
public static void setTriggerIdentity(
Trigger trig, String name, String group) {
trig.setName(name);
trig.setGroup(group);
}
代码示例来源:origin: quartz/quartz-all
/**
* <p>
* Create a <code>Trigger</code> with the given name, and default group.
* </p>
*
* <p>
* Note that the {@link #setJobName(String)}and
* {@link #setJobGroup(String)}methods must be called before the <code>Trigger</code>
* can be placed into a {@link Scheduler}.
* </p>
*
* @param group if <code>null</code>, Scheduler.DEFAULT_GROUP will be used.
*
* @exception IllegalArgumentException
* if name is null or empty, or the group is an empty string.
*/
public Trigger(String name) {
setName(name);
setGroup(null);
}
代码示例来源:origin: quartz/quartz-all
/**
* <p>
* Create a <code>Trigger</code> with the given name, and group.
* </p>
*
* <p>
* Note that the {@link #setJobName(String)}and
* {@link #setJobGroup(String)}methods must be called before the <code>Trigger</code>
* can be placed into a {@link Scheduler}.
* </p>
*
* @param group if <code>null</code>, Scheduler.DEFAULT_GROUP will be used.
*
* @exception IllegalArgumentException
* if name is null or empty, or the group is an empty string.
*/
public Trigger(String name, String group) {
setName(name);
setGroup(group);
}
代码示例来源:origin: quartz/quartz-all
/**
* <p>
* Make a trigger that will fire every N seconds, with the given number of
* repeats.
* </p>
*
* <p>
* The generated trigger will not have its group,
* or end-time set. The Start time defaults to 'now'.
* </p>
*
* @param trigName the trigger's name
* @param intervalInSeconds the number of seconds between firings
* @param repeatCount the number of times to repeat the firing
* @return the new trigger
*/
public static Trigger makeSecondlyTrigger(
String trigName, int intervalInSeconds, int repeatCount) {
Trigger trig = makeSecondlyTrigger(intervalInSeconds, repeatCount);
trig.setName(trigName);
return trig;
}
代码示例来源:origin: quartz/quartz-all
/**
* <p>
* Make a trigger that will fire every N hours, with the given number of
* repeats.
* </p>
*
* <p>
* The generated trigger will not have its group,
* or end-time set. The Start time defaults to 'now'.
* </p>
*
* @param trigName the trigger's name
* @param intervalInHours the number of hours between firings
* @param repeatCount the number of times to repeat the firing
* @return the new trigger
*/
public static Trigger makeHourlyTrigger(
String trigName, int intervalInHours, int repeatCount) {
Trigger trig =makeHourlyTrigger(intervalInHours, repeatCount);
trig.setName(trigName);
return trig;
}
代码示例来源:origin: com.opensymphony.quartz/com.springsource.org.quartz
/**
* <p>
* Create a <code>Trigger</code> with the given name, and group.
* </p>
*
* <p>
* Note that the {@link #setJobName(String)}and
* {@link #setJobGroup(String)}methods must be called before the <code>Trigger</code>
* can be placed into a {@link Scheduler}.
* </p>
*
* @param group if <code>null</code>, Scheduler.DEFAULT_GROUP will be used.
*
* @exception IllegalArgumentException
* if name is null or empty, or the group is an empty string.
*/
public Trigger(String name, String group) {
setName(name);
setGroup(group);
}
代码示例来源:origin: quartz/quartz-all
/**
* <p>
* Make a trigger that will fire every day at the given time.
* </p>
*
* <p>
* The generated trigger will not have its group or end-time set.
* The Start time defaults to 'now'.
* </p>
*
* @param trigName the trigger's name
* @param hour the hour (0-23) upon which to fire
* @param minute the minute (0-59) upon which to fire
* @return the newly created trigger
*/
public static Trigger makeDailyTrigger(
String trigName, int hour, int minute) {
Trigger trig = makeDailyTrigger(hour, minute);
trig.setName(trigName);
return trig;
}
代码示例来源:origin: com.opensymphony.quartz/com.springsource.org.quartz
/**
* <p>
* Make a trigger that will fire every N minutes, with the given number of
* repeats.
* </p>
*
* <p>
* The generated trigger will not have its group,
* or end-time set. The Start time defaults to 'now'.
* </p>
*
* @param trigName the trigger's name
* @param intervalInMinutes the number of minutes between firings
* @param repeatCount the number of times to repeat the firing
* @return the new trigger
*/
public static Trigger makeMinutelyTrigger(
String trigName, int intervalInMinutes, int repeatCount) {
Trigger trig = makeMinutelyTrigger(intervalInMinutes, repeatCount);
trig.setName(trigName);
return trig;
}
代码示例来源:origin: quartz/quartz-all
/**
* <p>
* Make a trigger that will fire every N minutes, with the given number of
* repeats.
* </p>
*
* <p>
* The generated trigger will not have its group,
* or end-time set. The Start time defaults to 'now'.
* </p>
*
* @param trigName the trigger's name
* @param intervalInMinutes the number of minutes between firings
* @param repeatCount the number of times to repeat the firing
* @return the new trigger
*/
public static Trigger makeMinutelyTrigger(
String trigName, int intervalInMinutes, int repeatCount) {
Trigger trig = makeMinutelyTrigger(intervalInMinutes, repeatCount);
trig.setName(trigName);
return trig;
}
代码示例来源:origin: com.opensymphony.quartz/com.springsource.org.quartz
/**
* <p>
* Make a trigger that will fire every day at the given time.
* </p>
*
* <p>
* The generated trigger will not have its group or end-time set.
* The Start time defaults to 'now'.
* </p>
*
* @param trigName the trigger's name
* @param hour the hour (0-23) upon which to fire
* @param minute the minute (0-59) upon which to fire
* @return the newly created trigger
*/
public static Trigger makeDailyTrigger(
String trigName, int hour, int minute) {
Trigger trig = makeDailyTrigger(hour, minute);
trig.setName(trigName);
return trig;
}
代码示例来源:origin: approvals/ApprovalTests.Java
/***********************************************************************/
public static Trigger createTrigger(Trigger trigger, String name, String defaultGroup)
{
trigger.setName(name);
trigger.setGroup(defaultGroup);
trigger.setStartTime(new Date());
trigger.setEndTime(new Date(Long.MAX_VALUE));
return trigger;
}
}
代码示例来源:origin: com.opensymphony.quartz/com.springsource.org.quartz
/**
* <p>
* Create a <code>Trigger</code> with the given name, and group.
* </p>
*
* @param group if <code>null</code>, Scheduler.DEFAULT_GROUP will be used.
*
* @exception IllegalArgumentException
* if name is null or empty, or the group is an empty string.
*/
public Trigger(String name, String group, String jobName, String jobGroup) {
setName(name);
setGroup(group);
setJobName(jobName);
setJobGroup(jobGroup);
}
代码示例来源:origin: quartz/quartz-all
/**
* <p>
* Create a <code>Trigger</code> with the given name, and group.
* </p>
*
* @param group if <code>null</code>, Scheduler.DEFAULT_GROUP will be used.
*
* @exception IllegalArgumentException
* if name is null or empty, or the group is an empty string.
*/
public Trigger(String name, String group, String jobName, String jobGroup) {
setName(name);
setGroup(group);
setJobName(jobName);
setJobGroup(jobGroup);
}
代码示例来源:origin: com.atlassian.scheduler/atlassian-scheduler-quartz1
public Trigger buildTrigger(final JobId jobId, final JobConfig jobConfig)
throws SchedulerServiceException {
final byte[] parameters = parameterMapSerializer.serializeParameters(jobConfig.getParameters());
final Trigger trigger = buildTrigger(jobConfig.getSchedule());
trigger.setGroup(QUARTZ_TRIGGER_GROUP);
trigger.setName(jobId.toString());
trigger.getJobDataMap().put(QUARTZ_PARAMETERS_KEY, parameters);
return trigger;
}
代码示例来源:origin: org.jmxtrans/jmxtrans-core
private Trigger createTrigger(Server server) throws ParseException {
int runPeriod = configuration.getRunPeriod();
Trigger trigger;
if (server.getCronExpression() != null && CronExpression.isValidExpression(server.getCronExpression())) {
CronTrigger cTrigger = new CronTrigger();
cTrigger.setCronExpression(server.getCronExpression());
trigger = cTrigger;
} else {
if (server.getRunPeriodSeconds() != null) {
runPeriod = server.getRunPeriodSeconds();
}
trigger = TriggerUtils.makeSecondlyTrigger(runPeriod);
// TODO replace Quartz with a ScheduledExecutorService
}
trigger.setName(server.getHost() + ":" + server.getPort() + "-" + Long.toString(System.nanoTime()));
trigger.setStartTime(computeSpreadStartDate(runPeriod));
return trigger;
}
内容来源于网络,如有侵权,请联系作者删除!