public synchronized void processRules()

in agent/src/jetbrains/buildServer/xmlReportPlugin/XmlReportPlugin.java [115:152]


  public synchronized void processRules(@NotNull File rulesFile,
                                        @NotNull Map<String, String> params) {
    final ProcessingContext stepContext = getStepProcessingContext();
    if (stepContext == null) {
      throw new IllegalStateException("Step processing context is null");
    }
    if (stepContext.finished) return;

     // here we check if this path is already monitored for reports of this type
     // we also don't support processing two inspections type during one build
    final String newType = getReportType(params);

    for (RulesContext context : stepContext.rulesContexts) {
      final String existingType = context.getRulesData().getType();

      if (existingType.equals(newType)) {
        final Collection<File> paths = context.getRulesData().getRules().getPaths();
        if (paths.size() == 1) {
          if (paths.contains(rulesFile)) {
            LoggingUtils.LOG.info("Skip monitoring " + rulesFile + " (already monitoring)");
            return;
          }
        }
      }
      if (isInspectionType(existingType) && newType != null && isInspectionType(newType)) {
        LoggingUtils
          .warn(String.format("Two different inspections can not be processed during one build, skip %s reports", getReportTypeName(
            newType)), getBuild().getBuildLogger());
        return;
      }
    }

    final RulesData rulesData = new RulesData(getRules(rulesFile, params), params, stepContext.startTime);

    stepContext.rulesContexts.add(createRulesContext(rulesData));

    startProcessing(stepContext);
  }