private JmxManagerInfo getManagerInfoFromLocator(Repository repository) {

    try {
      String locatorHost = repository.getHost();
      int locatorPort = Integer.parseInt(repository.getPort());

      logger.info("{}={} & {}={}", resourceBundle.getString("LOG_MSG_HOST"), locatorHost,
          resourceBundle.getString("LOG_MSG_PORT"), locatorPort);

      InetAddress inetAddr = InetAddress.getByName(locatorHost);

      if ((inetAddr instanceof Inet4Address) || (inetAddr instanceof Inet6Address)) {

        if (inetAddr instanceof Inet4Address) {
          logger.info("{}: {}", resourceBundle.getString("LOG_MSG_LOCATOR_IPV4_ADDRESS"), inetAddr);
        } else {
          logger.info("{}: {}", resourceBundle.getString("LOG_MSG_LOCATOR_IPV6_ADDRESS"), inetAddr);
        }

        JmxManagerInfo jmxManagerInfo = JmxManagerFinder.askLocatorForJmxManager(inetAddr,
            locatorPort, 15000, repository.isUseSSLLocator());

        if (jmxManagerInfo.port == 0) {
          logger.info(resourceBundle.getString("LOG_MSG_LOCATOR_COULD_NOT_FIND_MANAGER"));
        }
        return jmxManagerInfo;
      } else {
        // Locator has Invalid locator Address
        logger.info(resourceBundle.getString("LOG_MSG_LOCATOR_BAD_ADDRESS"));
        cluster
            .setConnectionErrorMsg(resourceBundle.getString("LOG_MSG_JMX_CONNECTION_BAD_ADDRESS"));
        // update message to display on UI
        cluster
            .setConnectionErrorMsg(resourceBundle.getString("LOG_MSG_JMX_CONNECTION_BAD_ADDRESS"));
        return null;
      }
    } catch (IOException e) {
      StringWriter swBuffer = new StringWriter();
      PrintWriter prtWriter = new PrintWriter(swBuffer);
      e.printStackTrace(prtWriter);
      logger.fatal("Exception Details : {}\n", swBuffer);
    }
    return null;
  }
constructor used for creating JMX connection
geode-pulse/src/main/java/org/apache/geode/tools/pulse/internal/data/JMXDataUpdater.java