@Override
  public void validate() {
    super.validate();

    if (httpPort < 0 || httpPort > MAX_HTTP_PORT) {
      throw new IllegalArgumentException(
          String.format("%s must be zero or an integer between %s and %s.",
              HTTP_PORT_NAME, MIN_HTTP_PORT, MAX_HTTP_PORT));
    }

    if (rmiPort < 0 || rmiPort > MAX_RMI_PORT) {
      throw new IllegalArgumentException(
          String.format("%s must be zero or an integer between %s and %s.",
              RMI_PORT_NAME, MIN_RMI_PORT, MAX_RMI_PORT));
    }

    if (rmiServerPort < 0 || rmiServerPort > MAX_RMI_PORT) {
      throw new IllegalArgumentException(
          String.format("%s must be zero or an integer between %s and %s.",
              RMI_SERVER_PORT_NAME, MIN_RMI_PORT, MAX_RMI_PORT));
    }

  }
Makes sure that the mcast port and locators are correct and consistent.

@throws IllegalArgumentException If configuration is not valid
geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentConfigImpl.java