org.apache.servicemix.web.jmx
Class JMXWriter

java.lang.Object
  extended by org.apache.servicemix.web.jmx.JMXWriter

public class JMXWriter
extends Object

A useful class for turning JMX statistics into XML and XHTML

Version:
$Revision: 356269 $

Constructor Summary
JMXWriter(PrintWriter writer, ManagementContext context)
           
 
Method Summary
protected  Object getAttributeValue(ObjectName name, String attributeName)
           
 ManagementContext getManagementContext()
           
 MBeanServer getMBeanServer()
           
protected  String getShortName(ObjectName name)
          Returns a short descriptive name of the ObjectName without the domain
 void outputDetail(ObjectName name)
           
 void outputDetail(Set names)
           
 void outputFooter()
           
 void outputHeader()
           
 void outputHtmlAttributeGrid(Set names)
           
 void outputHtmlAttributes(ObjectName name)
           
 void outputHtmlAttributes(Set names)
           
 void outputHtmlName(ObjectName name, String shortName)
           
 void outputHtmlNames(Collection names)
           
 void outputHtmlNames(ObjectName name)
           
 void outputHtmlNamesByDomain(Collection names)
           
 void outputHtmlNamesByProperty(Collection names, String property)
           
 void outputHtmlNamesSortedByShortName(Collection names)
           
 void outputHtmlProperties(ObjectName name)
           
 void outputHtmlProperties(Set names)
           
 void outputHtmlPropertiesGrid(Set names)
           
 void outputMBeans(Collection names)
           
 void outputMBeans(ObjectName name)
           
 void outputNames(Collection names)
           
 void outputNames(ObjectName name)
           
protected  void printDetailURL(ObjectName name)
          Outputs a URL to the detail JMX stats view
protected  void printDetailURL(String propertyName, String propertyValue)
          Outputs a URL to the detail JMX stats view
 void printEncodedObjectName(ObjectName name)
          Prints a HTTP encoded ObjectName suitable for use inside URLs
 void printEncodedValue(Object value)
          Encodes the value as a String and ensures that there are no bad XML characters like < or > which are encoded.
 void setManagementContext(ManagementContext managementContext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JMXWriter

public JMXWriter(PrintWriter writer,
                 ManagementContext context)
Method Detail

getMBeanServer

public MBeanServer getMBeanServer()

getManagementContext

public ManagementContext getManagementContext()

setManagementContext

public void setManagementContext(ManagementContext managementContext)

outputHtmlNamesByDomain

public void outputHtmlNamesByDomain(Collection names)
                             throws IOException
Throws:
IOException

outputHtmlNamesByProperty

public void outputHtmlNamesByProperty(Collection names,
                                      String property)
                               throws IOException
Throws:
IOException

outputHtmlNamesSortedByShortName

public void outputHtmlNamesSortedByShortName(Collection names)
                                      throws IOException
Throws:
IOException

outputHtmlNames

public void outputHtmlNames(Collection names)
                     throws IOException
Throws:
IOException

outputHtmlNames

public void outputHtmlNames(ObjectName name)
                     throws IOException
Throws:
IOException

outputHtmlName

public void outputHtmlName(ObjectName name,
                           String shortName)
                    throws IOException
Throws:
IOException

getShortName

protected String getShortName(ObjectName name)
Returns a short descriptive name of the ObjectName without the domain


outputNames

public void outputNames(Collection names)
                 throws IOException
Throws:
IOException

outputNames

public void outputNames(ObjectName name)
                 throws IOException
Throws:
IOException

outputDetail

public void outputDetail(Set names)
                  throws IOException,
                         JMException
Throws:
IOException
JMException

outputDetail

public void outputDetail(ObjectName name)
                  throws JMException,
                         IOException
Throws:
JMException
IOException

outputHtmlProperties

public void outputHtmlProperties(Set names)
                          throws JMException,
                                 IOException
Throws:
JMException
IOException

outputHtmlPropertiesGrid

public void outputHtmlPropertiesGrid(Set names)
                              throws JMException
Throws:
JMException

outputHtmlProperties

public void outputHtmlProperties(ObjectName name)
                          throws JMException,
                                 IOException
Throws:
JMException
IOException

outputHtmlAttributes

public void outputHtmlAttributes(Set names)
                          throws IOException,
                                 JMException
Throws:
IOException
JMException

outputHtmlAttributeGrid

public void outputHtmlAttributeGrid(Set names)
                             throws JMException
Throws:
JMException

outputHtmlAttributes

public void outputHtmlAttributes(ObjectName name)
                          throws JMException,
                                 IOException
Throws:
JMException
IOException

outputMBeans

public void outputMBeans(Collection names)
                  throws IOException
Throws:
IOException

outputMBeans

public void outputMBeans(ObjectName name)
                  throws IOException
Throws:
IOException

outputHeader

public void outputHeader()
                  throws IOException
Throws:
IOException

outputFooter

public void outputFooter()
                  throws IOException
Throws:
IOException

printEncodedValue

public void printEncodedValue(Object value)
Encodes the value as a String and ensures that there are no bad XML characters like < or > which are encoded.


printEncodedObjectName

public void printEncodedObjectName(ObjectName name)
Prints a HTTP encoded ObjectName suitable for use inside URLs


printDetailURL

protected void printDetailURL(ObjectName name)
Outputs a URL to the detail JMX stats view


printDetailURL

protected void printDetailURL(String propertyName,
                              String propertyValue)
Outputs a URL to the detail JMX stats view


getAttributeValue

protected Object getAttributeValue(ObjectName name,
                                   String attributeName)
                            throws MBeanException
Throws:
MBeanException


Copyright © 2005-2010 The Apache Software Foundation. All Rights Reserved.