String.valueOf(conn.getPort()) });
UIMAFramework.getLogger(this.getClass()).log(Level.WARNING, Thread.currentThread().getName(),
vnse);
conn.close();
throw new ServiceException(vnse.getMessage());
} catch (ServiceDownException sde) {
UIMAFramework.getLogger(this.getClass()).logrb(
Level.WARNING,
this.getClass().getName(),
"process",
CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_failed_service_request__WARNING",
new Object[] { Thread.currentThread().getName(), conn.getHost(),
String.valueOf(conn.getPort()) });
UIMAFramework.getLogger(this.getClass()).log(Level.WARNING, Thread.currentThread().getName(),
sde);
conn.close();
throw new ServiceConnectionException(sde.getMessage());
} catch (ServiceException sde) {
UIMAFramework.getLogger(this.getClass()).logrb(
Level.WARNING,
this.getClass().getName(),
"process",
CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_failed_service_request__WARNING",
new Object[] { Thread.currentThread().getName(), conn.getHost(),
String.valueOf(conn.getPort()) });
UIMAFramework.getLogger(this.getClass()).log(Level.WARNING, Thread.currentThread().getName(),
sde);
if (sde.getMessage().equals("Unknown command") && aFrame != null) {
UIMAFramework.getLogger(this.getClass()).log(Level.INFO, aFrame.toXML());
}
throw new ServiceConnectionException(sde.getMessage());
} catch (IOException e) {
UIMAFramework.getLogger(this.getClass()).logrb(
Level.WARNING,
this.getClass().getName(),
"process",
CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_failed_service_request__WARNING",
new Object[] { Thread.currentThread().getName(), conn.getHost(),
String.valueOf(conn.getPort()) });
UIMAFramework.getLogger(this.getClass()).log(Level.WARNING, Thread.currentThread().getName(),
e);
conn.close();
if (System.getProperty("TEST_BEFORE_SEND") != null) {
testAndReconnect();
}
if (e instanceof SocketTimeoutException) {
UIMAFramework.getLogger(this.getClass()).log(Level.WARNING,
Thread.currentThread().getName() + " Exception Cause::" + e.getClass().getName());
throw new ServiceConnectionException(e);
}
throw new ServiceConnectionException(CpmLocalizedMessage.getLocalizedMessage(
CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_service_timeout__WARNING",
new Object[] { Thread.currentThread().getName(), conn.getHost(),
String.valueOf(conn.getPort()), String.valueOf(currentTimeout) }));
} catch (Exception e) {
UIMAFramework.getLogger(this.getClass()).logrb(
Level.WARNING,
this.getClass().getName(),
"process",
CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_failed_service_request__WARNING",
new Object[] { Thread.currentThread().getName(), conn.getHost(),
String.valueOf(conn.getPort()) });
UIMAFramework.getLogger(this.getClass()).log(Level.WARNING, Thread.currentThread().getName(),
e);
conn.close();
throw new ServiceException(e.getMessage());
}
}