return retval;
return registerChannel(channel, server, domain + ":type=channel,cluster=" +cluster_name);
    public static org.jgroups.jmx.JChannel registerChannel(org.jgroups.JChannel channel,                                                           MBeanServer server, String domain, String cluster_name,                                                           boolean register_protocols) throws Exception {        JChannel retval=new JChannel(channel);        if(cluster_name == null)            cluster_name=channel != null? channel.getClusterName() : null;        if(cluster_name == null)            cluster_name="null";        server.registerMBean(retval, new ObjectName(domain + ":type=channel,cluster=" +cluster_name));        if(register_protocols) {            String tmp=domain + ":type=protocol,cluster=" +cluster_name;            registerProtocols(server, channel, tmp);        }        return retval;    }