protected Object handleException(Exception ex, SocketWrapper socketWrapper)
throws ClassNotFoundException, InvocationFailureException, CannotConnectException
{
if (ex instanceof ClassNotFoundException)
{
log.debug("Error loading classes from remote call result.", ex);
throw (ClassNotFoundException) ex;
}
if (ex instanceof CannotConnectException)
{
log.debug(this, ex);
throw (CannotConnectException) ex;
}
if (ex instanceof SocketTimeoutException)
{
log.debug("Got SocketTimeoutException, exiting", ex);
String message = "Socket timed out. Waited " + socketWrapper.getTimeout() +
" milliseconds for response while calling on " + getLocator();
throw new InvocationFailureException(message, ex);
}
throw new InvocationFailureException("Unable to perform invocation", ex);
}