• Post Reply Bookmark Topic Watch Topic
  • New Topic

Automating Servlet Tasks

 
Mike London
Ranch Hand
Posts: 1290
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a way to have a servlet do something at regular intervals (once an hour, day, or other arbitrary interval)? For example, if I want a servlet to check to see if a directory has changed, could this be developed by starting another thread inside the serlvet and using java.util.Timer or similar approach?
Thanks for anyone's ideas.
-- Mike
 
Bhushan Jawle
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is exactly what a java.util.TimerTask is for.
Initiate one on init() or wherever the application requires it, and you can configure it to do some task at regular intervals
 
Hua Yu
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Mike London:
Is there a way to have a servlet do something at regular intervals (once an hour, day, or other arbitrary interval)? For example, if I want a servlet to check to see if a directory has changed, could this be developed by starting another thread inside the serlvet and using java.util.Timer or similar approach?
Thanks for anyone's ideas.
-- Mike

You may try Quartz instead of java.util.Timer...Quartz is an OpenSource Porject to meet the need of an Enterprise-Class Scheduler, check it out at SourceForge.net...
[ February 21, 2003: Message edited by: Hua Yu ]
 
Mike London
Ranch Hand
Posts: 1290
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for all replies!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!