Aaron Mulder wrote:
On Thu, 14 Aug 2003, Jeremy Boynes wrote:

Please review the spec in detail - the EJB Timer Service has requirements
for persistent timers and IIRC notifications for events that happened when
the server was down.


        True, but I think we could write something simple using a file for
persistence and java.util.Timer if we wanted to meet the minimum
requirements.  There is no facility in the spec for cron-style scheduling
-- the only scheduling options are millisecond offsets, IIRC.  Granted, we
could certainly integrate a fancier package and offer more "value added"
features.  I'm trying to say I don't think we *need* to go there unless we
want to.

The only real downside to Timer it is the API. You have to cache a ref to the TimerTask to cancel it later - you can't just ask the Timer to cancel a task of a given name. You also can't pause or alter the schedule a TimerTask, but that's just a matter of doing cancel() and reschedule() against a cached ref. A Timer can be wrapped with any extra functionality later and it would save you writing the core scheduler from scratch. I wouldn't bother not using java.util.Timer.


Bill de h�ra



Reply via email to