1 22 package org.jboss.console.plugins; 23 24 import javax.management.ObjectName ; 25 26 import org.jboss.console.manager.interfaces.ManageableResource; 27 import org.jboss.console.manager.interfaces.ResourceTreeNode; 28 import org.jboss.console.manager.interfaces.TreeNode; 29 import org.jboss.console.manager.interfaces.impl.MBeanResource; 30 import org.jboss.console.plugins.helpers.AbstractPluginWrapper; 31 import org.jboss.management.j2ee.J2EEApplicationMBean; 32 import org.jboss.mx.util.MBeanProxyExt; 33 49 public class J2EEAppLister 50 extends AbstractPluginWrapper 51 { 52 private static final long serialVersionUID = 4168885656223716764L; 53 54 protected final static String JMX_JSR77_DOMAIN = "jboss.management.local"; 55 56 public J2EEAppLister () { super(); } 57 58 ResourceTreeNode[] createModules (String [] modules) throws Exception 59 { 60 ResourceTreeNode[] deployed = new ResourceTreeNode[modules.length]; 61 for (int i = 0; i < modules.length; i++) 62 { 63 66 67 ObjectName objectName = new ObjectName (modules[i]); 68 deployed[i] = createResourceNode ( 69 objectName.getKeyProperty ("name"), "", "images/EspressoMaker.gif", null, null, 74 null, null, modules[i].toString (), 77 this.mbeanServer.getMBeanInfo (objectName).getClassName () 78 ).setVisibility (ResourceTreeNode.INVISIBLE_IF_SUBNODE_EXISTS); 79 80 } 81 82 return deployed; 83 } 84 85 protected TreeNode getTreeForResource(String profile, ManageableResource resource) 86 { 87 try 88 { 89 ObjectName objName = ((MBeanResource)resource).getObjectName(); 90 J2EEApplicationMBean appProxy = (J2EEApplicationMBean) 91 MBeanProxyExt.create (J2EEApplicationMBean.class, objName, getMBeanServer()); 92 93 return createTreeNode 94 ( 95 objName.getKeyProperty("name"), "", "images/EspressoMaker.gif", "J2EEApp.jsp?ObjectName=" + encode (objName.toString ()), null, 100 null, createModules (appProxy.getmodules()) ).setMasterNode(true); 103 104 } 105 catch (Exception e) 106 { 107 e.printStackTrace (); 108 System.out.println (checker); 109 return null; 110 111 } 112 } 113 114 } 115 | Popular Tags |