@Override
  public void setGemFireHealthConfig(String hostName, GemFireHealthConfig config) {
    checkClosed();

    synchronized (this) {
      String configHost = config.getHostName();
      if (configHost == null || !configHost.equals(hostName)) {
        StringBuilder sb = new StringBuilder();
        sb.append("The GemFireHealthConfig configures ");
        if (configHost == null) {
          sb.append("the default host ");

        } else {
          sb.append("host \"");
          sb.append(config.getHostName());
          sb.append("\" ");
        }
        sb.append("not \"" + hostName + "\"");
        throw new IllegalArgumentException(sb.toString());
      }
      InetAddress hostIpAddress = null;
      try {
        hostIpAddress = InetAddress.getByName(hostName);
      } catch (UnknownHostException e) {
        throw new IllegalArgumentException(
            String.format("Could not find a host with name %s.",
                hostName),
            e);
      }

      List members = (List) hostMembers.get(hostIpAddress);
      if (members == null || members.isEmpty()) {
        throw new IllegalArgumentException(
            String.format("There are no GemFire components on host %s.",
                hostName));
      }

      for (final Object o : members) {
        GemFireVM member = (GemFireVM) o;
        member.addHealthListener(this, config);
      }
    }
  }
Sets the GemFireHealthConfig object for the given host name.

@param hostName host name for which the GemFire Health Config is needed
@param config GemFireHealthConfig object to set

@throws IllegalArgumentException if (1) given host name & the host name in the given config do
        not match OR (2) host with given name could not be found OR (3) there are no GemFire
        components running on the given host
geode-core/src/main/java/org/apache/geode/admin/internal/GemFireHealthImpl.java