Package org.apache.commons.httpclient

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


                        }
                    } catch (Exception e) {
                        if (Constants.DEBUG)
                            e.printStackTrace(System.out);
                    } finally {
                        method.releaseConnection();
                    }
                    request.setAttribute("flagPesquisaFuncionario", "true");
                }
            }
           
View Full Code Here


      while((responseline=br.readLine())!=null){
        responseData.appendToBody(responseline+"\n");
      }
    }
    finally{
      request_method.releaseConnection();
    }
    return responseData;
  }
  /**
   * Makes a HTTP request to the specified url using the specified method, user name and password
View Full Code Here

                    s_logger.info("Response code is " + this.responseCode);
                }
            } catch (Exception ex) {
                s_logger.error("Command " + command + " failed with exception " + ex.getMessage());
            } finally {
                method.releaseConnection();
            }
        }
    }

    // verify if response is empty (contains only root element)
View Full Code Here

                                actualEvents.put(element.get("type"), 1);
                            }
                        }
                    }
                }
                method.releaseConnection();

                // compare actual events with expected events

                // compare expected result and actual result
                Iterator<?> iterator = expectedEvents.keySet().iterator();
View Full Code Here

                            actualEvents.put(element.get("type"), 1);
                        }
                    }
                }
            }
            method.releaseConnection();
        } catch (Exception ex) {
            s_logger.error(ex);
        }

        // compare actual events with expected events
View Full Code Here

                        } catch (InterruptedException e) {
                        }
                    } else {
                        break;
                    }
                    method.releaseConnection();
                }
                else {
                    s_logger.error("Error during queryJobAsync. Error code is " + code);
                    this.responseCode = code;
                    return null;
View Full Code Here

                                method.getResponseBodyAsStream(), urlAsString);
                    }
                } finally {
                    // Make sure to release the connection, this will also
                    // close the stream.
                    method.releaseConnection();
                }
            }
        } catch (IOException e) {
            if (logger.isDebugEnabled()) {
                logger.debug(e);
View Full Code Here

                    // operation failed so populate exception to throw
                    throw populateHttpOperationFailedException(exchange, method, responseCode);
                }
            }
        } finally {
            method.releaseConnection();
        }
    }

    @Override
    public HttpEndpoint getEndpoint() {
View Full Code Here

          } catch (IOException e) {
            log.warn("Error closing stream: " + e.getMessage());
          }
        }
        if (method != null) {
          method.releaseConnection();
        }
      }
    }
    if (statusCode != HttpStatus.SC_OK) {
      throw new APIException("URL access returned " + HttpStatus.getStatusText(statusCode));
View Full Code Here

          } catch (IOException e) {
            log.warn("Error closing stream: " + e.getMessage());
          }
        }
        if (method != null) {
          method.releaseConnection();
        }
      }
    }
    if (statusCode != HttpStatus.SC_OK) {
      throw new APIException("URL access returned " + HttpStatus.getStatusText(statusCode));
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.