File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes Kick-off Java pgm when tomcat starts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Kick-off Java pgm when tomcat starts" Watch "Kick-off Java pgm when tomcat starts" New topic
Author

Kick-off Java pgm when tomcat starts

Morrison Julia
Greenhorn

Joined: Sep 04, 2006
Posts: 3
I've developed a web application and some standalone application. The standalone application is a batch process, developed using java. the batch process runs once in ever hr and i am using timer object to kick off the batch process every hr. the problem is initially someone has to call the timer object to kick off the batch process. now the question is how to automate starting the timer object ? I have a web application already running. is there a way i can attach the timer object to tomcat server ? basically whenever someone starts tomcat server, the timer object needs to be called.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10290
    
168

You could use a Servlet which is loaded on startup as part of your web application(i.e. a startup servlet). This startup servlet can then start the timer.


[My Blog] [JavaRanch Journal]
Morrison Julia
Greenhorn

Joined: Sep 04, 2006
Posts: 3
i am not sure startup servlet is a right solution but after some more research I found "Java Service Wrapper" (http://wrapper.tanukisoftware.org/doc/english/introduction.html) is the right solution.

thanks a lot for the startup servlet suggestion !!!
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Welcome to JavaRanch!

In an effort to help you get the most from our forums, we've compiled a
list of tips for asking questions here. You can find the list in our
FAQ section here.
In particular please see:
UseRealWords

Abbreviations such as "u" or "ur" in
place of "you" and "you are" or "you're" confound language translation software making
it hard for our non-English speaking members to read your posts.
"pgm" is not a word in the English language.

Again, welcome to JavaRanch and good luck with your question.
-Ben


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Kick-off Java pgm when tomcat starts