if (scheduleAnnotation != null) {
scheduleAnnotationList.add(scheduleAnnotation);
}
for (final Schedule schedule : scheduleAnnotationList) {
final Timer timer = new Timer();
timer.setPersistent(schedule.persistent());
timer.setInfo(schedule.info() == null || schedule.info().isEmpty() ? null : schedule.info());
timer.setTimezone(schedule.timezone() == null || schedule.timezone().isEmpty() ? null : schedule.timezone());
//Copy TimerSchedule
final TimerSchedule timerSchedule = new TimerSchedule();
timerSchedule.setSecond(schedule.second());
timerSchedule.setMinute(schedule.minute());
timerSchedule.setHour(schedule.hour());
timerSchedule.setDayOfWeek(schedule.dayOfWeek());
timerSchedule.setDayOfMonth(schedule.dayOfMonth());
timerSchedule.setMonth(schedule.month());
timerSchedule.setYear(schedule.year());
timer.setSchedule(timerSchedule);
//Copy Method Signature
timer.setTimeoutMethod(new NamedMethod(method.get()));
timers.add(timer);
}
}
}