J
jbj
I am trying to start a daemon thread on the startup of tomcat, but so
far all I can find is how to make tomcat launch a servlet (and i could
then have the servlet launch the thread, but once done, it would close
and defeat the purpose). Is there anyway to let tomcat launch the
thread itself?
Lets say the thread is called ThreadCls, and it has a run function.
The only way i can see it is to make a Launcher class, and have that
class actually handle set ThreadCls to daemon and then starting it.
But as i mentioned, Launcher then exits (so tomcat can contiunue
loading), and that kills my deamon. Any idea of what to do? Thanks
far all I can find is how to make tomcat launch a servlet (and i could
then have the servlet launch the thread, but once done, it would close
and defeat the purpose). Is there anyway to let tomcat launch the
thread itself?
Lets say the thread is called ThreadCls, and it has a run function.
The only way i can see it is to make a Launcher class, and have that
class actually handle set ThreadCls to daemon and then starting it.
But as i mentioned, Launcher then exits (so tomcat can contiunue
loading), and that kills my deamon. Any idea of what to do? Thanks