0 Replies Latest reply on Jul 24, 2008 12:30 AM by azagniotov

    HASingleton - Determine which node in the cluster is the mas

    azagniotov

      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