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
posted
0
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
posted
0
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
posted
0
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.