private synchronized ResourceManager createRM(StringPair sp, PackageBrowser pkgBrowser, ResourceManager parentResourceManager)
throws MalformedURLException {
// create UIMA resource manager and apply pear settings
// ResourceManager rsrcMgr = UIMAFramework.newDefaultResourceManager();
ResourceManager rsrcMgr;
if (null == parentResourceManager) {
// could be null for top level Pear not in an aggregate
rsrcMgr = UIMAFramework.newDefaultResourceManager();
} else {
rsrcMgr = UIMAFramework.newDefaultResourceManagerPearWrapper();
((ResourceManagerPearWrapper)rsrcMgr).initializeFromParentResourceManager(parentResourceManager);
}
rsrcMgr.setExtensionClassPath(sp.classPath, true);
UIMAFramework.getLogger(this.getClass()).logrb(
Level.CONFIG,
this.getClass().getName(),
"createRM",
LOG_RESOURCE_BUNDLE,
"UIMA_pear_runtime_set_classpath__CONFIG",
new Object[] { sp.classPath,
pkgBrowser.getRootDirectory().getName() });
// get and set uima.datapath if specified
if (sp.dataPath != null) {
rsrcMgr.setDataPath(sp.dataPath);
UIMAFramework.getLogger(this.getClass()).logrb(
Level.CONFIG,
this.getClass().getName(),
"createRM",
LOG_RESOURCE_BUNDLE,