if (checkpointData != null) {
// Restore CPM related stats from the checkppoint
restoreFromCheckpoint("CPM", "CPM PROCESSING TIME");
}
CasProcessorDeployer deployer = null;
// Deploy each CASProcessor in a seperate container
for (int i = 0; i < annotatorDeployList.size(); i++) {
try {
// Deployer deploys as many instances of CASProcessors as there are threads
List cpList = (ArrayList) annotatorDeployList.get(i);
String name = ((CasProcessor) cpList.get(0)).getProcessingResourceMetaData().getName();
if (UIMAFramework.getLogger().isLoggable(Level.CONFIG)) {
UIMAFramework.getLogger(this.getClass()).logrb(Level.CONFIG, this.getClass().getName(),
"initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_deploying_new_cp__CONFIG",
new Object[] { Thread.currentThread().getName(), name });
}
if (cpList.size() > 0) {
//
// Get a deployer for this type of CasProcessor. The type of deployer is determined from
// the
// CPE Configuration. Specifically from the deployment model for this CasProcessor. The
// first
//
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
"initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_lookup_cp__FINEST",
new Object[] { Thread.currentThread().getName(), name });
}
if (!cpeFactory.casProcessorConfigMap.containsKey(name)) {
if (UIMAFramework.getLogger().isLoggable(Level.SEVERE)) {
UIMAFramework.getLogger(this.getClass()).logrb(Level.SEVERE,
this.getClass().getName(), "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_invalid_processor_configuration__SEVERE",
new Object[] { Thread.currentThread().getName(), name });
}
throw new Exception(CpmLocalizedMessage.getLocalizedMessage(
CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_missing_cp__WARNING",
new Object[] { Thread.currentThread().getName(), name }));
}
CpeCasProcessor casProcessorCPEConfig = (CpeCasProcessor) cpeFactory.casProcessorConfigMap
.get(name);
if (casProcessorCPEConfig == null) {
if (UIMAFramework.getLogger().isLoggable(Level.SEVERE)) {
UIMAFramework.getLogger(this.getClass()).logrb(Level.SEVERE,
this.getClass().getName(), "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_cp_configuration_not_defined__SEVERE",
new Object[] { Thread.currentThread().getName(), name });
}
throw new Exception(CpmLocalizedMessage.getLocalizedMessage(
CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_missing_cp__WARNING",
new Object[] { Thread.currentThread().getName(), name }));
} else if (casProcessorCPEConfig.getDeployment() == null
|| casProcessorCPEConfig.getDeployment().trim().length() == 0) {
if (UIMAFramework.getLogger().isLoggable(Level.SEVERE)) {
UIMAFramework.getLogger(this.getClass()).logrb(Level.SEVERE,
this.getClass().getName(), "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_cp_deployment_mode_not_defined__SEVERE",
new Object[] { Thread.currentThread().getName(), name });
}
throw new Exception(CpmLocalizedMessage.getLocalizedMessage(
CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_Exception_invalid_deployment__WARNING", new Object[] {
Thread.currentThread().getName(), name,
casProcessorCPEConfig.getDeployment() }));
}
deployer = DeployFactory.getDeployer(cpeFactory, casProcessorCPEConfig, pca);
// Deploy CasConsumer.
ProcessingContainer container = deployer.deployCasProcessor(cpList, false);
annotatorList.add(container);
}
} catch (Exception e) {
UIMAFramework.getLogger(this.getClass()).logrb(Level.SEVERE, this.getClass().getName(),
"initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,