/** * Creates and returns a new default Resource Manager * * @return ResourceManager - new instance of a default ResourceManager */ public static ResourceManager produceResourceManager() { return UIMAFramework.newDefaultResourceManager(); }
public CPMImpl() throws Exception { this(UIMAFramework.newDefaultResourceManager()); }
public static File resolveFile(String path, ResourceManager resMgr) throws URISyntaxException, MalformedURLException { Preconditions.checkArgument(path != null); if (resMgr == null) { resMgr = UIMAFramework.newDefaultResourceManager(); } URL modelBaseURL = resMgr.resolveRelativePath(path); if (modelBaseURL == null) throw new IllegalStateException(format( "Can't resolve path %s using an UIMA relative path resolver", path)); return new File(modelBaseURL.toURI()); }
/** * @see org.apache.uima.analysis_engine.AnalysisEngineDescription#getDelegateAnalysisEngineSpecifiers() */ public Map<String, ResourceSpecifier> getDelegateAnalysisEngineSpecifiers() throws InvalidXMLException { resolveDelegateAnalysisEngineImports(UIMAFramework.newDefaultResourceManager(), false); return Collections.unmodifiableMap(mDelegateAnalysisEngineSpecifiers); }
private void initializeResourceManager() { if (context instanceof UimaContextAdmin) { UimaContextAdmin uca = (UimaContextAdmin) context; ResourceManager rm = uca.getResourceManager(); if (rm != null) { resourceManager = rm; } } if (resourceManager == null) { resourceManager = UIMAFramework.newDefaultResourceManager(); } }
public void doFullValidation() throws ResourceInitializationException { doFullValidation(UIMAFramework.newDefaultResourceManager()); }
public ResourceManager createResourceManager() { ResourceManager resourceManager = UIMAFramework.newDefaultResourceManager(); try { resourceManager.setExtensionClassPath(this.getClass().getClassLoader(), classPath, true); } catch (MalformedURLException e1) { error.newError(IError.ERROR, getString("Internal Error", null), e1); } return resourceManager; }
public void resolveImports() throws InvalidXMLException { if (getImport() != null) { resolveImports(UIMAFramework.newDefaultResourceManager()); } }
/** * @see TypeSystemDescription#resolveImports() */ // allow these calls to be done multiple times on this same object, in different threads public synchronized void resolveImports() throws InvalidXMLException { if (getImports().length == 0) { resolveImports(null, null); } else { resolveImports(new TreeSet<String>(), UIMAFramework.newDefaultResourceManager()); } }
/** * @see TypeSystemDescription#resolveImports() */ // support multithreading, // avoid object creation if already resolved public synchronized void resolveImports() throws InvalidXMLException { if (getImports().length == 0) { resolveImports(null, null); } else { resolveImports(new TreeSet<String>(), UIMAFramework.newDefaultResourceManager()); } }
public synchronized void resolveImports() throws InvalidXMLException { if (getImports().length == 0) { resolveImports(null, null); } else { resolveImports(new TreeSet<String>(), UIMAFramework.newDefaultResourceManager()); } }
public synchronized void resolveImports() throws InvalidXMLException { if (getImports().length == 0) { resolveImports(null, null); } else { resolveImports(new TreeSet<String>(), UIMAFramework.newDefaultResourceManager()); } }
public ResourceManager getResourceManager() { if (resourceManager != null) { return resourceManager; } else { RutaBlock parent = owner.getParent(); if (parent != null) { return parent.getEnvironment().getResourceManager(); } } // at least return default resource manager return UIMAFramework.newDefaultResourceManager(); }
@Override public void write(OutputStream aStream) throws Exception { AnalysisEngineDescription analysisDesc = getAnalysisEngineDescription(aContext); // FIXME should use the same resource manager here // as the engine uses! analysisDesc.resolveImports(UIMAFramework.newDefaultResourceManager()); analysisDesc.toXML(aStream); } });
private ResourceManager getResourceManager(RutaBuildOptions options) { ResourceManager rm = null; if (options.getClassLoader() != null) { rm = new ResourceManager_impl(options.getClassLoader()); } else { rm = UIMAFramework.newDefaultResourceManager(); } return rm; }
/** * Create a new CPEFactory on which we will later call parse(String) to parse a CPE descriptor. * * @param aResourceManager the a resource manager */ public CPEFactory(ResourceManager aResourceManager) { if (aResourceManager == null) { aResourceManager = UIMAFramework.newDefaultResourceManager(); } uimaContext = UIMAFramework.newUimaContext(UIMAFramework.getLogger(), aResourceManager, UIMAFramework.newConfigurationManager()); }
private String resolveToAbsolutePath(Import theImport) { ResourceManager resourceManager = UIMAFramework.newDefaultResourceManager(); try { return theImport.findAbsoluteUrl(resourceManager).toExternalForm(); } catch (Exception e) { if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.WARNING)) { UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, WarmUpDataProvider.class.getName(), "resolveToAbsolutePath", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE, "UIMAEE_exception__WARNING", e); } return "ERROR converting import by name to absolute path"; } }
@Override public void write(OutputStream aStream) throws Exception { AnalysisEngineDescription analysisDesc = getAnalysisEngineDescription(aContext); // FIXME should use the same resource manager here // as the engine uses! analysisDesc.resolveImports(UIMAFramework.newDefaultResourceManager()); analysisDesc.toXML(aStream); } });
public Map<String, ResourceSpecifier> getAllComponentSpecifiers(ResourceManager aResourceManager) throws InvalidXMLException { if (aResourceManager == null) { aResourceManager = UIMAFramework.newDefaultResourceManager(); } resolveImports(aResourceManager); Map<String, ResourceSpecifier> map = new LinkedHashMap<String, ResourceSpecifier>(mDelegateAnalysisEngineSpecifiers); if (getFlowControllerDeclaration() != null) { map.put(getFlowControllerDeclaration().getKey(), getFlowControllerDeclaration() .getSpecifier()); } return Collections.unmodifiableMap(map); }
public void initCPM() throws DictionaryLoaderException { try { ResourceManager resMgr = UIMAFramework.newDefaultResourceManager(); String dp = System.getProperty("uima.datapath"); if (null != dp) { resMgr.setDataPath(dp); } ae = UIMAFramework.produceAnalysisEngine(aeSpecifier); cas = ae.newCAS(); } catch (ResourceInitializationException e) { throw new DictionaryLoaderException(e); } catch (MalformedURLException e) { throw new DictionaryLoaderException(e); } }