public void addImport(String importName) {
   try {
     engineImportService.addImport(importName);
   } catch (EngineImportException e) {
     throw new ConfigurationException(e.getMessage(), e);
   }
 }
 public void addPlugInAggregationMultiFunction(ConfigurationPlugInAggregationMultiFunction config)
     throws ConfigurationException {
   try {
     engineImportService.addAggregationMultiFunction(config);
   } catch (EngineImportException e) {
     throw new ConfigurationException(e.getMessage(), e);
   }
 }
 public void addPlugInAggregationFunction(String functionName, String aggregationClassName) {
   try {
     ConfigurationPlugInAggregationFunction desc =
         new ConfigurationPlugInAggregationFunction(functionName, aggregationClassName, null);
     engineImportService.addAggregation(functionName, desc);
   } catch (EngineImportException e) {
     throw new ConfigurationException(e.getMessage(), e);
   }
 }
 private void internalAddPlugInSingleRowFunction(
     String functionName,
     String className,
     String methodName,
     ConfigurationPlugInSingleRowFunction.ValueCache valueCache,
     ConfigurationPlugInSingleRowFunction.FilterOptimizable filterOptimizable,
     boolean rethrowExceptions)
     throws ConfigurationException {
   try {
     engineImportService.addSingleRow(
         functionName, className, methodName, valueCache, filterOptimizable, rethrowExceptions);
   } catch (EngineImportException e) {
     throw new ConfigurationException(e.getMessage(), e);
   }
 }
  /**
   * Constructs the auto import service.
   *
   * @param configSnapshot config info
   * @return service
   */
  protected static EngineImportService makeEngineImportService(
      ConfigurationInformation configSnapshot) {
    ConfigurationEngineDefaults.Expression expression =
        configSnapshot.getEngineDefaults().getExpression();
    EngineImportServiceImpl engineImportService =
        new EngineImportServiceImpl(
            expression.isExtendedAggregation(),
            expression.isUdfCache(),
            expression.isDuckTyping(),
            configSnapshot.getEngineDefaults().getLanguage().isSortUsingCollator(),
            configSnapshot.getEngineDefaults().getExpression().getMathContext(),
            configSnapshot.getEngineDefaults().getExpression().getTimeZone(),
            configSnapshot.getEngineDefaults().getExecution().getThreadingProfile());
    engineImportService.addMethodRefs(configSnapshot.getMethodInvocationReferences());

    // Add auto-imports
    try {
      for (String importName : configSnapshot.getImports()) {
        engineImportService.addImport(importName);
      }

      for (ConfigurationPlugInAggregationFunction config :
          configSnapshot.getPlugInAggregationFunctions()) {
        engineImportService.addAggregation(config.getName(), config);
      }

      for (ConfigurationPlugInAggregationMultiFunction config :
          configSnapshot.getPlugInAggregationMultiFunctions()) {
        engineImportService.addAggregationMultiFunction(config);
      }

      for (ConfigurationPlugInSingleRowFunction config :
          configSnapshot.getPlugInSingleRowFunctions()) {
        engineImportService.addSingleRow(
            config.getName(),
            config.getFunctionClassName(),
            config.getFunctionMethodName(),
            config.getValueCache(),
            config.getFilterOptimizable(),
            config.isRethrowExceptions());
      }
    } catch (EngineImportException ex) {
      throw new ConfigurationException("Error configuring engine: " + ex.getMessage(), ex);
    }

    return engineImportService;
  }