R
ramprasad.madathil
Hi,
I was wondering if there is any means by which I could launch my
own class when tomcat starts (in the same jvm).
This class would start a new thread that, in a loop, polls some
log files for updates and take appropriate action.
I know that I can possibly use a servlet with a load-on-startup
value greater than 1 and code my requirement into the init method.
However, using a servlet for a functionality different from servicing
http requests has me worried. (valid ?)
I googled hard and found that I could probably use a lifecycle
listener - but couldnt find any documentation on the how-to 's. Any
pointers would help.
I could also possibly use a Context Listener - will that help -
will I run into problems creating my own threads from within container
managed classes ?
Thanks in advance for any help.
Ram.
I was wondering if there is any means by which I could launch my
own class when tomcat starts (in the same jvm).
This class would start a new thread that, in a loop, polls some
log files for updates and take appropriate action.
I know that I can possibly use a servlet with a load-on-startup
value greater than 1 and code my requirement into the init method.
However, using a servlet for a functionality different from servicing
http requests has me worried. (valid ?)
I googled hard and found that I could probably use a lifecycle
listener - but couldnt find any documentation on the how-to 's. Any
pointers would help.
I could also possibly use a Context Listener - will that help -
will I run into problems creating my own threads from within container
managed classes ?
Thanks in advance for any help.
Ram.