JBoss Community

Re: Programatically identifying master/slave nodes in JBoss AS 7.1

created by Paul Ferraro in Clustering Development - View the full discussion

There isn't really a master/slave distinction in AS7, except for usage of SingletonService.  You could, given some channel, indicate which node is the cluster coordinator.  The easiest way to do this is via Infinispan.

e.g.

 

@Resource(lookup = "java:jboss/infinispan/container/some-container-name")

private EmbeddedCacheManager container;

 

public boolean isCoordinator() {

    return this.container.isCoordinator();

}

 

As for determining whether the node is running in standalone or domain mode, I'm not entirely sure.  Try asking on the main AS7 user forum.

Reply to this message by going to Community

Start a new discussion in Clustering Development at Community