[jboss-dev-forums] [Design of Clustering on JBoss (Clusters/JBoss)] - Re: Used of JGroups shared transport in AS 5
bstansberry@jboss.com
do-not-reply at jboss.com
Wed Mar 19 16:24:42 EDT 2008
Next, some implementation details.
In JGroups .2.6.2 the API for getting a shared transport channel vs. a multiplexed one isn't particularly clean.
Channel's in AS 5 will be gotten from the deploy/cluster/jgroups-channelfactory.sar's "JChannelFactory" bean. That implements the org.jgroups.ChannelFactory interface; clients should code to that interface.
The interface exposes the following methods for getting a shared resource channel:
| Channel createMultiplexerChannel(String stack_name, String id) throws Exception;
| Channel createMultiplexerChannel(String stack_name, String id,
| boolean register_for_state_transfer,
| String substate_id) throws Exception;
|
The name of the method and the javadoc somewhat imply these methods will return a MuxChannel+Multiplexer+JChannel. However, they do not explicitly state this. The return type is just "Channel", an abstract parent of both JChannel and MuxChannel. Clients should of course be coding to the Channel API and not assuming any further implementation details.
The std ChannelFactory impl, JChannelFactory exposes a method createChannel(String stack_name) which would be the more correct API to call if you just wanted a plain JChannel (shared transport or not). Unfortunately, in JG 2.6.2 this method was inadvertently left out of the ChannelFactory interface (fixed in 2.6.3). JG 2.6.2 will be used in AS 5, so AS 5 services cannot code to this method. They are stuck coding to one of the "createMultiplexerChannel" methods above.
In any case, JBC and probably JBM are too far along in their release cycle to code to a different method anyway.
So, how to get a shared transport channel rather than a multiplexed one?
The AS's channel factory bean is already an AS-specific impl of the ChannelFactory interface. I intend to alter the impl of the "createMultiplexerChannel" methods so they analyze the configuration of the specified protocol stack. If it supports a shared transport, I will return a shared transport channel. If not, I will return a MuxChannel+Multiplexer+JChannel. This is a bit hacky, given the name of the method, but I think the benefits are worth it.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4137901#4137901
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4137901
More information about the jboss-dev-forums
mailing list