Design pattern for J2EE platform scheduling service
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Michael_Link
Posted On:   Friday, November 22, 2002 12:58 AM

Hello everybody, I have a relatively simple project to develop a scheduling service for our J2EE platform. (Weblogic cluster). The service consists of a number of schedules, each with many alarms that should be fired once and only once at the correct time. I have a simple Java object at the moment (AlarmManager) which I use to add alarms and distribute them when they are due. The alarms are stored persistently in a database. I have come to the point where I need to select an architecture for the solution and am struggling to see which patterns would work best. I must ensure that there is only one AlarmManager for the entire platform (singleton) and my initial re   More>>

Hello everybody,


I have a relatively simple project to develop a scheduling service for our J2EE platform. (Weblogic cluster).


The service consists of a number of schedules, each with many alarms that should be fired once and only once at the correct time.


I have a simple Java object at the moment (AlarmManager) which I use to add alarms and distribute them when they are due. The alarms are stored persistently in a database.


I have come to the point where I need to select an architecture for the solution and am struggling to see which patterns would work best.


I must ensure that there is only one AlarmManager for the entire platform (singleton) and my initial reaction was to use a stateless session bean as a facade to the alarm manager.


My dilema is ensuring that there is only one AlarmManager in the system at any given time. I have understood that a singleton pattern in EJB is tricky/platform-specific/impossible.


So how shoul I create a single instance of the AlarmManager as a J2EE platform service?


I'd really appreciate any tips or pointers, Michael

   <<Less

Re: Design pattern for J2EE platform scheduling service

Posted By:   Anonymous  
Posted On:   Friday, January 3, 2003 09:03 AM

Weblogic (until 5.1) used to have TimeServices to do exactly this kind of stuff. You can use their design for your solution. More info about that is available at:

http://e-docs.bea.com/wls/docs70/time/time.html

Instead of rolling out your own solutions you can build your solution on top of the JMX timer services. Weblogic 7 implements this. More info on JMX :

http://java.sun.com/products/JavaManagement/


Good luck!
-Ashish
About | Sitemap | Contact