if(isExposeChannels() && getServer() != null && channelId != null && channelId.length() > 0)
{
allNames = new ArrayList<ObjectName>();
ObjectName channelName = new ObjectName(getDomain() + ":type=channel,cluster=" + channelId);
JmxConfigurator conf = new JmxConfigurator();
getServer().registerMBean(conf.asDynamicMBean(ch), channelName);
allNames.add(channelName);
if (isExposeProtocols())
{
String baseName = getDomain() + ":type=protocol,cluster=" + channelId;
ProtocolStack stack=ch.getProtocolStack();
List<Protocol> protocols=stack.getProtocols();
for(Protocol prot : protocols)
{
ObjectName prot_name=new ObjectName(baseName + ",protocol=" + prot.getName());
server.registerMBean(conf.asDynamicMBean(prot), prot_name);
allNames.add(prot_name);
}
}
}