This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Kick-off Java pgm when tomcat starts Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Products » Tomcat
Reply 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: 8147
    
  52

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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Kick-off Java pgm when tomcat starts
 
Similar Threads
Listeners in a cluster
Running batch job on jboss server
Problems with Tomcat as service on Windows Server 2003
How to make an object strongly reachable?
Making asynchronous calls in Java