本文整理了Java中javax.ejb.Timer.getSchedule()
方法的一些代码示例,展示了Timer.getSchedule()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Timer.getSchedule()
方法的具体详情如下:
包路径:javax.ejb.Timer
类名称:Timer
方法名:getSchedule
[英]Get the schedule expression corresponding to this timer.
[中]获取与此计时器对应的计划表达式。
代码示例来源:origin: wildfly/wildfly
private static void addSchedule(Timer timer, ModelNode timerNode, final String componentName) {
try {
final ModelNode schedNode = timerNode.get(SCHEDULE);
ScheduleExpression sched = timer.getSchedule();
addScheduleDetailString(schedNode, sched.getYear(), YEAR);
addScheduleDetailString(schedNode, sched.getMonth(), MONTH);
addScheduleDetailString(schedNode, sched.getDayOfMonth(), DAY_OF_MONTH);
addScheduleDetailString(schedNode, sched.getDayOfWeek(), DAY_OF_WEEK);
addScheduleDetailString(schedNode, sched.getHour(), HOUR);
addScheduleDetailString(schedNode, sched.getMinute(), MINUTE);
addScheduleDetailString(schedNode, sched.getSecond(), SECOND);
addScheduleDetailString(schedNode, sched.getTimezone(), TIMEZONE);
addScheduleDetailDate(schedNode, sched.getStart(), START);
addScheduleDetailDate(schedNode, sched.getEnd(), END);
} catch (IllegalStateException e) {
// ignore
} catch (NoSuchObjectLocalException e) {
// ignore
} catch (EJBException e) {
logTimerFailure(componentName, e);
}
}
代码示例来源:origin: eu.agilejava/snoop
public void register(final String clientId) {
sendMessage(REGISTER_ENDPOINT, applicationConfig.toJSON());
ScheduleExpression schedule = new ScheduleExpression();
schedule.second("*/10").minute("*").hour("*").start(Calendar.getInstance().getTime());
TimerConfig config = new TimerConfig();
config.setPersistent(false);
Timer timer = timerService.createCalendarTimer(schedule, config);
LOGGER.config(() -> timer.getSchedule().toString());
}
代码示例来源:origin: ivargrimstad/snoop
public void register(final String clientId) {
sendMessage(REGISTER_ENDPOINT, applicationConfig.toJSON());
ScheduleExpression schedule = new ScheduleExpression();
schedule.second("*/10").minute("*").hour("*").start(Calendar.getInstance().getTime());
TimerConfig config = new TimerConfig();
config.setPersistent(false);
Timer timer = timerService.createCalendarTimer(schedule, config);
LOGGER.config(() -> timer.getSchedule().toString());
}
代码示例来源:origin: imixs/imixs-workflow
configItemCollection.replaceItemValue("Schedule", timer.getSchedule().toString());
} else {
configItemCollection.replaceItemValue("Schedule", "");
代码示例来源:origin: org.jboss.as/jboss-as-ejb3
private static void addSchedule(Timer timer, ModelNode timerNode, final String componentName) {
try {
final ModelNode schedNode = timerNode.get(SCHEDULE);
ScheduleExpression sched = timer.getSchedule();
addScheduleDetailString(schedNode, sched.getYear(), YEAR);
addScheduleDetailString(schedNode, sched.getMonth(), MONTH);
addScheduleDetailString(schedNode, sched.getDayOfMonth(), DAY_OF_MONTH);
addScheduleDetailString(schedNode, sched.getDayOfWeek(), DAY_OF_WEEK);
addScheduleDetailString(schedNode, sched.getHour(), HOUR);
addScheduleDetailString(schedNode, sched.getMinute(), MINUTE);
addScheduleDetailString(schedNode, sched.getSecond(), SECOND);
addScheduleDetailString(schedNode, sched.getTimezone(), TIMEZONE);
addScheduleDetailDate(schedNode, sched.getStart(), START);
addScheduleDetailDate(schedNode, sched.getEnd(), END);
} catch (IllegalStateException e) {
// ignore
} catch (NoSuchObjectLocalException e) {
// ignore
} catch (EJBException e) {
logTimerFailure(componentName, e);
}
}
内容来源于网络,如有侵权,请联系作者删除!