RE: Scheduled Process servlet: possible?

2002-01-29 Thread Brian Adams

I have a Thread class that does some stuff for me every night and I wrapped
that with a servlet that calls .start()  in the servlet init() method and
that servlet in loaded at start up via load-on-startup1/load-on-startup
tag in web.xml (look below)

this Thread class sleeps for 24 hours then wakes up and performs its duties
then sleeps



servlet
servlet-namePrinterCache/servlet-name
servlet-classPrinterCache/servlet-class
load-on-startup1/load-on-startup
/servlet






-Original Message-
From: Jeff Corliss [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 29, 2002 3:21 PM
To: [EMAIL PROTECTED]
Subject: Scheduled Process servlet: possible?


Hi all,

Is it possible to have a servlet's service method
auto-invoked on a scheduled basis by its container? 
Like say for example you want to have your app do some
auto-archiving of old data on a regular basis or
something like that?

Thanks,
Jeff


__
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions! 
http://auctions.yahoo.com

--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]

--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: Scheduled Process servlet: possible?

2002-01-29 Thread alec

Probably best to use a java.util.Timer

code snippet 

Timer t = new Timer();
t.schedule(Task,Date,INTERVAL)  // Task is an object that inplements 
java.util.TimerTask
// Date object is the time to first run
// Interval is howmany milli's between execution 


for more info read Java 2 API docs is encouraged and neccarcary...

hope this helps
Alec

29/01/2002 21:21:18, Jeff Corliss [EMAIL PROTECTED] wrote:

Hi all,

Is it possible to have a servlet's service method
auto-invoked on a scheduled basis by its container? 
Like say for example you want to have your app do some
auto-archiving of old data on a regular basis or
something like that?

Thanks,
Jeff


__
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions! 
http://auctions.yahoo.com

--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]








--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]