Example usage for javax.management MalformedObjectNameException getStackTrace

List of usage examples for javax.management MalformedObjectNameException getStackTrace

Introduction

In this page you can find the example usage for javax.management MalformedObjectNameException getStackTrace.

Prototype

public StackTraceElement[] getStackTrace() 

Source Link

Document

Provides programmatic access to the stack trace information printed by #printStackTrace() .

Usage

From source file:org.apache.hadoop.test.system.AbstractDaemonClient.java

/**
 * Builds correct name of JMX object name from given domain, service name, type
 * @param domain JMX domain name/*from ww w  .  ja va 2  s  . c  om*/
 * @param serviceName of the service where MBean is registered (NameNode)
 * @param typeName of the MXBean class
 * @return ObjectName for requested MXBean of <code>null</code> if one wasn't
 *    found
 * @throws java.io.IOException in if object name is malformed
 */
protected ObjectName getJmxBeanName(String domain, String serviceName, String typeName) throws IOException {
    if (domain == null)
        domain = HADOOP_JMX_DOMAIN;

    ObjectName jmxBean;
    try {
        jmxBean = new ObjectName(domain + ":service=" + serviceName + ",name=" + typeName);
    } catch (MalformedObjectNameException e) {
        LOG.debug(e.getStackTrace());
        throw new IOException(e);
    }
    return jmxBean;
}