[jboss-user] [Clustering/JBoss] - HASingleton - Determine which node in the cluster is the mas

azagniotov do-not-reply at jboss.com
Thu Jul 24 00:30:33 EDT 2008


Hi,

I am running JBoss 4.2.2, and i have a cluster of four nodes.

One of the requirements, that i have to implement is to determine which node in the cluster is the master node. Currently, the way i am doing this now is asking for a current view in HAPartition:


  | private String getMasterSocket() {
  | 
  | 		HAPartition partition = this.getPartition();
  | 
  | 		if (partition != null) {
  | 
  | 			if (partition.getCurrentView() != null) {
  | 				return partition.getCurrentView().get(0).toString();
  | 
  | 			} else {
  | 				return null;
  | 			}
  | 		} else {
  | 			return null;
  | 		}
  | 	}
  | 

The method above returns to me a socket of a master node. I am using this socket to get a proxy to a service on the master node.

My question is:

Is there any other way to determine which node in the cluster is the master node?


Thank you

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4166297#4166297

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4166297



More information about the jboss-user mailing list