public JMXConnector getConnector() throws IOException {
    JMXServiceURL url;
    try {
      url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" + hostInfo.getAddress() + "/jmxrmi");
    }
    catch (MalformedURLException e) {
      throw new RuntimeException("Incorrect service URL", e);
    }

    Map<String, Object> properties = new HashMap<>();
    if (hostInfo.getUser() != null) {
      properties.put(JMXConnector.CREDENTIALS, new String[]{hostInfo.getUser(), hostInfo.getPassword()});
    }

    return JMXConnectorFactory.connect(url, properties);
  }
public JMXConnector getConnector()