1 22 package org.jboss.console.plugins; 23 24 import org.jboss.console.manager.interfaces.ManageableResource; 25 import org.jboss.console.manager.interfaces.ResourceTreeNode; 26 import org.jboss.console.manager.interfaces.TreeNode; 27 import org.jboss.console.plugins.helpers.AbstractPluginWrapper; 28 29 import javax.management.ObjectInstance ; 30 31 47 public class UCLLister 48 extends AbstractPluginWrapper 49 { 50 51 public UCLLister () { super(); } 52 53 ResourceTreeNode createUCLSubResource (ObjectInstance instance) throws Exception 54 { 55 String uclName = instance.getObjectName().getKeyProperty ("UCL"); 56 57 return createResourceNode ( 58 "UCL " + uclName, "UCL with id " + uclName, "images/service.gif", "/jmx-console/HtmlAdaptor?action=inspectMBean&name=" + encode(instance.getObjectName().toString()), null, 63 null, 64 null, 65 instance.getObjectName().toString(), 66 instance.getClassName () ); 67 } 68 69 ResourceTreeNode[] createUCLSubResources () throws Exception 70 { 71 ObjectInstance [] insts = 72 getMBeansForClass("jmx.loading:*", 73 "org.jboss.mx.loading.UnifiedClassLoader3"); 74 75 ResourceTreeNode[] result = new ResourceTreeNode[insts.length]; 76 for (int i=0; i<result.length; i++) 77 { 78 result[i] = createUCLSubResource (insts[i]); 79 } 80 81 return result; 82 } 83 84 protected TreeNode getTreeForResource(String profile, ManageableResource resource) 85 { 86 try 87 { 88 return createTreeNode ( 89 "Unified ClassLoaders", "Display all JBoss UCLs", "images/recycle.gif", null, null, 94 null, createUCLSubResources () ); 97 } 98 catch (Exception e) 99 { 100 e.printStackTrace (); 101 return null; 102 } 103 } 104 105 106 } 107 | Popular Tags |