-
1. Re: Behaviour of Singleton Classes while Clustering?
ivelin.ivanov Mar 22, 2004 7:44 AM (in response to poojac20)Singletons have the capability to share state across the cluster. It does not happen automatically, but you can enable it. The most straightworward way is to extend HASingletonSupport. Then implement startSingleton/stopSingleton. For the attributes that are supposed to be shared across the cluster use setDistributedState/getDistributedState instead of local member variables.
Ivelin -
2. Re: Behaviour of Singleton Classes while Clustering?
poojac20 Mar 23, 2004 11:20 AM (in response to poojac20)Thanx for the answer Ivelin.
I did some search on this, & it seems its a relatively new addition.
Read your article available at http://www.onjava.com/pub/a/onjava/2003/08/20/jboss_clustering.html on o'reilly and that clears certain things. But I have more questions.
The example in this article talks about singleton services implemented as MBeans. I have a singleton which is a very simple class .... no frills attached, and certain objects get added/deleted from it, which are contained in the singleton in a hashmap.
From the article I could not gather if it is neccesary to create an MBean for the purpose? but then the article was not talking about the support class u mentioned in ur post. Can u direct me to some article which outlines this basic usage cuz I can't find it (or is it only available in the paid docs :D)? Or let me know if the MBean use is mandatory?
Thanx in advance
--- Pooja. -
3. Re: Behaviour of Singleton Classes while Clustering?
ivelin.ivanov Mar 24, 2004 1:17 AM (in response to poojac20)Tou can use the Distributed State Manager facility directly outside of an MBean. It is described in the JBoss Clustering book.
Ivelin -
4. Re: Behaviour of Singleton Classes while Clustering?
a_amitgarg Jun 17, 2004 3:11 AM (in response to poojac20)Can anybody tell me where can i find the api for the class HASingletonSupport?