List<Future<?>> fstCreationTasks = new ArrayList<Future<?>>();
ExecutorService es = Executors.newFixedThreadPool(fstThreads);
log.info(" ... build FST models ");
for(FstConfig config : fstConfigs){
for(final CorpusCreationInfo corpus : config.getCorpusCreationInfos()){
fstCreationTasks.add(es.submit(new CorpusCreationTask(core, corpus)));
}
}
//now wait for the completion of the tasks
Iterator<Future<?>> taskIt = fstCreationTasks.iterator();
while(taskIt.hasNext()){