javax.ejb.Timer.getSchedule()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(3.4k)|赞(0)|评价(0)|浏览(138)

本文整理了Java中javax.ejb.Timer.getSchedule()方法的一些代码示例,展示了Timer.getSchedule()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Timer.getSchedule()方法的具体详情如下:
包路径:javax.ejb.Timer
类名称:Timer
方法名:getSchedule

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);
  }
}

相关文章