It's not a secret anymore!*
The moose likes Servlets and the fly likes How to add a class to Tomcat-5.5 startup Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to add a class to Tomcat-5.5 startup" Watch "How to add a class to Tomcat-5.5 startup" New topic
Author

How to add a class to Tomcat-5.5 startup

Jai Muthunalla
Greenhorn

Joined: Jan 01, 2008
Posts: 11
I'm writing an Poller service(thread based class) which reads from a properties file & sets some LOG parameters of Java logging package.
This class would act like a Demon thread, polling in the background every few mintues.
I want this Poller class to be invoked/started on start-up of Tomcat web-server.
I DON'T want this to be part of any web application.

Can someone please let me know how do I achieve this?

Thanks in advance.


SCJP(1.4)
Marco Ehrentreich
best scout
Bartender

Joined: Mar 07, 2007
Posts: 1280

Hi Jai,

you could use Apache commons daemon. This can help you to run Java applications like UNIX daemons or Windows services. With this you could simply start your daemon from the startup script of Tomcat.

Marco
Jai Muthunalla
Greenhorn

Joined: Jan 01, 2008
Posts: 11
Thanks for the lead Marco...I'll give it a try
Marco Ehrentreich
best scout
Bartender

Joined: Mar 07, 2007
Posts: 1280

Good luck with it

By the way, under Linux Tomcat itself is using the UNIX variant of Commons Daemon, "jsvc".
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to add a class to Tomcat-5.5 startup
 
Similar Threads
Help understanding jpoller
Help with adding class to Tomcat-5.5 startup
Thread synchornization across multiple application servers
RSS Invorma
How to add a class to Tomcat-5.5 startup