Package org.apache.commons.httpclient

Examples of org.apache.commons.httpclient.HttpMethodBase.releaseConnection()


        } else {               
            // Release connection after HEAD (there's no response content)
            if (log.isDebugEnabled()) {
                log.debug("Releasing HttpMethod after HEAD");
            }
            httpMethod.releaseConnection();
        }
       
        return responseObject;
    }
   
View Full Code Here


        } else {               
            // Release connection after HEAD (there's no response content)
            if (log.isDebugEnabled()) {
                log.debug("Releasing HttpMethod after HEAD");
            }
            httpMethod.releaseConnection();
        }
       
        return responseObject;
    }
   
View Full Code Here

      }
      finally
      {
        if (releaseMethod != null)
          releaseMethod.releaseConnection();
      }
    } catch (Exception e) {
      log.debug(e);
      throw AxisFault.makeFault(e);
    }
View Full Code Here

                 * their own, but if this response handler doesn't need the
                 * connection left open, we go ahead and release the it to free
                 * up resources.
                 */
                if (!leaveHttpConnectionOpen) {
                    method.releaseConnection();
                }
            }
        }
    }

View Full Code Here

            status = httpClient.executeMethod(httpMethod);
            rsp = IOUtils.toString(httpMethod.getResponseBodyAsStream());
        } catch (IOException e) {
            throw new IOException("Failed to " + method + " : " + urlTail + " : code=" + status + " response=" + e.getMessage(), e);
        } finally {
            httpMethod.releaseConnection();
        }

        trace(status + ": " + rsp);

        return new HttpReply(status, rsp);
View Full Code Here

                 * connection left open, we go ahead and release the it to free
                 * up resources.
                 */
                if (!leaveHttpConnectionOpen) {
                    try {method.getResponseBodyAsStream().close();} catch (Throwable t) {}
                    method.releaseConnection();
                }
            }
        }
    }

View Full Code Here

            /* When an HTTP 202 Accepted code has been received, this will be the case of an execution
             * of an in-only operation. In such a scenario, the HTTP response headers should be returned,
             * i.e. session cookies. */
            obtainHTTPHeaderInformation(method, msgContext);
            // Since we don't expect any content with a 202 response, we must release the connection
            method.releaseConnection();           
        } else if (HTTPStatusCodeFamily.SUCCESSFUL.equals(family)) {
            // Save the HttpMethod so that we can release the connection when cleaning up
            msgContext.setProperty(HTTPConstants.HTTP_METHOD, method);
            processResponse(method, msgContext);           
        } else if (statusCode == HttpStatus.SC_INTERNAL_SERVER_ERROR
View Full Code Here

                        String.valueOf(statusCode), method.getStatusText()));
            }
        } else {
            // Since we don't process the response, we must release the
            // connection immediately
            method.releaseConnection();
            throw new AxisFault(Messages.getMessage("transportError", String.valueOf(statusCode),
                    method.getStatusText()));
        }
    }
View Full Code Here

      }
      finally
      {
        if (releaseMethod != null)
          releaseMethod.releaseConnection();
      }
    } catch (Exception e) {
      log.debug(e);
      throw AxisFault.makeFault(e);
    }
View Full Code Here

      }
      finally
      {
        if (releaseMethod != null)
          releaseMethod.releaseConnection();
      }
    } catch (Exception e) {
      //e.printStackTrace();
      log.debug(e);
      throw AxisFault.makeFault(e);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.