On Tue, 28 Aug 2001, Radek Wisniewski wrote:

> Be aware of fail ower issues. Microsfts centralized "Passport" concept is
> not a good idea.

why not?  we are looking at a similar solution and I'd be interested to
hear criticisms and alternatives.

cheesr
dim



> 
> Radek Wisniewski
> www.datenknecht.de
> 
> On Tue, 28 Aug 2001, Micael Ericsson (QIN) wrote:
> 
> > Correct. Singelton approach only works if 'application' only runs on one 
>webserver/same JVM session.
> >
> > Database or shared property file is another approach for 'global settings'.
> >
> > /Micael E.
> >
> > -----Original Message-----
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, August 28, 2001 3:45 PM
> > To: [EMAIL PROTECTED]
> > Subject: RE:RE: How to share a variable of a service class among
> > different clients' requests?
> >
> >
> > but a request to a web server is statless.
> > the only think that you can do is: do a request and listen a response. different 
>thinks are out of 'normal' implementation. the concept of static variable are a 
>forced work that a web server can do and onother web server cannot. i think you need 
>to find others solution at you software. again, consider tha case where you have a 
>balancing between some machine. who of these have you static variable?
> >
> > federico
> >
> > ps: sorry for my english.
> >
> > >>>>>>
> >
> > Design pattern Singelton solves this. Creating one unique instance that can be 
>acces by several 'services'. This instance 'lives' from first acces until 
>webserver/soap stops.
> >
> > Creating this in Java is easy:
> > - make constructor private so that it is not accesible from outside
> > - make a static method for getting sole instance like:
> > >final public class GlobalSettings
> > >{
> > >  private globalSettings() {};
> > >  public static GlobalSettings getInstance()
> > >  {
> > >   if (soleInstance == null)
> > >           soleInstance = new GlobalSettings ();
> > >   return soleInstance;
> > >  }
> > >  ...
> > >}
> > >private GlobalSettings soleInstance = null;
> >
> > Then add get/set methods for parameters you want to share.
> >
> > /Micael E.
> >
> > -----Original Message-----
> > From: Wenbiao Han [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, August 28, 2001 3:11 PM
> > To: [EMAIL PROTECTED]
> > Subject: How to share a variable of a service class among different
> > clients' requests?
> >
> >
> >  Hi:
> >
> >  Suppose a member variable x of a Java service class X has a HashTable type,
> > I am wondering how the different clients can add or delete entries in the
> > variable x? Can I set the scope of the service class as "application" and
> > synchronize the adding/deleting mehods when the client
> > wants to add/delete the HashTable entries?
> >
> >  As I understand, only one instance of a service class is created if
> > "application" scope is set. The question is whether the same variable
> > instance X.x can be accessed by different clients?
> >
> >  Thanks in advance for your answers
> >
> > Kelvin
> >
> 
> 

Reply via email to