use of org.apache.uima.resource.ConfigurationManager in project dkpro-lab by dkpro.
the class TaskContextProvider method initialize.
@Override
public boolean initialize(ResourceSpecifier aSpecifier, Map<String, Object> aAdditionalParams) throws ResourceInitializationException {
if (!super.initialize(aSpecifier, aAdditionalParams)) {
return false;
}
// Create synthetic context to be able to use InitializeUtil.
UimaContextAdmin context = UIMAFramework.newUimaContext(UIMAFramework.getLogger(), UIMAFramework.newDefaultResourceManager(), UIMAFramework.newConfigurationManager());
ConfigurationManager cfgMgr = context.getConfigurationManager();
cfgMgr.setSession(context.getSession());
CustomResourceSpecifier spec = (CustomResourceSpecifier) aSpecifier;
for (Parameter p : spec.getParameters()) {
cfgMgr.setConfigParameterValue(context.getQualifiedContextName() + p.getName(), p.getValue());
}
ConfigurationParameterInitializer.initialize(this, context);
return true;
}
Aggregations