File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Automating Servlet Tasks Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "Automating Servlet Tasks" Watch "Automating Servlet Tasks" New topic
Author

Automating Servlet Tasks

Mike London
Ranch Hand

Joined: Jul 12, 2002
Posts: 948
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

Joined: Nov 22, 2001
Posts: 248
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

Joined: Oct 29, 2001
Posts: 3
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 ]

SCJP2 89%<br />SCWCD 88%<br />SCEA PartI 87%<br />SCEA PartII ??
Mike London
Ranch Hand

Joined: Jul 12, 2002
Posts: 948
Thanks for all replies!
 
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: Automating Servlet Tasks
 
Similar Threads
Export in Excel
Is there any way to get Servlet Init Parameter using EL?
How can I change the sdk version of Websphere 4 if I already install it
Capturing Form Data
javascript, servlets and SVG