private void unregisterFromJmx(ChannelInfo info) ObjectName oname = info.getChannelObjectName(); MBeanServer mbs = getServer(); if(info != null && mbs != null) List<ObjectName> onames = info.getProtocolObjectNames(); if (onames != null)
private void registerChannel(JChannel ch, String channelId, String stackName, ProtocolData[] config) throws Exception { // Register for channel closed notification so we can unregister ch.addChannelListener(closeListener); ObjectName chName = null; List<ObjectName> protNames = null; List<ObjectName> allNames = registerInJmx(ch, channelId); if (allNames != null && allNames.size() > 0) { chName = allNames.get(0); if (allNames.size() > 1) { protNames = allNames.subList(1, allNames.size()); } } ChannelInfo info = new ChannelInfo(channelId, stackName, ch, config, chName, protNames); registeredChannels.put(ch, info); }
String id = chInfo.getId(); if (id != null) data.put("clusterName", SimpleValueSupport.wrap(chInfo.getClusterName())); String stackName = chInfo.getStackName(); if (stackName != null) ObjectName on = chInfo.getChannelObjectName(); if (on != null) data.put("protocolStackConfiguration", CONFIG_MAPPER.createMetaValue(getMetaType(), chInfo.getProtocolStackConfiguration())); List<ObjectName> protNames = chInfo.getProtocolObjectNames(); if (protNames != null) data.put("localAddress", SimpleValueSupport.wrap(chInfo.getLocalAddress().toString())); MetaValue viewValue = createViewMetaValue(chInfo.getCurrentView()); data.put("currentView", viewValue);