use of javax.ejb.TimerConfig in project tomee by apache.
the class MethodScheduleBuilder method addSchedulesToMethod.
private void addSchedulesToMethod(final MethodContext methodContext, final MethodScheduleInfo info) {
if (methodContext == null) {
return;
}
for (final ScheduleInfo scheduleInfo : info.schedules) {
final ScheduleExpression expr = new ScheduleExpression();
expr.second(scheduleInfo.second == null ? "0" : scheduleInfo.second);
expr.minute(scheduleInfo.minute == null ? "0" : scheduleInfo.minute);
expr.hour(scheduleInfo.hour == null ? "0" : scheduleInfo.hour);
expr.dayOfWeek(scheduleInfo.dayOfWeek == null ? "*" : scheduleInfo.dayOfWeek);
expr.dayOfMonth(scheduleInfo.dayOfMonth == null ? "*" : scheduleInfo.dayOfMonth);
expr.month(scheduleInfo.month == null ? "*" : scheduleInfo.month);
expr.year(scheduleInfo.year == null ? "*" : scheduleInfo.year);
expr.timezone(scheduleInfo.timezone);
expr.start(scheduleInfo.start);
expr.end(scheduleInfo.end);
final TimerConfig config = new TimerConfig();
config.setInfo(scheduleInfo.info);
config.setPersistent(scheduleInfo.persistent);
methodContext.getSchedules().add(new ScheduleData(config, expr));
}
}
Aggregations