CpeCasProcessor aCasProcessorConfig, ProcessControllerAdapter aPca)
throws ResourceConfigurationException {
String deployMode = aCasProcessorConfig.getDeployment();
if (Constants.DEPLOYMENT_LOCAL.equals(deployMode)) {
return new VinciCasProcessorDeployer(aCpeFactory);
} else if (Constants.DEPLOYMENT_REMOTE.equals(deployMode)) {
String protocol = getProtocol(aCasProcessorConfig, aCpeFactory.getResourceManager());
if (protocol == null || protocol.trim().length() == 0) {
throw new ResourceConfigurationException(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_invalid_service_descriptor__SEVERE", new Object[] {
Thread.currentThread().getName(), "<uriSpecifier>", "<protocol>" },
new Exception(CpmLocalizedMessage.getLocalizedMessage(
CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_EXP_invalid_service_descriptor__WARNING", new Object[] {
Thread.currentThread().getName(), aCasProcessorConfig.getName() })));
} else if (Constants.SOCKET_PROTOCOL.equalsIgnoreCase(protocol)) {
if (aPca == null) {
throw new ResourceConfigurationException(
ResourceInitializationException.CONFIG_SETTING_ABSENT,
new Object[] { "ProcessControllerAdapter" });
}
return new SocketCasProcessorDeployer(aPca, aCpeFactory);
} else {
// Default is still Vinci
return new VinciCasProcessorDeployer(aCpeFactory);
}
} else if (Constants.DEPLOYMENT_INTEGRATED.equals(deployMode)) {
return new CPEDeployerDefaultImpl(aCpeFactory);
}
throw new ResourceConfigurationException(InvalidXMLException.REQUIRED_ATTRIBUTE_MISSING,