throws InvalidXMLException {
try {
setDropCasOnException(Boolean.valueOf(aElement.getAttribute("dropCasOnException"))
.booleanValue());
} catch (Exception e) {
throw new InvalidXMLException(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_EXP_missing_attribute_from_xml_element__WARNING", new Object[] {
Thread.currentThread().getName(), "casProcessors", "dropCasOnException",
"casProcessors" });
}
String cps = aElement.getAttribute("casPoolSize");
if (cps != null && cps.trim().length() > 0) {
try {
setPoolSize(Integer.parseInt(cps));
} catch (Exception e) {
throw new InvalidXMLException(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_EXP_missing_attribute_from_xml_element__WARNING", new Object[] {
Thread.currentThread().getName(), "casProcessors", "casPoolSize",
"casProcessors" });
}
}
if (aElement.getAttribute("processingUnitThreadCount") != null) {
// String tc = aElement.getAttribute("processingUnitThreadCount");
try {
setConcurrentPUCount(Integer.parseInt(aElement.getAttribute("processingUnitThreadCount")));
} catch (Exception e) {
throw new InvalidXMLException(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_EXP_missing_attribute_from_xml_element__WARNING", new Object[] {
Thread.currentThread().getName(), "casProcessors", "processingUnitThreadCount",
"casProcessors" });
}
} else {
throw new InvalidXMLException(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_EXP_missing_attribute_from_xml_element__WARNING", new Object[] {
Thread.currentThread().getName(), "casProcessors", "processingUnitThreadCount",
"casProcessors" });
}
// populate inputQueueSize and outputQueueSize ONLY if casPoolSize is not defined.
// Both of these attributes have been deprecated and should not be used
try {
if (getPoolSize() == 0) {
String iqs = aElement.getAttribute("inputQueueSize");
if (iqs != null && iqs.length() > 0) {
setInputQueueSize(Integer.parseInt(iqs));
}
String oqs = aElement.getAttribute("outputQueueSize");
if (oqs != null && oqs.length() > 0) {
setOutputQueueSize(Integer.parseInt(oqs));
}
}
} catch (Exception e) {
throw new InvalidXMLException(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_EXP_missing_attribute_from_xml_element__WARNING", new Object[] {
Thread.currentThread().getName(), "casProcessors", "field", "casProcessors" });
}