-
1. Re: Asynchronous running/Head scratching?
raja05 May 20, 2003 6:03 PM (in response to robbobkirk)There are many ways to do it.
1) Create a Startup servlet in your application and let it spawn a thread. this thread runs in an infinte loop waking up every 10 secs to output the log line
2) Create a MBean which gets started after your app is deployed. This class has a startService method(look up the Docs to know the Service lifecycle for mbeans) which spawns a thread that wakes up every 10 secs.
HTH
Raj -
2. Re: Asynchronous running/Head scratching?
robbobkirk May 21, 2003 2:49 AM (in response to robbobkirk)Thanks a lot for the help raja.
Are there any examples of either of the above, or documents that I can read. I'd read about MBeans but failed to find an example which I find the best way to get started.
Rob -
3. Re: Asynchronous running/Head scratching?
robbobkirk May 21, 2003 9:08 AM (in response to robbobkirk)I've managed to get a MBean running and talking to it via JMS- Thanks for the heads up.
I read that you shouldn't create threads within the J2EE Container but is that only for EJBs? -
4. Re: Asynchronous running/Head scratching?
juhalindfors May 24, 2003 2:02 PM (in response to robbobkirk)thats only for EJBs that live inside the container that is supposed to do all this resource management for you
MBeans in JBoss are more of a system level components, and you can freely have them do system level stuff, such as thread management.