* Uses ProcessControllerAdapter instance to launch fenced CasProcessor.
*/
public ProcessingContainer deployCasProcessor(List aCasProcessorList, boolean redeploy)
throws ResourceConfigurationException {
String name = null;
CasProcessor cProcessor = null;
CasProcessorConfiguration casProcessorConfig = null;
ProcessingContainer processingContainer = null;
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
"initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_deploy_services__FINEST",
Thread.currentThread().getName());
}
if (controller == null) {
throw new ResourceConfigurationException(
ResourceInitializationException.CONFIG_SETTING_ABSENT,
new Object[] { "ProcessControllerAdapter" });
}
try {
// Launch one instance of fenced CasProcessor per pipeline -Adam
serviceUrls = controller.deploy(name, aCasProcessorList.size());
ServiceProxyPool casProcessorPool = new ServiceProxyPool();
// Deploy one Cas Processor at a time in sequential order
for (int i = 0; i < aCasProcessorList.size(); i++) {
cProcessor = (CasProcessor) aCasProcessorList.get(i);
// Container may have already been instantiated. This will be the case if the CPM is
// configured for concurrent
// processing ( more than one processing pipeline). There is only one container per
// CasProcessor type.
// So each instance of the same CasProcessor will be associated with a single container.
// Inside the
// container instances are pooled. When deploying the very first CasProcessor of each type,
// the
// container will be created and initialized. Any subsequent deployments of this
// CasProcessor will
// simply use it, and will be added to this container's instance pool.
if (processingContainer == null) {
ProcessingResourceMetaData metaData = cProcessor.getProcessingResourceMetaData();
CpeCasProcessor casProcessorType = (CpeCasProcessor) cpeFactory.casProcessorConfigMap
.get(metaData.getName());
// Create a pool to hold instances of CasProcessors. Instances are managed by a container
// through
// getCasProcessor() and releaseProcessor() methods.