if (responseObject instanceof Collection<?>) {
result = this.toCRResolvableBeanCollection(responseObject);
} else if (responseObject instanceof CRError) {
CRError ex = (CRError) responseObject;
throw new CRException(ex);
} else {
log.error("COULD NOT CAST RESULT. Perhaps remote agent does not work properly");
}
} catch (ClassNotFoundException e) {
log.error("Coult not load object from http response", e);
throw new CRException(e);
}
if (result != null) {
for (CRResolvableBean crBean : result) {
resultlist.add(crBean);
}
}
} catch (HttpException e) {
log.error("Fatal protocol violation", e);
throw new CRException(e);
} catch (IOException e) {
log.error("Fatal transport error", e);
throw new CRException(e);
} finally {
// Release the connection.
method.releaseConnection();
}