The fourth installment of Monson-Haefel's Guide to Enterprise JavaBeans, 'EJB 2.1: The Timer Service', has been posted. This article describes the EJB Timer Service API, its use with entity, stateless session, and message-driven beans, and provides some criticism and suggested improvements of the Timer Service.
Read Richard Monson-Haefel's 'EJB 2.1: The Timer Service'
-
Monson-Haefel's Guide to EJB 2.1: The Timer Service Posted (9 messages)
- Posted by: Nate Borg
- Posted on: October 15 2002 00:39 EDT
Threaded Messages (9)
- Monson-Haefel's Guide to EJB 2.1: The Timer Service Posted by Joni Freeman on October 16 2002 07:39 EDT
- Monson-Haefel's Guide to EJB 2.1: The Timer Service Posted by Argyn K on October 16 2002 09:14 EDT
- Monson-Haefel's Guide to EJB 2.1: The Timer Service Posted by Shahid Mohammed on October 16 2002 13:19 EDT
- Monson-Haefel's Guide to EJB 2.1: The Timer Service Posted by Ga Sing Li on October 16 2002 15:15 EDT
- Monson-Haefel's Guide to EJB 2.1: The Timer Service Posted by Haytham A on October 16 2002 15:52 EDT
- Monson-Haefel's Guide to EJB 2.1: The Timer Service Posted by Andrea Mattioli on October 27 2002 06:27 EST
- I agree by Colin Jacobs on March 11 2003 03:51 EST
- Monson-Haefel's Guide to EJB 2.1: The Timer Service Posted by Li Ping on May 01 2004 01:03 EDT
- Monson-Haefel's Guide to EJB 2.1: The Timer Service Posted by Andrea Mattioli on October 27 2002 06:27 EST
- Job schedulers, J2EE by Sean Sullivan on October 22 2002 14:12 EDT
-
Monson-Haefel's Guide to EJB 2.1: The Timer Service Posted[ Go to top ]
- Posted by: Joni Freeman
- Posted on: October 16 2002 07:39 EDT
- in response to Nate Borg
The same serious deficiency is in the JMX timer service. It is really painful to implement some real world use cases with millisecond based interval timer. Your code is soon full of various calendar and timer related management. I hope the spec team adds a cron like functionality to both timer services ASAP. Meanwhile, it might be a nice open source project? -
Monson-Haefel's Guide to EJB 2.1: The Timer Service Posted[ Go to top ]
- Posted by: Argyn K
- Posted on: October 16 2002 09:14 EDT
- in response to Nate Borg
Monson-Haefel constantly writes books and papers on J2EE stuff. I wonder, how much he actually develops with J2EE? Aren't his books pure theoretical textbooks?
I actually studied EJB with his first book. I liked it at that time 3 years ago. But since then, after implementing several J2EE projects, things look very different to me now. -
Monson-Haefel's Guide to EJB 2.1: The Timer Service Posted[ Go to top ]
- Posted by: Shahid Mohammed
- Posted on: October 16 2002 13:19 EDT
- in response to Argyn K
Here is a sample of Monson-Haefel's work. -
Monson-Haefel's Guide to EJB 2.1: The Timer Service Posted[ Go to top ]
- Posted by: Ga Sing Li
- Posted on: October 16 2002 15:15 EDT
- in response to Argyn K
Does anybody really use any of the "middleware" power of J2EE as prescribe by Sun's blueprint? I am talking about security, transaction, deployment. What I've seen in serveral company is just a big mess of Struts/JSP, a bunch of Struts Actions doing the same processing over and over with no caching, a bunch of JavaScript mixed in. None actually use EJB because "it's easier to go to the database directly, we'll do that in the next phase". There isWeblogic app servers, and that makes it J2EE :).
But no matter, Mr. Monson-Haefel can really explain these stuff better than anyone else. Thank you very much and keep writing. If these stuff is any good, someone will get it and make good use of it.
-
Monson-Haefel's Guide to EJB 2.1: The Timer Service Posted[ Go to top ]
- Posted by: Haytham A
- Posted on: October 16 2002 15:52 EDT
- in response to Nate Borg
I hope the expert group adopts the cron-like scheduling facilities since it is not hard (as Richard explained.) -
Monson-Haefel's Guide to EJB 2.1: The Timer Service Posted[ Go to top ]
- Posted by: Andrea Mattioli
- Posted on: October 27 2002 06:27 EST
- in response to Haytham A
I think Richard's cron-like-syntax solution lacks internationalization support. Perhaps it should be better to use a more OO approach creating a Schedule interface that encapsulate informations the timer service need to perform its operations.
Then you can create classes that implements this interface like a GregorianSchedule in which you can set fields like month, day of the week, etc. in a way similar you do in a Calendar.
If you like cron-like-syntax you will be able to subclass it and define a constructor that accept a String or, better, you can write a CronScheduleFormat that knows how to convert between a cron-like String and a Schedule object and back. -
I agree[ Go to top ]
- Posted by: Colin Jacobs
- Posted on: March 11 2003 15:51 EST
- in response to Andrea Mattioli
Cron is attractive because it's familiar (to some), but not very intuitive or porttable as you said. Rather than
timerService.createTimer("23 * * * 1,3", start, end, null);
I'd rather see calls like
timerService.createTimer(TimerService.EVERY, TimerService.MONDAY | TimerService.WEDNESDAY, ...);
timerService.createTimer(TimerService.NEXT, TimerService.WEEKDAY, ...);
timerService.createTimer(TimerService.EVERY, TimerService.MONDAY | TimerService.WEDNESDAY, ...);
etc. -
Monson-Haefel's Guide to EJB 2.1: The Timer Service Posted[ Go to top ]
- Posted by: Li Ping
- Posted on: May 01 2004 01:03 EDT
- in response to Andrea Mattioli
how does the Timer Service behave in the clustered Env?
how to use it to schedule a batching job, for example of Database cleanup,
it is not acceptable to run multiple times for the same job in different
clustered instance. -
Job schedulers, J2EE[ Go to top ]
- Posted by: Sean Sullivan
- Posted on: October 22 2002 14:12 EDT
- in response to Nate Borg