JBoss Community

Programatically identifying master/slave nodes in JBoss AS 7.1

created by jbosss in Clustering Development - View the full discussion

Is there an API available, which can tell me if the current node (on which this piece of code is running) is a master or a slave? Probably, in most cases, you dont care, but say if you dont implement a ha singleton service, but want to execute some code only on the master (or only one salve) node(s). How do the various UIs for JBoss monitoring get this information from JBoss AS?

 

Similarly how to identify whether the node is running in a standalone mode or a domain cluster mode.

 

I looked at JBoss AS clustering code and I couldnt find and API that can give this information. I looked at the GroupCommunicationService class and the MBeanServer class and they dont have this information. Is there any way I could query and get this information from JBOSS?

 

Thanks!

Reply to this message by going to Community

Start a new discussion in Clustering Development at Community