David Blevins kirjoitti:
Alex Grönholm and I were chatting about what it will take to support the @Schedule functionality in EJB 3.1. We (the expert group) introduced some pretty good syntax to deal with a lot of advanced expressions that go beyond cron. I pulled down the Quartz source and poked around to see what we'd have to do.

Quartz has pretty much everything we'll need. One thing that Alex Grönholm pointed out on IRC was that the Quartz cron support does not allow specification of both dayOfWeek and dayOfMonth. So far EJB 3.1 allows this so it is possible to write a schedule that is executed every Friday the 13th, for example. That seems to be the only limitation so far.

Some small differences in syntax. For "first Monday of the month" Quartz uses "2#1" in EJB 3.1 we chose a more straight forward syntax of "1st Mon" as we can get away with spaces as we have separate attributes in the annotation for hour, dayOfWeek, year and so on rather than one expression string split on a spaces. We also went with spelling out "Last" instead of just using "L" and the Quartz "6L" for "last friday of the month" becomes "Last Fri" in EJB 3.1. Other than that, things are pretty much the same.

One thing EJB 3.1 has that I couldn't find digging in the Quartz source is "3 days from the end of the month" which can be expressed as "-3" in the dayOfMonth. Can't yet find a Quartz equivalent.

-David

I'm already in the process of writing a new quartz Trigger to solve these problems. I'll keep you updated on my progress.

Reply via email to