Look at chapter 6.3 of the JGroups manual at
http://www.jgroups.org/javagroupsnew/docs/manual/html/user-advanced.html#....
You'll need to create 2 MuxChannels, 1 per service that wants to share the channel.
Also, there are unit tests in the JGroups src distro that show you how to use the
Multiplexer, or take a look at ChannelMultiplexer.java for a demo.
You could also look into the JBoss source code (JBoss 5, CVS head):
ClusterPartition.java:
protected void createService()
throws Exception
{
log.debug("Creating Multiplexer Channel for partition " +
getPartitionName() +
" using stack " + getMultiplexerStack());
channel = (JChannel)
getMultiplexer().createMultiplexerChannel(getMultiplexerStack(), getPartitionName());
if(use_debugger && debugger == null)
{
debugger=new Debugger(channel);
debugger.start();
}
channel.setOpt(Channel.AUTO_RECONNECT, new Boolean(true));
channel.setOpt(Channel.AUTO_GETSTATE, new Boolean(true));
log.debug("Creating HAPartition");
partition = createPartition();
// JBAS-2769 Init partition in create
log.debug("Initializing ClusterPartition: " + partition);
partition.init();
log.debug("ClusterPartition initialized");
}
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3985796#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...