public RuleConfigSource obtainRuleConfigSource(RuleConfigSource ruleConfigSource) {
    /* create according to SPI */
    if (ruleConfigSource == null) {
      ruleConfigSource = ExtensionLoader.getExtension(RuleConfigSource.class, false);
    }

    /* create according to configuration */
    if (ruleConfigSource == null) {
      String sourceType = RateLimiterConfig.instance().getRuleConfigSourceType();
      // TODO(zheng): ugly code, refactor it!
      if (sourceType.equals("zookeeper")) {
        ruleConfigSource = new ZookeeperRuleConfigSource();
      } else if (sourceType.equals("file")) {
        ruleConfigSource = new FileRuleConfigSource();
      }
    }

    /* use default rule config source. */
    if (ruleConfigSource == null) {
      ruleConfigSource = new FileRuleConfigSource();
    }

    return ruleConfigSource;
  }
Obtain {@link RuleConfigSource}

@param ruleConfigSource the rule config source which can be null.
@return the input parameter {@code ruleConfigSource} if not null, otherwise return a new
        {@link RuleConfigSource}.
src/main/java/com/eudemon/ratelimiter/context/RateLimiterBeansFactory.java