// if this is a local resource (instantiated from a ResourceCreationSpecifier),
// initialize the ResourceManager and UIMA Context.
if (aSpecifier instanceof ResourceCreationSpecifier) {
// resolve imports in the metadata
ResourceMetaData metadata = ((ResourceCreationSpecifier) aSpecifier).getMetaData();
name = metadata.getName();
try {
metadata.resolveImports(getResourceManager());
} catch (InvalidXMLException e) {
throw new ResourceInitializationException(e);
}
// store Resource metadata so it can be retrieved via getMetaData() method
setMetaData(metadata);
// initialize configuration
try {
mUimaContextAdmin.getConfigurationManager().createContext(
mUimaContextAdmin.getQualifiedContextName(), getMetaData());
mUimaContextAdmin.getConfigurationManager().setSession(mUimaContextAdmin.getSession());
} catch (ResourceConfigurationException e) {
throw new ResourceInitializationException(
ResourceInitializationException.ERROR_INITIALIZING_FROM_DESCRIPTOR, new Object[] {
name, metadata.getSourceUrlString() }, e);
}
// initialize any external resource declared in this descriptor
ResourceManagerConfiguration resMgrCfg = ((ResourceCreationSpecifier) aSpecifier)
.getResourceManagerConfiguration();