Hi all,
triggered by changes in UIMA-5058, I have looked again at how the
UimaContextHolder works
and is being used right now.
In particular, I think the following case is not uncommon but now potentially
problematic:
----
// 1) instantiate reader
CollectionReader reader = UIMAFramework.produceCollectionReader(readerDesc,
resMgr, null);
// 2) instantiate analysis engine
AnalysisEngine aae = UIMAFramework.produceAnalysisEngine(aaeDesc, resMgr, null);
// 3) create a CAS
CAS cas = CasCreationUtils.createCas(asList(reader.getMetaData(),
aae.getMetaData()),
null, resMgr);
// 4) inform the reader about the type system
reader.typeSystemInit(cas.getTypeSystem());
// 5) iterate over the reader using the given CAS and process it using the AE
---
The potential problem in this setup is that 1) and 2) both call
UimaContextHolder.setContext().
Do you see that as a problem?
Best,
-- Richard