Dear experts,
I received suggestion to provide a factory class in
javax.enterprise.concurrent package that returns a Trigger given an
expression in the calendar-based time format as defined in the EJB spec.
Application developers can use this factory method to easily create more
complex Triggers to be submitted to MSES. For example, to submit a task
that fires every Monday at midnight:
ManagedScheduledExecutorService executor;
String expression = "dayOfWeek=\"Mon\"";
// creates a Trigger that runs every Monday at midnight
Trigger trigger = CronTriggerFactory.create(expression);
Callable task = ...
mese.schedule(task, trigger);
Should we add such factory class? Comments and suggestions are welcome.
Regards
Anthony