public ServiceConfig()

in omega/omega-context/src/main/java/org/apache/servicecomb/pack/omega/context/ServiceConfig.java [33:49]


  public ServiceConfig(String serviceName, String instanceId) {
    this.serviceName = serviceName;
    if(instanceId == null || "".equalsIgnoreCase(instanceId.trim())){
      try {
        this.instanceId = serviceName + "-" + InetAddress.getLocalHost().getHostAddress();
      } catch (UnknownHostException e) {
        throw new IllegalStateException(e);
      }
    }else{
      instanceId = instanceId.trim();
      this.instanceId = instanceId;
    }

    if (this.instanceId.length() > MAX_LENGTH) {
      throw new IllegalArgumentException(String.format("The instanceId length exceeds maximum length limit [%d].", MAX_LENGTH));
    }
  }