Example usage for javax.management MalformedObjectNameException getCause

List of usage examples for javax.management MalformedObjectNameException getCause

Introduction

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

Prototype

public synchronized Throwable getCause() 

Source Link

Document

Returns the cause of this throwable or null if the cause is nonexistent or unknown.

Usage

From source file:org.lsc.webai.services.LscRemoteCommands.java

private boolean jmxBind() {
    if (lscServer != null) {
        try {//from w w  w  .j  ava 2 s. c  o  m
            return lscServer.ping();
        } catch (UndeclaredThrowableException ce) {

        }
    }
    try {
        String sUrl = "service:jmx:rmi:///jndi/rmi://" + hostname + ":" + port + "/jmxrmi";
        LOGGER.info("Connecting to remote engine on : " + sUrl);
        url = new JMXServiceURL(sUrl);
        jmxC = new RMIConnector(url, null);
        jmxC.connect();
        jmxc = jmxC.getMBeanServerConnection();
        ObjectName lscServerName = new ObjectName("org.lsc.jmx:type=LscServer");
        lscServer = JMX.newMXBeanProxy(jmxc, lscServerName, LscServer.class, true);
        return true;
    } catch (MalformedObjectNameException e) {
        LOGGER.error(e.toString(), e);
    } catch (NullPointerException e) {
        LOGGER.error(e.toString(), e);
    } catch (MalformedURLException e) {
        LOGGER.error(e.toString(), e);
    } catch (IOException e) {
        if (!(e.getCause() instanceof ServiceUnavailableException)) {
            LOGGER.error(e.toString(), e);
        }
    }
    return false;
}