/** * Creates a new CasPool * * @param aNumInstances * the number of CAS instances in the pool * @param aAnalysisEngine * the analysis engine that will create the CAS instances and which will later be used to * process them * * @throws ResourceInitializationException * if the CAS instances could not be created */ public CasPool(int aNumInstances, AnalysisEngine aAnalysisEngine) throws ResourceInitializationException { this(aNumInstances, fillPool(aNumInstances, Collections.singletonList((ProcessingResourceMetaData) aAnalysisEngine.getMetaData()), aAnalysisEngine.getPerformanceTuningSettings(), aAnalysisEngine.getResourceManager())); }
public static void main(String[] args) throws Exception { String dictionaryResourceName = DICTIONARY_RESOURCE_NAME; if (args.length == 2) { // do nothing } else if (args.length == 3) { dictionaryResourceName = args[2]; } else { usage(); System.exit(17); } AnalysisEngineDescription conceptMapperDesc = UIMAFramework.getXMLParser() .parseAnalysisEngineDescription(new XMLInputSource(args[0])); AnalysisEngine ae = UIMAFramework.produceAnalysisEngine(conceptMapperDesc); DictionaryResource_impl dict = (DictionaryResource_impl) ae.getResourceManager().getResource( dictionaryResourceName); OutputStream output = new BufferedOutputStream(new FileOutputStream(args[1])); dict.serializeEntries(output); output.close(); ae.destroy(); // for some reason JVM won't exit normally, // probably because CPM threads are alive? System.exit(0); }
if (((AnalysisEngine)processor).getResourceManager() == this.cpeFactory.getResourceManager()) continue; if (((AnalysisEngine)processor).getResourceManager() == this.cpeFactory.getResourceManager()) continue;