FileDocCategorySizeDatePackage
WebModuleLister.javaAPI DocJBoss 4.2.14061Fri Jul 13 21:02:14 BST 2007org.jboss.console.plugins

WebModuleLister

public class WebModuleLister extends org.jboss.console.plugins.helpers.AbstractPluginWrapper
As the number of MBeans is very big, we use a real Java class which is far faster than beanshell
see
author
Sacha Labourey.
version
$Revision: 57191 $

Revisions:

2 janv. 2003 Sacha Labourey:

  • First implementation

Fields Summary
private static final long
serialVersionUID
protected static final String
JMX_JSR77_DOMAIN
Constructors Summary
public WebModuleLister()

   
       super(); 
Methods Summary
org.jboss.console.manager.interfaces.ResourceTreeNode[]createBeans(javax.management.ObjectName parent)

       WebModuleMBean wmProxy = (WebModuleMBean)
               MBeanProxyExt.create(WebModuleMBean.class, parent, getMBeanServer());

       String[] servletsObjectName = wmProxy.getservlets();

      ResourceTreeNode[] servlets = new ResourceTreeNode[servletsObjectName.length];
      for (int i=0; i< servletsObjectName.length; i++)
      {
         ObjectName objectName = new ObjectName(servletsObjectName[i]);
          String name = objectName.getKeyProperty("name");

          servlets[i] = createResourceNode(
                  name,  // name
               "'" + name + "' Servlet", // description
               "images/serviceset.gif", // Icon URL
               "Servlet.jsp?ObjectName=" + encode(objectName.toString()), // Default URL
               null,
               null, // sub nodes
               null,   // Sub-Resources
               objectName.toString(),
               org.jboss.management.j2ee.Servlet.class.getName()
            );                  
         
      }
          
      return servlets;
   
protected org.jboss.console.manager.interfaces.TreeNodegetTreeForResource(java.lang.String profile, org.jboss.console.manager.interfaces.ManageableResource resource)

      try
      {
         ObjectName objName = ((MBeanResource)resource).getObjectName();

         return createTreeNode
            (
               objName.getKeyProperty("name"),  // name
               "", // description
               "images/spirale.gif", // Icon URL
               "WebModule.jsp?ObjectName=" + encode(objName.toString()), // Default URL
               null,
               null, // sub nodes
               createBeans (objName)   // Sub-Resources                  
            ).setMasterNode(true);                  
         
      }
      catch (Exception e)
      {
         e.printStackTrace ();
         System.out.println (checker);
         return null;
         
      }