• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Automating Servlet Tasks

 
Bartender
Posts: 1971
17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Bartender
Posts: 1971
17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for all replies!
 
reply
    Bookmark Topic Watch Topic
  • New Topic