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

JMSLister

public class JMSLister extends org.jboss.console.plugins.helpers.AbstractPluginWrapper

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


    
   
      super();
   
Methods Summary
private org.jboss.console.manager.interfaces.ResourceTreeNodecreateDestinationItem(javax.management.ObjectName objName)

param
objName
return

      String destinationName = objName.getKeyProperty("name");
      String type = objName.getKeyProperty("service");
      String className = this.mbeanServer.getMBeanInfo(objName).getClassName();
      String fileName = "";
      if (type.equalsIgnoreCase("Queue"))
      {
         fileName = "Queue.jsp";
      }
      else if (type.equalsIgnoreCase("Topic"))
      {
         fileName = "Topic.jsp";
      }

      ResourceTreeNode item = this.createResourceNode(destinationName, type, //Description Tooltip
            "images/serviceset.gif", fileName + "?ObjectName=" + encode(objName.toString()), null, //menus 
            null, //sub-nodes
            null, //sub-resources
            objName.toString(), className);
      return item;
   
private org.jboss.console.manager.interfaces.ResourceTreeNode[]createDestinationItems(java.lang.String type)

return
throws
Exception

      ObjectInstance[] insts = getMBeansForQuery("jboss.mq.destination:service=" + type + ",*", null);
      ResourceTreeNode[] destinations = new ResourceTreeNode[insts.length];
      //JMSDestinationManager jmsServer = (JMSDestinationManager)this.mbeanServer.getAttribute(new ObjectName("jboss.mq:service=DestinationManager"), "Interceptor");
      for (int i = 0; i < insts.length; i++)
      {
         ObjectName objName = insts[i].getObjectName();
         destinations[i] = createDestinationItem(objName);
      }
      return destinations;
   
private org.jboss.console.manager.interfaces.TreeNode[]createDestinations()

      TreeNode[] destinations = new TreeNode[2];

      destinations[0] = createTreeNode("Queues", "", "images/spirale.gif", null, null, null,
            createDestinationItems("Queue"));
      destinations[1] = createTreeNode("Topics", "", "images/spirale.gif", null, null, null,
            createDestinationItems("Topic"));

      return destinations;
   
protected org.jboss.console.manager.interfaces.TreeNodegetTreeForResource(java.lang.String profile, org.jboss.console.manager.interfaces.ManageableResource resource)

      try
      {
         ObjectName objName = ((MBeanResource) resource).getObjectName();
         SimpleTreeNode node = createTreeNode(objName.getKeyProperty("name"), // name
               "", // description
               "images/spirale.gif", // Icon URL
               null, // Default URL									
               null, createDestinations(), // sub nodes 
               null // Sub-Resources                 
         );
         node.setMasterNode(true);
         return node;

      }
      catch (Exception e)
      {
         e.printStackTrace();
         System.out.println(checker);
         return null;

      }