• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Kick-off Java pgm when tomcat starts

 
Morrison Julia
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Morrison Julia
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic