tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <>
Subject RE: Object accessible to all servlets in the container.
Date Fri, 17 Jan 2003 17:07:44 GMT
1. Read up on the ServletContext object and ServletContextListener
implementations.  This information is in the Servlet specification,

2. Read up on the Singleton design pattern.  Do a google search for this
and you'll find lots of information.  You could have a LicenseManager
singleton do the things you describe below.

Yoav Shapira
Millennium ChemInformatics

>-----Original Message-----
>From: Robert Priest []
>Sent: Friday, January 17, 2003 11:50 AM
>To: 'Tomcat Users List'
>Subject: Object accessible to all servlets in the container.
>Hello all,
>I was wondering how\where in Tomcat could I create an Objectthat gets
>when the Tomcat Server startsup and is alive and accessible to all
>that are running.
>It could contain information about the server that a servlet may be
>interested in knowing, or could do things like retrieve a "server"
>for a particular set of functionality for a  servlet.
>For example, there would be like this ServerLicenseObject.
>if Servlet A runs a component that needs a "per server" license
>it contacts the ServerLicenseObject:
>ServerLicenseObject.getLicense() - if no license has been retrieved for
>server, it gets it.
>Then if Servlet B, want to run the same component which requires the a
>server license it calls
>ServerLicenseObject.getLicense() - now, in this case, since server A
>already retrieved a "per server" license, this call would just pass
>that license to Servlet B so that it may run the requested component.
>Is it possible?
>Does anyone know what I would use to get this done (JavaBean, maybe?
>Any documentation on doing this type of thing?
>Any help is appreciated.
>Thanks in advance.
>To unsubscribe, e-mail:   <mailto:tomcat-user-
>For additional commands, e-mail: <mailto:tomcat-user-

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message