use of org.apache.stanbol.enhancer.servicesapi.EnhancementEngine in project stanbol by apache.
the class AllActiveEnginesChain method update.
private void update() throws ChainException {
Set<String> activeEngineNames = new HashSet<String>(tracker.getActiveEngineNames());
if (activeEngineNames.isEmpty()) {
throw new ChainException("Currently there are no active EnhancementEngines available");
}
List<EnhancementEngine> activeEngines = new ArrayList<EnhancementEngine>(activeEngineNames.size());
Iterator<String> names = activeEngineNames.iterator();
while (names.hasNext()) {
String name = names.next();
EnhancementEngine engine = tracker.getEngine(name);
if (engine != null) {
activeEngines.add(engine);
} else {
//looks like the config has changed in the meantime
names.remove();
}
}
Set<String> emptySet = Collections.emptySet();
executionPlan = calculateExecutionPlan(getName(), activeEngines, //this Chain does not support optional engines
emptySet, //only active meaning that no engines are missing
emptySet);
engineNames = Collections.unmodifiableSet(activeEngineNames);
}
Aggregations