simply instanciate an runnable object in the init() of the servlet and
let this thread sleep for the desired duration, do its job and let it
sleep again. but make sure that you keep a reference to the thread
object in your servlet like:
init(...){
...
MyRunnable myRunnable=new myRunnble();
}
this prevents this object from being garbage collected (at least as long
your servlet lives ;)
also make sure to nullify the object in the destroy method of your
servlet.
if you want to avoid trouble with garbage collection and to start your
thread with server startup simply make your servlet preload.
joern
MA wrote:
>
> Hello Guys:
> I'm trying to implement servlet invocation after
> certain time period automatically.
> The servlet will connect to a database, retrieve the
> data and then download it into a flat file. I want
> this process to be repeated after every 30 minutes.
> Any brain dump or pointers about how to implement this
> is appreciated.
>
> Thanks,
> Mub
> __________________________________________________
> Do You Yahoo!?
> Talk to your friends online with Yahoo! Messenger.
> http://messenger.yahoo.com
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
--
----------------
Joern Turner
inTouch GmbH
Kaiserin-Augusta-Allee 101, 10553 Berlin
Tel: 030 / 34 90 97 23
Fax: 030 / 34 90 97 25
[EMAIL PROTECTED]
----------------
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html