public Timer createCalendarTimer(final ScheduleExpression scheduleExpression, final TimerConfig timerConfig) throws IllegalArgumentException, IllegalStateException, EJBException {
return ejbTimerService.createTimer(primaryKey, ejbTimeout, copy(scheduleExpression), timerConfig);
}
private ScheduleExpression copy(final ScheduleExpression scheduleExpression) {
final ScheduleExpression scheduleExpressionCopy = new ScheduleExpression();
scheduleExpressionCopy.year(scheduleExpression.getYear());
scheduleExpressionCopy.month(scheduleExpression.getMonth());
scheduleExpressionCopy.dayOfMonth(scheduleExpression.getDayOfMonth());
scheduleExpressionCopy.dayOfWeek(scheduleExpression.getDayOfWeek());
scheduleExpressionCopy.hour(scheduleExpression.getHour());
scheduleExpressionCopy.minute(scheduleExpression.getMinute());
scheduleExpressionCopy.second(scheduleExpression.getSecond());
scheduleExpressionCopy.start(scheduleExpression.getStart());
scheduleExpressionCopy.end(scheduleExpression.getEnd());
scheduleExpressionCopy.timezone(scheduleExpression.getTimezone());
return scheduleExpressionCopy;
}