/** * Quietly closes the resteasy client (releases the connection). * @param response */ private void closeQuietly(ClientResponse<?> response) { if (response != null) { response.releaseConnection(); } }
/** * Quietly closes the resteasy client (releases the connection). * @param response */ private void closeQuietly(ClientResponse<?> response) { if (response != null) { response.releaseConnection(); } }
public ClientResponseFailure(String s, ClientResponse response) { super(s); this.response = BaseClientResponse.copyFromError(response); // release the connection because we don't trust users to catch and clean up response.releaseConnection(); }
public ClientResponseFailure(Throwable throwable, ClientResponse response) { super(throwable); this.response = BaseClientResponse.copyFromError(response); // release the connection because we don't trust users to catch and clean up response.releaseConnection(); }
public ClientResponseFailure(String s, ClientResponse response) { super(s); this.response = BaseClientResponse.copyFromError(response); // release the connection because we don't trust users to catch and clean up response.releaseConnection(); }
public ClientResponseFailure(String s, Throwable throwable, ClientResponse response) { super(s, throwable); this.response = BaseClientResponse.copyFromError(response); // release the connection because we don't trust users to catch and clean up response.releaseConnection(); }
public ClientResponseFailure(String s, Throwable throwable, ClientResponse response) { super(s, throwable); this.response = BaseClientResponse.copyFromError(response); // release the connection because we don't trust users to catch and clean up response.releaseConnection(); }
public ClientResponseFailure(Throwable throwable, ClientResponse response) { super(throwable); this.response = BaseClientResponse.copyFromError(response); // release the connection because we don't trust users to catch and clean up response.releaseConnection(); }
public ClientResponseFailure(ClientResponse response) { super("Failed with status: " + response.getStatus()); this.response = BaseClientResponse.copyFromError(response); // release connection just in case it doesn't get garbage collected or manually released response.releaseConnection(); }
public ClientResponseFailure(ClientResponse response) { super("Failed with status: " + response.getStatus()); this.response = BaseClientResponse.copyFromError(response); // release connection just in case it doesn't get garbage collected or manually released response.releaseConnection(); }
public void closeConnection() { try { if (clientResponse != null) { clientResponse.releaseConnection(); } if (clientRequest != null && clientRequest.getExecutor() != null) { clientRequest.getExecutor().close(); } } catch (Exception e) { LOG.error(e.getMessage(), e); } }
protected void handleResponse(ClientResponse response) { if (response != null) { int status = response.getStatus(); response.releaseConnection(); if (status >= 400) { throw new OperationFailedException(status, "Operation failed. See server log messages."); } } } }
protected void handleResponse(ClientResponse response) { if (response != null) { int status = response.getStatus(); response.releaseConnection(); if (status >= 400) { throw new OperationFailedException(status, "Operation failed. See server log messages."); } } } }
if (response != null) response.releaseConnection();
if (response != null) response.releaseConnection();
if (response != null) response.releaseConnection();
@Override public void handle(ClientResponse<?> response) throws RuntimeException { final int status = response.getStatus(); String message = null; try { message = response.getEntity(String.class); } catch (Exception e) { } finally { response.releaseConnection(); } switch (status) { case HttpURLConnection.HTTP_BAD_REQUEST: throw new BadRequestException(message); case HttpURLConnection.HTTP_INTERNAL_ERROR: throw new InternalServerErrorException(message); case HttpURLConnection.HTTP_UNAUTHORIZED: throw new UnauthorisedException(message); case 426: throw new UpgradeException(message); case HttpURLConnection.HTTP_NOT_FOUND: throw new NotFoundException(message); } } }
if (response != null) response.releaseConnection();
if (response != null) response.releaseConnection();