wt.jmx.core.mbeans
Interface DumperMBean

All Superinterfaces:
SelfEmailingMBean
All Known Implementing Classes:
Dumper

public interface DumperMBean
extends SelfEmailingMBean

Provides a number of generic operations to dump bulk information to a JMX console or e-mail.

Supported API: true

Extendable: true


Method Summary
 String[] dumpAllMBeans()
          Get data (as XML) on all MBeans in this MBeanServer

Supported API: true
 String[] dumpFullStackTrace()
          Get full stack trace of all threads; same as FullStackTrace attribute but easier to use as an operation in some consoles

Supported API: true
 String[] dumpMBeans(ObjectName objectNamePattern)
          Get data (as XML) on all MBeans in this MBeanServer that match the ObjectName query pattern

Supported API: true
 void emailAllMBeans(String addressesOrEmailList, String subject, boolean compress)
          E-mail styled data on all MBeans in this MBeanServer using the default styling as specified by DefaultXsltStylesheet

Supported API: true
 void emailAllMBeans(String addressesOrEmailList, String subject, boolean compress, String xslt, boolean applyXslt)
          E-mail styled data on all MBeans in this MBeanServer, styling as specified by the 'xslt' parameter

Supported API: true
 void emailFile(String fileRef, String addressesOrEmailList, String subject, boolean compress)
          E-mail entire file as an attachment optionally compressing it.
 void emailFullStackTrace(String addressesOrEmailList, String subject)
          E-mail full stack trace of all threads

Supported API: true
 void emailMBeans(ObjectName objectNamePattern, String addressesOrEmailList, String subject, boolean compress)
          E-mail styled data on all MBeans in this MBeanServer that match the ObjectName query pattern using the default styling as specified by DefaultXsltStylesheet

Supported API: true
 void emailMBeans(ObjectName objectNamePattern, String addressesOrEmailList, String subject, boolean compress, String xslt, boolean applyXslt)
          E-mail styled data on all MBeans in this MBeanServer that match the ObjectName query pattern, styling as specified by the 'xslt' parameter

Supported API: true
 void emailTextFile(String fileRef, String addressesOrEmailList, String subject, long maxLines, long maxChars)
          E-mail last portion of text file.
 Map<ObjectName,AttributeList>[] getAttributes(ObjectName[] objectNamePatterns, QueryExp[] queryExps, String[][] attributeNamesArrs)
          Fetches attribute values from multiple JMX MBeans in one request.
 String getDefaultXsltStylesheet()
          Reference (URL, file, or resource) to default XSLT stylesheet

Supported API: true
 String getDefaultXsltStylesheetURL()
          Default XSLT stylesheet URL used by operations which return styled MBean data when this parameter is not specified

Supported API: true
 String[] getFullStackTrace()
          Full stack trace of all threads; provided as attribute in addition to dumpFullStackTrace() operation to expose to Summary and NotificationHandler MBean

Supported API: true
 String[] getResources(String resourceName)
          Returns a list of URLs (as strings) representing all the resources with the given name found by this MBean's classloader.
 Object invokeInfoOperation(ObjectName mbean, String operation, Object[] params, String[] signature)
          Invoke an operation with an INFO (read-only) impact on an MBean.
 void logFullStackTrace()
          Log full stack trace of all threads to wt.jmx.core.mbeans.Dumper.stacktraces logger at INFO level (and this logger defaults to INFO level verbosity)

Supported API: true
 void setDefaultXsltStylesheet(String defaultXsltStylesheet)
          Reference (URL, file, or resource) to default XSLT stylesheet

Supported API: true
 String[] viewTextFile(String fileRef, long maxLines, long maxChars)
          View last portion of text file.
 
Methods inherited from interface wt.jmx.core.mbeans.SelfEmailingMBean
emailThisMBean
 

Method Detail

getFullStackTrace

String[] getFullStackTrace()
Full stack trace of all threads; provided as attribute in addition to dumpFullStackTrace() operation to expose to Summary and NotificationHandler MBean

Supported API: true


getDefaultXsltStylesheetURL

String getDefaultXsltStylesheetURL()
Default XSLT stylesheet URL used by operations which return styled MBean data when this parameter is not specified

Supported API: true


getDefaultXsltStylesheet

String getDefaultXsltStylesheet()
Reference (URL, file, or resource) to default XSLT stylesheet

Supported API: true


setDefaultXsltStylesheet

void setDefaultXsltStylesheet(String defaultXsltStylesheet)
Reference (URL, file, or resource) to default XSLT stylesheet

Supported API: true


viewTextFile

String[] viewTextFile(String fileRef,
                      long maxLines,
                      long maxChars)
                      throws IOException
View last portion of text file.

Note that this operation is considered to have an ACTION_INFO (i.e. "read and write") impact even though it does not change any server state. This is due to the fact that it can be used to view any text file readable by the given process, including files which may contain sensitive information such as passwords. This operation is thus restricted to those users with the broadest possible access and privileges.

Supported API: true

Parameters:
fileRef - Reference (URL, file, or resource) to file to view
maxLines - Maximum number of lines to include; non-positive numbers imply no limit
maxChars - Maximum number of characters to include; non-positive numbers imply no limit
Throws:
IOException

emailFile

void emailFile(String fileRef,
               String addressesOrEmailList,
               String subject,
               boolean compress)
               throws IOException
E-mail entire file as an attachment optionally compressing it.

Note that this operation is considered to have an ACTION_INFO (i.e. "read and write") impact even though it does not change any server state. This is due to the fact that it can be used to e-mail any text file readable by the given process, including files which may contain sensitive information such as passwords. This operation is thus restricted to those users with the broadest possible access and privileges.

Supported API: true

Parameters:
fileRef - Reference (URL, file, or resource) to file to e-mail
addressesOrEmailList - Comma-delimited list of e-mail addresses or name of e-mail list to send e-mail to
subject - Subject to give e-mail
compress - Whether to compress the file attachement
Throws:
IOException

emailTextFile

void emailTextFile(String fileRef,
                   String addressesOrEmailList,
                   String subject,
                   long maxLines,
                   long maxChars)
                   throws IOException
E-mail last portion of text file.

Note that this operation is considered to have an ACTION_INFO (i.e. "read and write") impact even though it does not change any server state. This is due to the fact that it can be used to e-mail any text file readable by the given process, including files which may contain sensitive information such as passwords. This operation is thus restricted to those users with the broadest possible access and privileges.

Supported API: true

Parameters:
fileRef - Reference (URL, file, or resource) to file to e-mail
addressesOrEmailList - Comma-delimited list of e-mail addresses or name of e-mail list to send e-mail to
subject - Subject to give e-mail
maxLines - Maximum number of lines to include; non-positive numbers imply no limit
maxChars - Maximum number of characters to include; non-positive numbers imply no limit
Throws:
IOException

dumpFullStackTrace

String[] dumpFullStackTrace()
Get full stack trace of all threads; same as FullStackTrace attribute but easier to use as an operation in some consoles

Supported API: true


logFullStackTrace

void logFullStackTrace()
Log full stack trace of all threads to wt.jmx.core.mbeans.Dumper.stacktraces logger at INFO level (and this logger defaults to INFO level verbosity)

Supported API: true


emailFullStackTrace

void emailFullStackTrace(String addressesOrEmailList,
                         String subject)
                         throws IOException
E-mail full stack trace of all threads

Supported API: true

Parameters:
addressesOrEmailList - Comma-delimited list of e-mail addresses or name of e-mail list to send e-mail to
subject - Subject to give e-mail
Throws:
IOException

dumpAllMBeans

String[] dumpAllMBeans()
                       throws SAXException
Get data (as XML) on all MBeans in this MBeanServer

Supported API: true

Throws:
SAXException

emailAllMBeans

void emailAllMBeans(String addressesOrEmailList,
                    String subject,
                    boolean compress)
                    throws IOException,
                           SAXException
E-mail styled data on all MBeans in this MBeanServer using the default styling as specified by DefaultXsltStylesheet

Supported API: true

Parameters:
addressesOrEmailList - Comma-delimited list of e-mail addresses or name of e-mail list to send e-mail to
subject - Subject to give e-mail
compress - Whether e-mail contents should be compressed
Throws:
IOException
SAXException

emailAllMBeans

void emailAllMBeans(String addressesOrEmailList,
                    String subject,
                    boolean compress,
                    String xslt,
                    boolean applyXslt)
                    throws IOException,
                           SAXException
E-mail styled data on all MBeans in this MBeanServer, styling as specified by the 'xslt' parameter

Supported API: true

Parameters:
addressesOrEmailList - Comma-delimited list of e-mail addresses or name of e-mail list to send e-mail to
subject - Subject to give e-mail
compress - Whether e-mail contents should be compressed
xslt - Reference (URL, file, or resource) to XSLT stylesheet to apply; defaults to DefaultXsltStylesheetURL if not specified
applyXslt - Whether to apply XSLT or just insert a processing instruction for it
Throws:
IOException
SAXException

dumpMBeans

String[] dumpMBeans(ObjectName objectNamePattern)
                    throws SAXException
Get data (as XML) on all MBeans in this MBeanServer that match the ObjectName query pattern

Supported API: true

Parameters:
objectNamePattern - ObjectName query pattern; see JMX specification for more information
Throws:
SAXException

emailMBeans

void emailMBeans(ObjectName objectNamePattern,
                 String addressesOrEmailList,
                 String subject,
                 boolean compress)
                 throws IOException,
                        SAXException
E-mail styled data on all MBeans in this MBeanServer that match the ObjectName query pattern using the default styling as specified by DefaultXsltStylesheet

Supported API: true

Parameters:
objectNamePattern - ObjectName query pattern; see JMX specification for more information
addressesOrEmailList - Comma-delimited list of e-mail addresses or name of e-mail list to send e-mail to
subject - Subject to give e-mail
compress - Whether e-mail contents should be compressed
Throws:
IOException
SAXException

emailMBeans

void emailMBeans(ObjectName objectNamePattern,
                 String addressesOrEmailList,
                 String subject,
                 boolean compress,
                 String xslt,
                 boolean applyXslt)
                 throws IOException,
                        SAXException
E-mail styled data on all MBeans in this MBeanServer that match the ObjectName query pattern, styling as specified by the 'xslt' parameter

Supported API: true

Parameters:
objectNamePattern - ObjectName query pattern; see JMX specification for more information
addressesOrEmailList - Comma-delimited list of e-mail addresses or name of e-mail list to send e-mail to
subject - Subject to give e-mail
compress - Whether e-mail contents should be compressed
xslt - Reference (URL, file, or resource) to XSLT stylesheet to apply; defaults to DefaultXsltStylesheetURL if not specified
applyXslt - Whether to apply XSLT or just insert a processing instruction for it
Throws:
IOException
SAXException

getResources

String[] getResources(String resourceName)
                      throws IOException
Returns a list of URLs (as strings) representing all the resources with the given name found by this MBean's classloader.

Supported API: true

Parameters:
resourceName - Name of resource to search for
Throws:
IOException

getAttributes

Map<ObjectName,AttributeList>[] getAttributes(ObjectName[] objectNamePatterns,
                                              QueryExp[] queryExps,
                                              String[][] attributeNamesArrs)
Fetches attribute values from multiple JMX MBeans in one request. All arguments and the return result are treated as "parallel" arrays with corresponding elements from each being processed together. Each element of the returned array is a map from the ObjectNames which match the corresponding 'objectNamePatterns' and 'queryExps' elements to their values attributes requested by the corresponding 'attributeNamesArrs' element.

Supported API: true

Parameters:
objectNamePatterns - Array of ObjectNames, each of which can be an ObjectName pattern
queryExps - Array of query expressions; when non-null each non-null element is used as an additional filter on the lookup for the corresponding 'objectNamePatterns' element
attributeNamesArrs - Array of attribute name arrays; when non-null, each non-null element specifies the list of attributes to fetch for the corresponding 'objectNamePatterns' element and null elements are intepretted as requests for all attributes; when null, a null value will be returned in the map for each matching ObjectName key

invokeInfoOperation

Object invokeInfoOperation(ObjectName mbean,
                           String operation,
                           Object[] params,
                           String[] signature)
                           throws InstanceNotFoundException,
                                  IntrospectionException,
                                  MBeanException,
                                  ReflectionException,
                                  IOException
Invoke an operation with an INFO (read-only) impact on an MBean. This operation will raise a SecurityException exception if the target operation has a non-INFO impact. This operation exists to provide remote JMX clients with a known INFO impact operation that can locally (and thus more efficiently) enforce that an arbitrary target operation has an INFO impact.

Supported API: true

Parameters:
mbean - ObjectName of target MBean
operation - Name of target operation
params - Arguments of target operation
signature - Signature of target operation
Throws:
InstanceNotFoundException
IntrospectionException
MBeanException
ReflectionException
IOException