Monday, June 17, 2002 09:55 AM
The purpose of EJBs is to manage the instanciation and life span of object that would most likely have a defined life span. Like you mention, The solution is outside of EJBs, as they *shall not* deal with threads AT ALL.
At this point, there is no facility in the J2EE spec for creating standard cron-like services. However, most of the big players have developped their own API for that purpose. You can code for these APIs. They have also developed APIs to add your own code to the server's startup procedure.
If you still want to create a solution that works accross the board, I suggest you look into creating a servlet that will be instanciated when your web application is started, and that would include your timer facility. Servlets have no problem spawning threads, and you have the guaranty that the service will start with the web application. You could use the servlet life cycle API to persist the list of tasks when the server is shutdown.
hope this helps