private static void replaceDiscoveryProtocol(JChannel ch) throws Exception {
ProtocolStack stack=ch.getProtocolStack();
Protocol discovery=stack.removeProtocol("TCPPING");
if(discovery != null){
Protocol transport = stack.getTransport();
MPING mping=new MPING();
InetAddress bindAddress=Util.getBindAddress(new Properties());
mping.setBindAddr(bindAddress);
mping.setMulticastAddress("230.1.2.3");
mping.setMcastPort(8888);
stack.insertProtocol(mping, ProtocolStack.ABOVE, transport.getName());
mping.setProtocolStack(ch.getProtocolStack());
mping.init();
mping.start();
System.out.println("Replaced TCPPING with MPING. See http://wiki.jboss.org/wiki/Wiki.jsp?page=JGroupsMERGE2");
}
}