JBAS-2957: using JGroups for AutoDiscovery
jerrygauth Mar 28, 2006 4:17 PMJBAS-2957 prescribes the use of JGroups as the underlying communication mechanism for HA-JNDI AutoDiscovery.
For design background, the current implementation works as follows. The NamingContext attempts to discover an HA-JNDI server via multicast request using multicast client code located in the NamingContext class. The configurable elements include the partitionName, the multicast address and port, the binding port, timeout, and binding address. The NamingContext class has hard-coded defaults that can be overridden via the client's jndi.properties file. On the server side, the multicast responder is located in DetachedHANamingService. The configuration properties are similar and are located in the cluster.xml configuration file.
The purpose of the redesign is to replace the multicast code with JGroups code and to allow users to override the JGroups configuration as needed. One design assumption is that we don't want to introduce direct dependencies on JGroups into the NamingContext module. Note that it will be necessary to add jgroups.jar and jbossha.jar to client runtime classpaths for clients that seek to use AutoDiscovery in a cluster environment (assuming an alternative implementation isn't used).
The new design is basically as follows except for configuration modifications once JGroups multiplexing is available for use.
On the client side, the NamingContext will dynamically load a class implementing the org.jboss.naming.NamingDiscovery interface. The default implementation will be org.jboss.ha.jndi.HADiscovery. A new jndi.properties attribute will be available to allow for different (e.g., non-JGroups) implementations. No alternative implementation will be provided. Any jndi.properties attributes associated with AutoDiscovery (e.g., jnp.discoveryXXX) will be passed to the NamingDiscovery constructor in a Hashtable.
On the server side, DetachedHANamingService will start a thread running the JGroups-based server. The JGroups configuration will be configurable via cluster.xml.
One design issue is how to ensure that the HADiscovery client uses the same JGroups channel configuration that's used by the server. This will probably be accomplished by having it access DetachedHANamingServiceMBean via the MBean server. A client will also be able to override the JGroups stack on the client side via an entry in the jndi.properties file.