1 Reply Latest reply on May 29, 2008 3:22 PM by Mike Osganian

    Looking up all Node Names within a partition

    Mike Osganian Newbie

      Is it possible to lookup all the node names within a clustered partition? I see where I can lookup the MBean named jboss:service=HAJNDI to find out the name of the partition I am running in and then lookup the MBean jboss:service=[partition name] to find out the name of my node. Does anybody know how I can find out all the other names of the nodes in my partition/cluster?

      Thanks for any help.

        • 1. Re: Looking up all Node Names within a partition
          Mike Osganian Newbie

          FYI:

          javax.naming.Context context = new InitialContext(System.getProperties());
          org.jboss.ha.framework.interfaces.HAPartition haPartition =
           (org.jboss.ha.framework.interfaces.HAPartition) context.lookup("HAPartition/" + partitionName);
          org.jboss.ha.framework.interfaces.ClusterNode[] nodes = haPartition.getClusterNodes();
          for (int index = 0; index < nodes.length; index++) {
           System.out.println(nodes[index].getName());
          }