public void onInitialize()

in uimaj-as-core/src/main/java/org/apache/uima/aae/controller/AggregateAnalysisEngineController_impl.java [3328:3408]


  public void onInitialize() {
    // For each collocated delegate
    synchronized(childControllerList) {
      if ( childControllerList.size() > 0 ) {
        for( AnalysisEngineController childController : childControllerList ) {
          // notify the delegate
          childController.onInitialize();
        }
      }
    }

    //document the CAS logging specification
    if (isTopLevelComponent() && UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.INFO)) {
      Logger logger = UIMAFramework.getLogger(CLASS_NAME);

      String baseDir = System.getProperty("user.dir");
      if (null != System.getProperty("UIMA_CASLOG_BASE_DIRECTORY")) {
        baseDir = System.getProperty("UIMA_CASLOG_BASE_DIRECTORY");
      }
      logger.log(Level.INFO, "UIMA_CASLOG: Base CAS log directory = "+baseDir);
      if (null != System.getProperty("UIMA_CASLOG_TYPE_NAME") || 
              null != System.getProperty("UIMA_CASLOG_FEATURE_NAME")) {
        if (null == System.getProperty("UIMA_CASLOG_TYPE_NAME") || 
              null == System.getProperty("UIMA_CASLOG_FEATURE_NAME")) {
          logger.log(Level.INFO, "UIMA_CASLOG: Invalid UIMA_CASLOG specification. Both type and feature names must be specified");
        }
        else {
          String typeName = System.getProperty("UIMA_CASLOG_TYPE_NAME");
          String featureName = System.getProperty("UIMA_CASLOG_FEATURE_NAME");
          logger.log(Level.INFO, "UIMA_CASLOG: CAS file names defined by "+typeName+" and "+featureName);
        }
      }
      if (null != System.getProperty("UIMA_CASLOG_VIEW_NAME")) {
        logger.log(Level.INFO, "UIMA_CASLOG:    where FS is found in view "+System.getProperty("UIMA_CASLOG_VIEW_NAME"));
      }

      String casLogComponents = System.getProperty("UIMA_CASLOG_COMPONENT_ARRAY");
      if (null != casLogComponents) {
        logger.log(Level.INFO, "UIMA_CASLOG: The following delegates have CAS logging enabled: "+ casLogComponents);
      }
    }


    // enable CAS logging for delegates in this aggregate
    String casLogComponents = System.getProperty("UIMA_CASLOG_COMPONENT_ARRAY");
    // check requested Cas logging
    if (casLogComponents!= null) {
      String[] comps = casLogComponents.split(" ");
      for (String comp : comps) {
        String[] subcomps = comp.split("/");
        if (1 == subcomps.length) {
          ((AggregateAnalysisEngineController)this).setCasLoggingDirectory(comp, comp);
          // iterate over the controller list to find one with a matching key
          for( AnalysisEngineController c : childControllerList ) {
            if ( c.getServiceInfo() != null ) {
              if ( comp.equals(c.getServiceInfo().getServiceKey())) {
                // Enable CAS logging
                c.getServiceInfo().setLogCasEnabled();
                break;
              }
            }
          }
        }
        else {
          if (this.delegateKey.equals(subcomps[subcomps.length-2])) {
            for( AnalysisEngineController c : childControllerList ) {
              if ( c.getServiceInfo() != null ) {
                if ( subcomps[subcomps.length-1].equals(c.getServiceInfo().getServiceKey())) {
                  // Enable CAS logging
                  setCasLoggingDirectory(subcomps[subcomps.length-1], comp);
                  c.getServiceInfo().setLogCasEnabled();
                  break;
                }
              }
            }
          }
        }
      }
    }

  }