One way to do it will be to create a background thread from the servlet
launched at startup. Then all servlets can communicate with this one using
shred objects ( either a static object, or via
ServleteContext().getServlet(), or via ServletContext()setAttribute(),
depending on taste and JSDK version ...).

Jacek

> -----Original Message-----
> From: Lee Coomber [SMTP:[EMAIL PROTECTED]]
> Sent: Thursday, October 28, 1999 09:58
> To:   [EMAIL PROTECTED]
> Subject:      A long lived servlet
>
> Hi
>
> I'm developing an application that requires a Java object (a logger) to
> run
> for the life of the servlet engine. Currently, I just use a daemon process
> but I would like to put it into a servlet so it is easily controllable via
> a web interface.
>
> Even if I define the servlet as a startup (I'm using JServ), the problem
> occurs with the API contract that allows the engine to destroy it at any
> time.
>
> Can anyone think of a 'legal' way of doing this without resorting to
> playing with the unix processes (or modifying JServ, it would be nice to
> be
> able to use it on JRun as well)?
>
> Many thanks for any answers,
>
> Lee
>
>
>
> [ > L A T E R A L * ~ ; ] - [ [EMAIL PROTECTED] ]
>
> Phone: +44 (0) 207 378 1011
> Fax: +44 (0) 207 403 4586
> Mobile: +44 (0) 7957 368 626
>
> __________________________________________________________________________
> _
> 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

___________________________________________________________________________
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

Reply via email to