tomcat-users mailing list archives

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

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 [mailto:Robert.Priest@bentley.com]
>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
>loaded
>when the Tomcat Server startsup and is alive and accessible to all
Servlets
>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"
license
>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
the
>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
has
>already retrieved a "per server" license, this call would just pass
back
>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?
I'm
>guessing)?
>Any documentation on doing this type of thing?
>
>
>
>Any help is appreciated.
>Thanks in advance.
>
>
>--
>To unsubscribe, e-mail:   <mailto:tomcat-user-
>unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: <mailto:tomcat-user-
>help@jakarta.apache.org>


--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message