Search in sources :

Example 1 with JMXTransportProtocol

use of org.ow2.proactive.jmx.naming.JMXTransportProtocol in project scheduling by ow2-proactive.

the class JMXClientHelper method connect.

/**
 * Establishes the connection to the connector server by calling {@link #connect(JMXTransportProtocol)}
 * using the JMXTransportProtocol specified by the {@link #PA_JMX_CLIENT_PROTOCOL} property
 * that can be {@link JMXTransportProtocol#RMI} or {@link JMXTransportProtocol#RO}.
 * If the property is not defined the {@link JMXTransportProtocol#RMI} protocol is used.
 *
 * @return <code>true</code> if this helper is connected otherwise return <code>false</code>
 */
public boolean connect() {
    JMXTransportProtocol protocol = JMXTransportProtocol.RMI;
    final String property = System.getProperty(JMXClientHelper.PA_JMX_CLIENT_PROTOCOL);
    if (property != null && JMXTransportProtocol.valueOf(property.toUpperCase()) == JMXTransportProtocol.RO) {
        protocol = JMXTransportProtocol.RO;
    }
    return this.connect(protocol);
}
Also used : JMXTransportProtocol(org.ow2.proactive.jmx.naming.JMXTransportProtocol)

Aggregations

JMXTransportProtocol (org.ow2.proactive.jmx.naming.JMXTransportProtocol)1