• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Confuguring tomcat to Run Thread at rgular intervals of Time

 
ivin jacob
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have an appplication which needs to create and upddate RSS Xml at reglar intervals of time.

Creating the XML is done.

Now i need to run this bunch of code to create th XML at regular intervals of time. Can some one help me how to configure Tomcat to run it as a Thread
at tomcat start up and at regular intervals

I am using JDK6,tomcat6,JSF,ROME(for RSS).
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could use a ServletContextListener that sets up those threads using the java.util.Timer and TimerTask classes in its contextInitialized method.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic