UIMAFramework.getLogger(this.getClass()).logrb(Level.SEVERE,
this.getClass().getName(), "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_cp_no_name__SEVERE",
new Object[] { Thread.currentThread().getName() });
}
throw new ResourceConfigurationException(
InvalidXMLException.REQUIRED_ATTRIBUTE_MISSING, new Object[] { "name",
"casProcessor" }, new Exception(CpmLocalizedMessage.getLocalizedMessage(
CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_EXP_missing_attribute_from_xml_element__WARNING",
new Object[] { Thread.currentThread().getName(), "n/a", "name",
"casProcessor" })));
}
} else {
// Assumption is that the container already exists and it contains CasProcessor
// configuration
casProcessorConfig = processingContainer.getCasProcessorConfiguration();
if (casProcessorConfig == null) {
throw new ResourceConfigurationException(InvalidXMLException.ELEMENT_NOT_FOUND,
new Object[] { "<casProcessor>", "<casProcessors>" }, new Exception(
CpmLocalizedMessage.getLocalizedMessage(
CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_EXP_bad_cpe_descriptor_no_cp__WARNING",
new Object[] { Thread.currentThread().getName() })));
}
}
// Add CasProcess to the instance pool
casProcessorPool.addCasProcessor(casProcessor);
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
"initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_deploying_cp__FINEST",
new Object[] { Thread.currentThread().getName(), name });
}
}
} catch (ResourceConfigurationException e) {
e.printStackTrace();
throw e;
} catch (Exception e) {
e.printStackTrace();
throw new ResourceConfigurationException(ResourceServiceException.RESOURCE_UNAVAILABLE,
new Object[] {}, e);
}
return processingContainer;
}