Package org.apache.commons.httpclient

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


          throw e;
        }
        e.waitForRetry();
      } finally {
        if (method != null) {
          method.releaseConnection();
        }
      }
      log.warn("Error. Trying again");
    }
  }
View Full Code Here


          } catch (IOException e) {
            log.warn("Error closing stream");
          }
        }
        if (method != null) {
          method.releaseConnection();
        }
      }
      log.warn("Error. Trying again");
    }
  }
View Full Code Here

            throw new SolrServerException("Unsupported method: "+request.getMethod() );
          }
        }
        catch( NoHttpResponseException r ) {
          // This is generally safe to retry on
          method.releaseConnection();
          method = null;
          // If out of tries then just rethrow (as normal error).
          if( ( tries < 1 ) ) {
            throw r;
          }
View Full Code Here

    }
    catch (IOException e) {
      throw new SolrServerException( e );
    }
    finally {
      method.releaseConnection();
    }
  }

  //-------------------------------------------------------------------
  //-------------------------------------------------------------------
View Full Code Here

                    throw exception;
                }
            }

        } finally {
            method.releaseConnection();
        }
    }

    /**
     * Strategy when executing the method (calling the remote server).
View Full Code Here

        method = new GetMethod(url);
        int status = httpClient.executeMethod(method);
        assertEquals(HttpStatus.SC_OK, status);
        String result = method.getResponseBodyAsString();
        assertTrue(result.contains("hello"));
        method.releaseConnection();
    }
    @Test
    public void testGetEchoSimple() throws Exception {
        HttpClient httpClient = createClient();
        String url = "http://localhost:9167/SimpleEcho/simpleEcho/string/hello";
View Full Code Here

        method = new GetMethod(url);
        int status = httpClient.executeMethod(method);
        assertEquals(HttpStatus.SC_OK, status);
        String result = method.getResponseBodyAsString();
        assertTrue(result.contains("hello"));
        method.releaseConnection();
    }
}
View Full Code Here

                    throw exception;
                }
            }

        } finally {
            method.releaseConnection();
        }
    }

    /**
     * Strategy when executing the method (calling the remote server).
View Full Code Here

    }

    public void cleanup(MessageContext msgContext) throws AxisFault {
        HttpMethod httpMethod = (HttpMethod) msgContext.getProperty(HTTPConstants.HTTP_METHOD);
        if (httpMethod != null) {
            httpMethod.releaseConnection();
            msgContext.removeProperty(HTTPConstants.HTTP_METHOD); // guard against multiple calls
        }
    }

    public void init(ConfigurationContext confContext, TransportOutDescription transportOut)
View Full Code Here

            throw new CarbonException(e);
        } catch (IOException e) {
            throw new CarbonException(e);
        } finally {
            // Release the connection.
            method.releaseConnection();
        }
    }

    private static SystemHostObject checkInstance(Scriptable obj) {
        if (obj == null || !(obj instanceof SystemHostObject)) {
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.