return Collectd.getHostname();
} /* }}} String getHost */
private void connect () /* {{{ */
{
JMXServiceURL service_url;
JMXConnector connector;
Map environment;
if (_jmx_connection != null)
return;
environment = null;
if (this._password != null)
{
String[] credentials;
if (this._username == null)
this._username = new String ("monitorRole");
credentials = new String[] { this._username, this._password };
environment = new HashMap ();
environment.put (JMXConnector.CREDENTIALS, credentials);
environment.put(JMXConnectorFactory.PROTOCOL_PROVIDER_CLASS_LOADER, this.getClass().getClassLoader());
}
try
{
service_url = new JMXServiceURL (this._service_url);
connector = JMXConnectorFactory.connect (service_url, environment);
_jmx_connection = connector.getMBeanServerConnection ();
}
catch (Exception e)
{