* @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());
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);