* @throws MonitoringRegistrationException
*/
public void unregisterStats(StatsHolder rootNode, boolean includeThreadInfo) throws
MonitoringRegistrationException {
StatsHolder jvmNode = rootNode.getChild(MonitoredObjectType.JVM.getTypeName());
assert(jvmNode != null):"jvm node is null";
Collection c = new ArrayList();
c.addAll(jvmNode.getAllChildren());
Iterator iter = c.iterator();
while(iter.hasNext()) {
StatsHolder childNode = (StatsHolder)iter.next();
if(childNode.getType() == MonitoredObjectType.JVM_GCS) {
Collection c1 = new ArrayList();
c1.addAll(childNode.getAllChildren());
Iterator it = c1.iterator();
while(it.hasNext()) {
StatsHolder s = (StatsHolder)it.next();
s.unregisterMBean();
childNode.removeChild(s.getName());
}
}
if((childNode.getType() == MonitoredObjectType.JVM_THREAD) && includeThreadInfo) {
Collection c1 = new ArrayList();
c1.addAll(childNode.getAllChildren());
Iterator it = c1.iterator();
while(it.hasNext()) {
StatsHolder s = (StatsHolder)it.next();
s.unregisterMBean();
childNode.removeChild(s.getName());
}
}
childNode.unregisterMBean();
jvmNode.removeChild(childNode.getName());