private synchronized boolean activateProcessor(CasProcessorConfiguration aCasProcessorConfig,
String aService, ProcessingContainer aProcessingContainer, boolean redeploy) // throws
// ResourceInitializationException,
// ResourceConfigurationException
throws Exception {
VinciTAP tap = getTextAnalysisProxy(aCasProcessorConfig);
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
"initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_activating_service_on_port__FINEST",
new Object[] { Thread.currentThread().getName(), aService });
}
boolean tryAgain = true;
int maxCount = aCasProcessorConfig.getMaxRestartCount();
int maxTimeToWait = aCasProcessorConfig.getMaxTimeToWaitBetweenRetries();
// Never sleep indefinitely. Override if the maxTimeToWait = 0
if (maxTimeToWait == 0) {
maxTimeToWait = WAIT_TIME;
}
// Initially dont sleep
boolean sleepBetweenRetries = false;
while (tryAgain) {
try {
if ( sleepBetweenRetries ) {
wait(maxTimeToWait);
} else {
sleepBetweenRetries = true;
}
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
"initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_connecting_to_service__FINEST",
new Object[] { Thread.currentThread().getName(), aService });
}
// Try to connect to service using its service name
tap.connect(aService);
tryAgain = false;
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
"initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_connection_established__FINEST",