>Hi,
>
[quoted text clipped - 16 lines]
>will I run into problems creating my own threads from within container
>managed classes ?
Definitely, use a Context Listener, specifically, the
javax.Servlet.ServletContextListener
See here:
http://www.onjava.com/pub/a/onjava/2001/04/12/listeners.html
> Thanks in advance for any help.
>
>Ram.
--
now with more cowbell
Ram - 08 Nov 2005 06:32 GMT
Thanks for the reply, Bryce.
I guess I have to use a listener after all - either the
ServletContextListener or Tomcat specific Lifecycle Listener, though
the later, as I said binds me to Tomcat (which is ok for me).
Are there any other specific (dis)advantages of using either especially
when I have to create threads from within them (on context startup)?
Other than memory leaks, killing the thread objects & associated
resources on context shutdown, is there anything else that I need to
watch out for while using threads.
I need to instantiate a Thread/TimerTask because the requirement is
such that the application would have continous data drops (in the form
of logs) which has to be picked up, parsed and pushed into a db.
Another part of the application reads the data from the db on requests
(http) and displays it over the web. The thread has to poll for arrival
of new logs and then hand it over to a framework for parsing and
inserting the parsed data to a db.
Thanks,
Ram.