javax.management.ObjectName#getKeyProperty ( )源码实例Demo

下面列出了javax.management.ObjectName#getKeyProperty ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: gemfirexd-oss   文件: GfxdMBeanAggregator.java
public void handleProxyRemoval(ObjectName objectName, Class interfaceClass, Object proxyObject,
    FederationComponent oldVal) {

  AggregateStatementMBean aggregateStmtBean = getAggregateStatementMBean(objectName,false);
  if(aggregateStmtBean == null){
    return;
  }

  String memberName = objectName.getKeyProperty("member");
  aggregateStmtBean.getBridge().aggregate(memberName, null, oldVal);
  if (aggregateStmtBean.getBridge().getMemberCount() == 0) {
    String name = objectName.getKeyProperty("name");
    ObjectName aggregateStatementName = ManagementUtils.getAggregateStatementMBeanName(name);
    service.unregisterMBean(aggregateStatementName);
  }
}
 
源代码2 项目: gemfirexd-oss   文件: DistributedSystemBridge.java
public ObjectName[] fetchRegionObjectNames(ObjectName memberMBeanName)
    throws Exception {
  List<ObjectName> list = new ArrayList<ObjectName>();
  if (mapOfMembers.get(memberMBeanName) != null) {
    MemberMXBean bean = mapOfMembers.get(memberMBeanName);
    String member = memberMBeanName
        .getKeyProperty(ManagementConstants.OBJECTNAME_MEMBER_APPENDER);
    String[] regions = bean.listRegions();
    for (String region : regions) {
      ObjectName regionMBeanName = MBeanJMXAdapter.getRegionMBeanName(
          member, region);
      list.add(regionMBeanName);
    }
    ObjectName[] objNames = new ObjectName[list.size()];
    return list.toArray(objNames);
  } else {
    throw new Exception(ManagementStrings.MEMBER_MBEAN_NOT_FOUND_IN_DS
        .toString());
  }
}
 
private Iterable<Tag> nameTag(ObjectName name) {
    Tags tags = Tags.empty();
    String clientId = name.getKeyProperty("client-id");
    if (clientId != null) {
        tags = Tags.concat(tags, "client.id", clientId);
    }

    String topic = name.getKeyProperty("topic");
    if (topic != null) {
        tags = Tags.concat(tags, "topic", topic);
    }

    String nodeId = name.getKeyProperty("node-id");
    if (nodeId != null) {
        tags = Tags.concat(tags, "node-id", nodeId);
    }
    return tags;
}
 
源代码4 项目: odo   文件: BackupService.java
/**
 * Get a list of strings(scheme + host + port) that the specified connector is running on
 *
 * @param name
 * @return
 */
private ArrayList<String> getConnectorStrings(String name) {
    ArrayList<String> connectorStrings = new ArrayList<String>();

    try {
        MBeanServer mbeanServer = getServerForName(name);
        Set<ObjectName> objs = mbeanServer.queryNames(new ObjectName("*:type=Connector,*"), null);
        String hostname = InetAddress.getLocalHost().getHostName();
        InetAddress[] addresses = InetAddress.getAllByName(hostname);

        for (Iterator<ObjectName> i = objs.iterator(); i.hasNext(); ) {
            ObjectName obj = i.next();
            String scheme = mbeanServer.getAttribute(obj, "scheme").toString();
            String port = obj.getKeyProperty("port");
            connectorStrings.add(scheme + "://localhost:" + port);
            logger.info("Adding: {}", scheme + "://localhost:" + port);
        }
    } catch (Exception e) {
    }

    return connectorStrings;
}
 
源代码5 项目: gemfirexd-oss   文件: SystemMemberCacheJmxImpl.java
/**
 * Cleans up managed resources created for the region that was (created and)
 * destroyed in a cache represented by this Managed Resource.
 * 
 * @param regionPath
 *          path of the region that got destroyed
 * @return a managed resource related to this region path
 */
public ManagedResource cleanupRegionResources(String regionPath) {
  ManagedResource cleaned = null;
  
  synchronized (this.managedRegionResourcesMap) {
    Set<Entry<String, SystemMemberRegionJmxImpl>> entries = managedRegionResourcesMap.entrySet();
    for (Iterator<Entry<String, SystemMemberRegionJmxImpl>> it = entries.iterator(); it.hasNext();) {
      Entry<String, SystemMemberRegionJmxImpl> entry = it.next();
      SystemMemberRegionJmxImpl managedResource = entry.getValue();
      ObjectName                objName         = managedResource.getObjectName();
      
      String pathProp = objName.getKeyProperty("path");
      if (pathProp != null && pathProp.equals(regionPath)) {
        cleaned = managedResource;
        it.remove();
        
        break;
      }
    }
  }

  return cleaned;
}
 
源代码6 项目: zooadmin   文件: BaseTool.java
public static String getServer() {
    MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
    ArrayList<String> endPoints = new ArrayList<String>();
    try {
        Set<ObjectName> objs = mbs.queryNames(new ObjectName("*:type=Connector,*"), Query.match(Query.attr("protocol"), Query.value("HTTP/1.1")));
        String hostname = InetAddress.getLocalHost().getHostName();
        InetAddress[] addresses = InetAddress.getAllByName(hostname);
        for (Iterator<ObjectName> i = objs.iterator(); i.hasNext(); ) {
            ObjectName obj = i.next();
            String scheme = mbs.getAttribute(obj, "scheme").toString();
            String port = obj.getKeyProperty("port");
            for (InetAddress addr : addresses) {
                String host = addr.getHostAddress();
                String ep = scheme + "://" + host + ":" + port;
                endPoints.add(ep);
            }
        }
    } catch (Exception e) {
        return "";
    }
    if (endPoints.size() > 0) {
        return endPoints.get(0);
    } else {
        return "";
    }
}
 
源代码7 项目: tomcatsrc   文件: MBeanFactory.java
/**
 * Remove an existing Connector.
 *
 * @param name MBean Name of the component to remove
 *
 * @exception Exception if a component cannot be removed
 */
public void removeConnector(String name) throws Exception {

    // Acquire a reference to the component to be removed
    ObjectName oname = new ObjectName(name);
    Service service = getService(oname);
    String port = oname.getKeyProperty("port");
    //String address = oname.getKeyProperty("address");

    Connector conns[] = service.findConnectors();

    for (int i = 0; i < conns.length; i++) {
        String connAddress = String.valueOf(conns[i].getProperty("address"));
        String connPort = ""+conns[i].getPort();

        // if (((address.equals("null")) &&
        if ((connAddress==null) && port.equals(connPort)) {
            service.removeConnector(conns[i]);
            conns[i].destroy();
            break;
        }
        // } else if (address.equals(connAddress))
        if (port.equals(connPort)) {
            // Remove this component from its parent component
            service.removeConnector(conns[i]);
            conns[i].destroy();
            break;
        }
    }

}
 
源代码8 项目: activemq-artemis   文件: QueueMbeanRestartTest.java
private void verifyPresenceOfQueueMbean() throws Exception {
   for (ObjectName name : broker.getManagementContext().queryNames(null, null)) {
      LOG.info("candidate :" + name);
      String type = name.getKeyProperty("destinationType");
      if (type != null && type.equals("Queue")) {
         assertEquals(JMXSupport.encodeObjectNamePart(((ActiveMQQueue) createDestination()).getPhysicalName()), name.getKeyProperty("destinationName"));
         LOG.info("found mbbean " + name);
         return;
      }
   }
   fail("expected to find matching queue mbean for: " + createDestination());
}
 
public void addTableToSystem(ObjectName objectName, TableMXBean memberProxy,
    FederationComponent newVal) {
  String fullPath = objectName.getKeyProperty("table");
  ObjectName aggregateTableObjectName = ManagementUtils.getAggrgateTableMBeanName(fullPath);

  try {
    
    lock.lock();
    
    if (!this.tableList.contains(fullPath)) {
      AggregateTableMBeanBridge bridge = new AggregateTableMBeanBridge(
          memberProxy.getName(), memberProxy.getParentSchema(),
          memberProxy.getDefinition());
      
        AggregateTableMXBean mbean = new AggregateTableMBean(bridge);
        aggregateTableMBeanBridgeMap.put(aggregateTableObjectName, bridge);
        service.registerInternalMBean(mbean, aggregateTableObjectName);
        tableList.add(fullPath);
        bridge.update(newVal, null, objectName);
    }

    if (mbeanCounterMap.containsKey(aggregateTableObjectName)) {
      Long count = mbeanCounterMap.get(aggregateTableObjectName);
      count++;
      mbeanCounterMap.put(aggregateTableObjectName, count);
    } else {
      mbeanCounterMap.put(aggregateTableObjectName, (long) 1);
    }
    
  } catch(Exception e){
    logger.warning(LocalizedStrings.DEBUG, "Exception in aggregate table mbean. Exception " + e);
  }finally {
    lock.unlock();
  }
}
 
源代码10 项目: tomcatsrc   文件: DataSource.java
/**
 * Creates the ObjectName for the ConnectionPoolMBean object to be registered
 * @param original the ObjectName for the DataSource
 * @return the ObjectName for the ConnectionPoolMBean
 * @throws MalformedObjectNameException
 */
public ObjectName createObjectName(ObjectName original) throws MalformedObjectNameException {
    String domain = ConnectionPool.POOL_JMX_DOMAIN;
    Hashtable<String,String> properties = original.getKeyPropertyList();
    String origDomain = original.getDomain();
    properties.put("type", "ConnectionPool");
    properties.put("class", this.getClass().getName());
    if (original.getKeyProperty("path")!=null || properties.get("context")!=null) {
        //this ensures that if the registration came from tomcat, we're not losing
        //the unique domain, but putting that into as an engine attribute
        properties.put("engine", origDomain);
    }
    ObjectName name = new ObjectName(domain,properties);
    return name;
}
 
源代码11 项目: stratio-cassandra   文件: NodeProbe.java
private List<Entry<String, ColumnFamilyStoreMBean>> getCFSMBeans(MBeanServerConnection mbeanServerConn, String type)
        throws MalformedObjectNameException, IOException
{
    ObjectName query = new ObjectName("org.apache.cassandra.db:type=" + type +",*");
    Set<ObjectName> cfObjects = mbeanServerConn.queryNames(query, null);
    List<Entry<String, ColumnFamilyStoreMBean>> mbeans = new ArrayList<Entry<String, ColumnFamilyStoreMBean>>(cfObjects.size());
    for(ObjectName n : cfObjects)
    {
        String keyspaceName = n.getKeyProperty("keyspace");
        ColumnFamilyStoreMBean cfsProxy = JMX.newMBeanProxy(mbeanServerConn, n, ColumnFamilyStoreMBean.class);
        mbeans.add(new AbstractMap.SimpleImmutableEntry<String, ColumnFamilyStoreMBean>(keyspaceName, cfsProxy));
    }
    return mbeans;
}
 
源代码12 项目: summerframework   文件: KafkaConsumerMetrics.java
private Iterable<Tag> nameTag(ObjectName name) {
    Tags tags = Tags.empty();

    String clientId = name.getKeyProperty("client-id");
    if (clientId != null) {
        tags = Tags.concat(tags, "client.id", clientId);
    }

    String topic = name.getKeyProperty("topic");
    if (topic != null) {
        tags = Tags.concat(tags, "topic", topic);
    }

    return tags;
}
 
源代码13 项目: gemfirexd-oss   文件: GfxdMBeanAggregator.java
@Override
public void handleProxyUpdate(ObjectName objectName, Class interfaceClass, Object proxyObject,
    FederationComponent newVal, FederationComponent oldVal) {
  AggregateStatementMBean aggregateStmtBean = getAggregateStatementMBean(objectName, false);
  if(aggregateStmtBean == null){
    return;
  }

  String memberName = objectName.getKeyProperty("member");
  aggregateStmtBean.getBridge().aggregate(memberName, newVal, oldVal);
}
 
源代码14 项目: jdk8u60   文件: MBeanListener.java
public void handleNotification(
        final Notification notifIn,
        final Object handback)
{
    if (notifIn instanceof MBeanServerNotification)
    {
        final MBeanServerNotification notif = (MBeanServerNotification) notifIn;
        final ObjectName objectName = notif.getMBeanName();

        boolean match = false;
        if ( mObjectName != null && mObjectName.equals(objectName) )
        {
            match = true;
        }
        else if ( objectName.getDomain().equals( mJMXDomain ) )
        {
            if ( mType != null && mType.equals(objectName.getKeyProperty(TYPE_KEY)) )
            {
                final String mbeanName = objectName.getKeyProperty(NAME_KEY);
                if (mName != null && mName.equals(mbeanName))
                {
                    match = true;
                }
            }
        }

        if ( match )
        {
            final String notifType = notif.getType();
            if (MBeanServerNotification.REGISTRATION_NOTIFICATION.equals(notifType))
            {
                mCallback.mbeanRegistered(objectName, this);
            }
            else if (MBeanServerNotification.UNREGISTRATION_NOTIFICATION.equals(notifType))
            {
                mCallback.mbeanUnregistered(objectName, this);
            }
        }
    }
}
 
源代码15 项目: stratio-cassandra   文件: NodeProbe.java
public Map.Entry<String, JMXEnabledThreadPoolExecutorMBean> next()
{
    ObjectName objectName = resIter.next();
    String poolName = objectName.getKeyProperty("type");
    JMXEnabledThreadPoolExecutorMBean threadPoolProxy = JMX.newMBeanProxy(mbeanServerConn, objectName, JMXEnabledThreadPoolExecutorMBean.class);
    return new AbstractMap.SimpleImmutableEntry<String, JMXEnabledThreadPoolExecutorMBean>(poolName, threadPoolProxy);
}
 
源代码16 项目: Tomcat8-Source-Read   文件: StatusTransformer.java
/**
 * Write detailed information about a wrapper.
 * @param writer The output writer
 * @param objectName The wrapper MBean names
 * @param mBeanServer MBean server
 * @param mode Mode <code>0</code> will generate HTML.
 *   Mode <code>1</code> will generate XML.
 * @throws Exception Propagated JMX error
 */
public static void writeWrapper(PrintWriter writer, ObjectName objectName,
                                MBeanServer mBeanServer, int mode)
    throws Exception {

    if (mode == 0) {
        String servletName = objectName.getKeyProperty("name");

        String[] mappings = (String[])
            mBeanServer.invoke(objectName, "findMappings", null, null);

        writer.print("<h2>");
        writer.print(Escape.htmlElementContext(servletName));
        if ((mappings != null) && (mappings.length > 0)) {
            writer.print(" [ ");
            for (int i = 0; i < mappings.length; i++) {
                writer.print(Escape.htmlElementContext(mappings[i]));
                if (i < mappings.length - 1) {
                    writer.print(" , ");
                }
            }
            writer.print(" ] ");
        }
        writer.print("</h2>");

        writer.print("<p>");
        writer.print(" Processing time: ");
        writer.print(formatTime(mBeanServer.getAttribute
                                (objectName, "processingTime"), true));
        writer.print(" Max time: ");
        writer.print(formatTime(mBeanServer.getAttribute
                                (objectName, "maxTime"), false));
        writer.print(" Request count: ");
        writer.print(mBeanServer.getAttribute(objectName, "requestCount"));
        writer.print(" Error count: ");
        writer.print(mBeanServer.getAttribute(objectName, "errorCount"));
        writer.print(" Load time: ");
        writer.print(formatTime(mBeanServer.getAttribute
                                (objectName, "loadTime"), false));
        writer.print(" Classloading time: ");
        writer.print(formatTime(mBeanServer.getAttribute
                                (objectName, "classLoadTime"), false));
        writer.print("</p>");
    } else if (mode == 1){
        // for now we don't write out the wrapper details
    }

}
 
源代码17 项目: Tomcat8-Source-Read   文件: MBeanFactory.java
/**
 * Create a new StandardContext.
 *
 * @param parent MBean Name of the associated parent component
 * @param path The context path for this Context
 * @param docBase Document base directory (or WAR) for this Context
 * @param xmlValidation if XML descriptors should be validated
 * @param xmlNamespaceAware if the XML processor should namespace aware
 * @return the object name of the created context
 *
 * @exception Exception if an MBean cannot be created or registered
 */
public String createStandardContext(String parent,
                                    String path,
                                    String docBase,
                                    boolean xmlValidation,
                                    boolean xmlNamespaceAware)
    throws Exception {

    // Create a new StandardContext instance
    StandardContext context = new StandardContext();
    path = getPathStr(path);
    context.setPath(path);
    context.setDocBase(docBase);
    context.setXmlValidation(xmlValidation);
    context.setXmlNamespaceAware(xmlNamespaceAware);

    ContextConfig contextConfig = new ContextConfig();
    context.addLifecycleListener(contextConfig);

    // Add the new instance to its parent component
    ObjectName pname = new ObjectName(parent);
    ObjectName deployer = new ObjectName(pname.getDomain()+
                                         ":type=Deployer,host="+
                                         pname.getKeyProperty("host"));
    if(mserver.isRegistered(deployer)) {
        String contextName = context.getName();
        mserver.invoke(deployer, "addServiced",
                       new Object [] {contextName},
                       new String [] {"java.lang.String"});
        String configPath = (String)mserver.getAttribute(deployer,
                                                         "configBaseName");
        String baseName = context.getBaseName();
        File configFile = new File(new File(configPath), baseName+".xml");
        if (configFile.isFile()) {
            context.setConfigFile(configFile.toURI().toURL());
        }
        mserver.invoke(deployer, "manageApp",
                       new Object[] {context},
                       new String[] {"org.apache.catalina.Context"});
        mserver.invoke(deployer, "removeServiced",
                       new Object [] {contextName},
                       new String [] {"java.lang.String"});
    } else {
        log.warn("Deployer not found for "+pname.getKeyProperty("host"));
        Service service = getService(pname);
        Engine engine = service.getContainer();
        Host host = (Host) engine.findChild(pname.getKeyProperty("host"));
        host.addChild(context);
    }

    // Return the corresponding MBean name
    return context.getObjectName().toString();

}
 
源代码18 项目: gemfirexd-oss   文件: MBeanTest.java
private void verifyListIndexInfo(MBeanServerConnection mbeanServer,
    String tableName, String memberId, String serverGroup,
    boolean verifyMBean, ObjectName tableON, String m)
    throws InstanceNotFoundException, MBeanException, ReflectionException,
    IOException, AttributeNotFoundException {
  Log.getLogWriter().info("Expected Index List : " + getAllIndex(tableName));
  Object result = mbeanServer.invoke(tableON, m, null, null);
  Log.getLogWriter().info(" Result list index Info" + result + "");
  Log.getLogWriter().info("GFXD Table Op "+ m + " : " + HydraUtil.ObjectToString(result));
  Log.getLogWriter().info("GFXD Table Op "+ m + " : " + result.getClass());
  CompositeData[] data = (CompositeData[]) result;
  Log.getLogWriter().info(" composite data length: " + data.length);
  for(int i = 0; i < data.length; i++) {
    Log.getLogWriter().info(" composite data : " + HydraUtil.ObjectToString(data[i]) + "");
  }
  String[] array = tableName.split("\\.");
  Log.getLogWriter().info("#listIndexInfo schemaName " + array[0] + " tableName " + array[1]);
  mbeanHelper.runQueryAndPrintValue("select * from SYS.INDEXES where SCHEMANAME='"+ array[0] +"' and TABLENAME='"+ array[1] + "'");
  Number indexCount = (Number)mbeanHelper.runQueryAndGetValue("select COUNT(*) from SYS.INDEXES where SCHEMANAME='"+ array[0] +"' and TABLENAME='"+ array[1] + "'", OutputType.INT);
  
  String[] tableServerGroups = (String[]) mbeanServer.getAttribute(tableON, "ServerGroups");
  String memberName = tableON.getKeyProperty("member");
  boolean isPartitionProxy = isPrProxyTableMBean(tableName, serverGroup, tableServerGroups, memberName);
  if (!isPartitionProxy) {
    Log.getLogWriter().info(
    "Table is NOT partition proxy table hence matching indexinfo #listIndexInfo #isPartitionProxy");
    match("Index count does not match  for " + tableName, indexCount.intValue(), data.length);
  } else {
    Log.getLogWriter().info(
        "Table is partition proxy table hence skipping matching indexinfo #listIndexInfo #isPartitionProxy");
  }
  
  if(data.length > 0 && verifyMBean){
    result = mbeanServer.invoke(tableON, "listIndexStats", null, null);
    Log.getLogWriter().info(" Result list index Info" + result + "");
    Log.getLogWriter().info("GFXD Table Op listIndexStats : " + HydraUtil.ObjectToString(result));
    Log.getLogWriter().info("GFXD Table Op listIndexStats : " + result.getClass());
    CompositeData[] stats = (CompositeData[]) result;
    Log.getLogWriter().info(" index length: " + stats.length);
    for(int i = 0; i < stats.length; i++) {
      Log.getLogWriter().info(" index stats : " + HydraUtil.ObjectToString(stats[i]) + "");              
      Number entrySize = (Number)stats[i].get("entrySize");
      String indexName = (String) stats[i].get("indexName");              
      Number keySize = (Number) stats[i].get("keySize");
      Number rowCount = (Number) stats[i].get("rowCount");
      
      Number actualEntrySize = (Number)mbeanHelper.runQueryAndGetValue("select  ENTRY_SIZE from sys.memoryanalytics WHERE  TABLE_name = '"
          + tableName + "'  and ID like '%" + memberId + "%' AND INDEX_NAME='" + indexName + "'", OutputType.FLOAT);
      match("Validation failed for matching Index " + indexName + " on table " + tableName + " attribute ENTRY_SIZE" , entrySize, actualEntrySize);
      
      Number actualKeySize = (Number)mbeanHelper.runQueryAndGetValue("select  KEY_SIZE from sys.memoryanalytics WHERE  TABLE_name = '"
          + tableName + "'  and ID like '%" + memberId + "%' AND INDEX_NAME='" + indexName + "'", OutputType.FLOAT);
      match("Validation failed for matching Index " + indexName + " on table " + tableName + " attribute KEY_SIZE" , keySize, actualKeySize);
      
      Number actualRowCount = (Number)mbeanHelper.runQueryAndGetValue("select  NUM_ROWS from sys.memoryanalytics WHERE TABLE_name = '"
          + tableName + "'  and ID like '%" + memberId + "%' AND INDEX_NAME='" + indexName + "'", OutputType.LONG);
      match("Validation failed for matching Index " + indexName + " on table " + tableName + "  attribute ROW_COUNT" , rowCount, actualRowCount);
      
      Log.getLogWriter().info("#listIndexStats IndexName <" + indexName +"> ES <" + entrySize +"> COUNT <" + rowCount
          + " KS <" + keySize+">");
      
      Log.getLogWriter().info("#listIndexStatsFromMemAnalytics IndexName <" + indexName +"> ES <" + actualEntrySize +"> COUNT <" + actualRowCount
          + " KS <" + actualKeySize+">");
    }
  }
}
 
源代码19 项目: javamelody   文件: MBeans.java
private List<MBeanNode> getMBeanNodes() throws JMException {
	final List<MBeanNode> result = new ArrayList<MBeanNode>();
	final Set<ObjectName> names = mbeanServer.queryNames(null, null);
	for (final ObjectName name : names) {
		final String domain = name.getDomain();
		if ("jboss.deployment".equals(domain)) {
			// la partie "jboss.deployment" dans JBoss (5.0.x) est plutôt inutile et trop lourde
			continue;
		}
		MBeanNode domainNode = getMBeanNodeFromList(result, domain);
		if (domainNode == null) {
			domainNode = new MBeanNode(domain);
			result.add(domainNode);
		}
		final String keyPropertyListString = name.getKeyPropertyListString();
		final String firstPropertyValue;
		final int indexOf = keyPropertyListString.indexOf('=');
		if (indexOf == -1) {
			// n'arrive probablement pas, mais au cas où
			firstPropertyValue = null;
		} else {
			firstPropertyValue = name
					.getKeyProperty(keyPropertyListString.substring(0, indexOf));
		}
		MBeanNode firstPropertyNode = getMBeanNodeFromList(domainNode.getChildren(),
				firstPropertyValue);
		if (firstPropertyNode == null) {
			firstPropertyNode = new MBeanNode(firstPropertyValue);
			domainNode.getChildren().add(firstPropertyNode);
		}
		try {
			final MBeanNode mbean = getMBeanNode(name);
			firstPropertyNode.getChildren().add(mbean);
		} catch (final IllegalStateException e) {
			// for JBoss EAP 6 (#757)
			continue;
		}
	}
	sortMBeanNodes(result);
	return result;
}
 
源代码20 项目: tomcatsrc   文件: StatusTransformer.java
/**
 * Write detailed information about a wrapper.
 */
public static void writeWrapper(PrintWriter writer, ObjectName objectName,
                                MBeanServer mBeanServer, int mode)
    throws Exception {

    if (mode == 0) {
        String servletName = objectName.getKeyProperty("name");
        
        String[] mappings = (String[]) 
            mBeanServer.invoke(objectName, "findMappings", null, null);
        
        writer.print("<h2>");
        writer.print(filter(servletName));
        if ((mappings != null) && (mappings.length > 0)) {
            writer.print(" [ ");
            for (int i = 0; i < mappings.length; i++) {
                writer.print(filter(mappings[i]));
                if (i < mappings.length - 1) {
                    writer.print(" , ");
                }
            }
            writer.print(" ] ");
        }
        writer.print("</h2>");
        
        writer.print("<p>");
        writer.print(" Processing time: ");
        writer.print(formatTime(mBeanServer.getAttribute
                                (objectName, "processingTime"), true));
        writer.print(" Max time: ");
        writer.print(formatTime(mBeanServer.getAttribute
                                (objectName, "maxTime"), false));
        writer.print(" Request count: ");
        writer.print(mBeanServer.getAttribute(objectName, "requestCount"));
        writer.print(" Error count: ");
        writer.print(mBeanServer.getAttribute(objectName, "errorCount"));
        writer.print(" Load time: ");
        writer.print(formatTime(mBeanServer.getAttribute
                                (objectName, "loadTime"), false));
        writer.print(" Classloading time: ");
        writer.print(formatTime(mBeanServer.getAttribute
                                (objectName, "classLoadTime"), false));
        writer.print("</p>");
    } else if (mode == 1){
        // for now we don't write out the wrapper details
    }

}