you can implement this functionality using the database i n one JVM and direct the others to read it from there or replicate this database table to the other JVMs too.
Confidentiality Statement:-----Original Message-----
From: An interest list fo= r Sun=20 Java Center J2EE Pattern Catalog=20 [mailto:J2EEPATTERNS-INTEREST@JAVA.SUN.COM]On Behalf Of ashraf=20= galal
Sent: Thursday, December 02, 2004 3:13 PM
To:= =20 J2EEPATTERNS-INTEREST@JAVA.SUN.COM
Subject: Re: Singleton in=20= clustered environment=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=20 Companion Site: http://www.corej2eepatterns.com J2EE BluePrints:=20 http://java.sun.com/blueprints/corej2eepatterns List Archive:=20 http://archives.java.sun.com/archives/j2eepatterns-interest.html=20 Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@java.s= un.com=20you can implement this functionality using the database i n one JVM = and=20 direct the others to read it from there or replicate this database tabl= e to=20 the other JVMs too.
Ashraf Galal>From: "Varun Rally, Noida"= =20 <varunr@NOIDA.HCLTECH.COM> >Reply-To: An interest list for Sun= Java=20 Center J2EE Pattern Catalog <J2EEPATTERNS-INTEREST@JAVA.SUN.COM> = >To:=20 J2EEPATTERNS-INTEREST@JAVA.SUN.COM >Subject: Re: Singleton in cluste= red=20 environment >Date: Thu, 2 Dec 2004 14:39:58 +0530 > >My requir= ement=20 is that I need only one single instance for the whole >application i= n=20 clustered environment. > >i.e. even if there are more than one JV= Ms ,=20 all of them should access single >instance. > > > >Exact= =20 requirement is that we have a class that handles the locking >functi= onality=20 of documents in our > >Application. We create only one singleton = object=20 of this class and this >object maintains a map of locked documents. = >=20 > > >Now, in clustered environment, there will be more than on= e JVMs=20 and hence >more than one objects that are handling > >The lock= ing=20 information, which is actually wrong. > > > >I hope I am cl= ear in=20 my words. > >Waiting for your reply. > >Thanks and regards = >=20 > > >Varun Rally > > > > > > > > _____= >=20 >From: An interest list for Sun Java Center J2EE Pattern Catalog=20 >[mailto:J2EEPATTERNS-INTEREST@JAVA.SUN.COM] On Behalf Of Tubman Aha= ron=20 >Sent: Thursday, December 02, 2004 1:52 PM >To:=20 J2EEPATTERNS-INTEREST@JAVA.SUN.COM >Subject: Re: Singleton in cluste= red=20 environment > > > >I agree with Mall. It is bad practice to= access=20 singleton remotely. Can you >describe the meter of you problem? Whic= h kind=20 of service it provides? > > > > _____ > >From: An int= erest=20 list for Sun Java Center J2EE Pattern Catalog=20 >[mailto:J2EEPATTERNS-INTEREST@JAVA.SUN.COM] On Behalf Of Mall, Vish= nu=20 >(Cognizant) >Sent: Thursday, December 02, 2004 8:08 AM >To:=20= J2EEPATTERNS-INTEREST@JAVA.SUN.COM >Subject: Re: Singleton in cluste= red=20 environment > > > >Hi Varun, > > > >The Concept= of=20 Singleton is "one and only one instance of a class at any >given poi= nt of=20 time in a single JVM". The moment you mention a clustered >environme= nt, you=20 would end up having multiple JVMs and hence each JVM would >have an=20= instance of this Singleton class. Hope this helps. Do let me know >y= our=20 exact requirement in detail. > > > >Thanks and Regards, >= ;Vishnu=20 Mall >Cognizant Technology Solutions, >Technocomplex, Kolkata >= ;Ph :=20 2357 3211/12/13 Extn : 3253 >email : MVishnu@cal.cognizant.com >=20= >-----Original Message----- >From: Varun Rally, Noida=20 [mailto:varunr@NOIDA.HCLTECH.COM] >Sent: Thursday, December 02, 2004= 11:03=20 AM >To: J2EEPATTERNS-INTEREST@JAVA.SUN.COM >Subject: Singleton in= =20 clustered environment > >Hi all, > > > >I have to imp= lement=20 singleton in clustered environment. > >Can somebody, help with so= me=20 online resource/link or pattern for doing the >same. > > >=20= >Regards, > >Varun Rally > > >=20 >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=20 >Companion Site: http://www.corej2eepatterns.com J2EE BluePrints:=20= >http://java.sun.com/blueprints/corej2eepatterns List Archive:=20 >http://archives.java.sun.com/archives/j2eepatterns-interest.html=20= >Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to=20 >listserv@java.sun.com > > > >=E4=E4=FA=EB=FA=E1=E5=FA =F2= =ED =EC=E0=E5=EE=E9 =E1=E0=EE=F6=F2=E5=FA =E3=E5=E0=F8=20 =E0=EC=F7=E8=F8=E5=F0=E9 =E4=F0=E4 =EC=F6=F8=EB=E9=ED =EB=EC=EC=E9=E9=ED= =E1=EC=E1=E3 =E5=E0=E9=EF =EC=E4=F1=FA=EE=EA >=F2=EC=E9=E4 =EC=F9=ED = =E1=E9=F6=E5=F2 =F4=F2=E5=EC=E5=FA =E5/=E0=E5=20 =F2=F1=F7=E0=E5=FA =EB=EC=F9=E4=EF =E5/=E0=E5 =EB=FA=E7=EC=E9=F3 =EC=E9= =E9=F2=E5=F5 =E5/=E0=E5 =E1=EB=EC =E0=E5=F4=EF =E0=E7=F8 >=E5=E4=E9=E0= =EB=F4=E5=F4=E4 =EC=FA=F0=E0=E9 =E4=F9=E9=EE=E5=F9=20 =F9=F0=EE=F1=F8=E5 =EC=EC=F7=E5=E7 > >Correspondence with Leumi b= y electronic mail is for=20 general purposes only >and may not be relied upon for the purpose of= =20 effecting any activities >and/or transactions whatsoever and/or as a= =20 substitute for advice and/or in >any other manner and is subject to = the=20 conditions of use which have been >provided to the Customer > >= ; >=20 > > >This e-mail and any files transmitted with it are for the= sole=20 use of the >intended recipient(s) and may contain confidential and=20= privileged >information. >If you are not the intended recipient, = please=20 contact the sender by reply >e-mail and destroy all copies of the or= iginal=20 message. >Any unauthorised review, use, disclosure, dissemination,=20= forwarding, >printing or copying of this email or any action taken i= n=20 reliance on this >e-mail is strictly >prohibited and may be unlaw= ful.=20 > >Visit us at http://www.cognizant.com >=20 >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=20 >Companion Site: http://www.corej2eepatterns.com J2EE BluePrints:=20= >http://java.sun.com/blueprints/corej2eepatterns List Archive:=20 >http://archives.java.sun.com/archives/j2eepatterns-interest.html=20= >Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to=20 >listserv@java.sun.com=20 >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=20 >Companion Site: http://www.corej2eepatterns.com J2EE BluePrints:=20= >http://java.sun.com/blueprints/corej2eepatterns List Archive:=20 >http://archives.java.sun.com/archives/j2eepatterns-interest.html=20= >Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to=20 >listserv@java.sun.com >=20 >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=20 >Companion Site: http://www.corej2eepatterns.com >J2EE BluePrints= :=20 http://java.sun.com/blueprints/corej2eepatterns >List Archive:=20 http://archives.java.sun.com/archives/j2eepatterns-interest.html=20 >Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to=20 listserv@java.sun.com=20
(416)804-8359