Example usage for javax.management.remote JMXConnector getMBeanServerConnection

List of usage examples for javax.management.remote JMXConnector getMBeanServerConnection

Introduction

In this page you can find the example usage for javax.management.remote JMXConnector getMBeanServerConnection.

Prototype

public MBeanServerConnection getMBeanServerConnection(Subject delegationSubject) throws IOException;

Source Link

Document

Returns an MBeanServerConnection object representing a remote MBean server on which operations are performed on behalf of the supplied delegation subject.

Usage

From source file:com.hellblazer.process.impl.JavaProcessImpl.java

@Override
public MBeanServerConnection getLocalMBeanServerConnection(String connectionName, Subject delegationSubject)
        throws ConnectException, NoLocalJmxConnectionException {
    JMXConnector connector = getLocalJmxConnector(connectionName);

    try {// w  w w.  j  ava  2  s  .c o m
        return connector.getMBeanServerConnection(delegationSubject);
    } catch (IOException e) {
        ConnectException cex = new ConnectException("Cannot establish local JMX connection to: " + this);
        cex.initCause(e);
        throw cex;
    }
}