The only thing to think about is how best to get the time from the user and convert that input to valid API ScheduleExpression calls. This is usually based on the user's knowledge, the best case scenario being that they can understand cron expressions.
@Resource TimerService timerService; //........ ScheduleExpression expression = new ScheduleExpression(); expression.second("*/1").minute("*").hour("*"); timerService.createCalendarTimer(expression);
user2000609 wrote:That would be a stupid polling implementation. He meant to create the scheduler with the user's input. No database checking involved (although you might want to save the schedulings in the DB for restart purposes).
You mean in this code, it will run every second to check the database whether a user set a schedule to generate a report?