Randy Belknap wrote:
>
> > Also, why have the flag in a Singleton or in ServletContext? The flag can be a
>member variable
> > of the Servlet itself, one servlet, one flag (just remember to protect the flag
> > for concurrent access).
>
> The spec doesn't guarantee that only one instance of a servlet class
> will be instantiated.
Yes, I hadn't thought of that. Using the Singleton would also avoid the problem
of multiple timer threads - each servlet instance would check a Singleton
control flag to ensure that only one timer thread runs in all the instances.
However, I'm still of the opinion that in general servlets are not the best
solution to performing a periodic self-initiated task
Kevin Mukhar
___________________________________________________________________________
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