How to guarantee one singleton instance in a cluster
Posted on 2005-04-15
I want only one instance of a class running on one server in a cluster. I then want to be able to call this object from other servers in the cluster and execute its methods.
To do this I would need to make this a remote rmi object and then syncronise access to this object from the client tier.
My initial thought is to implement the rmi as ejbs and have the ejb acess a singleton class, The singleton class would have a reference to a hashtable which is required to store data, a hashtable which by default is thread-safe. This is important as whilst one thread updates the hashtable I dont want other threads to block.
Please provide guidance how to do this as this is giving me alot of grief.