Package org.apache.commons.httpclient

Examples of org.apache.commons.httpclient.HttpMethodRetryHandler


  protected List<String> doRequest(HttpMethodBase method, String dest)
      throws IOException, HttpException {

    HttpMethodParams pars = method.getParams();
    pars.setParameter(HttpMethodParams.RETRY_HANDLER,
        (Object) new HttpMethodRetryHandler() {
          public boolean retryMethod(HttpMethod m, IOException e, int exec) {
            return !(e instanceof java.net.ConnectException)
                && (exec < MAX_RETRIES_PER_COLLECTOR);
          }
        });
View Full Code Here


        container.activateComponent(http, "http");

        container.start();

        PostMethod method = new PostMethod("http://localhost:8192/ep1/");
        method.getParams().setParameter(HttpMethodParams.RETRY_HANDLER, new HttpMethodRetryHandler() {
            public boolean retryMethod(HttpMethod method, IOException exception, int executionCount) {
                return false;
            }
        });
        method.setRequestEntity(new StringRequestEntity(
View Full Code Here

            httpClient.getParams().setSoTimeout(60000);

            httpServletRequest.setAttribute("com.groupon.odo.removeHeaders", headersToRemove);

            // exception handling for httpclient
            HttpMethodRetryHandler noretryhandler = new HttpMethodRetryHandler() {
                public boolean retryMethod(
                        final HttpMethod method,
                        final IOException exception,
                        int executionCount) {
                    return false;
View Full Code Here

                  throw ioe ;
              }
          }
          params.setParameter(HttpMethodParams.RETRY_HANDLER, handler);
      } else {
          HttpMethodRetryHandler other = (HttpMethodRetryHandler)params.getParameter(HttpMethodParams.RETRY_HANDLER);
          params.setParameter(HttpMethodParams.RETRY_HANDLER, new HttpMethodRetryHandlerWrapper(other));
      }
    }
View Full Code Here

            public XmlRpcTransport createTransport()
                    throws XmlRpcClientException {
                HttpClient client = new HttpClient();
                client.getParams().setParameter(HttpMethodParams.RETRY_HANDLER,
                        new HttpMethodRetryHandler() {

                            public boolean retryMethod(HttpMethod method,
                                    IOException e, int count) {
                                if (count < Integer
                                        .getInteger(
View Full Code Here

  protected List<String> doRequest(HttpMethodBase method, String dest)
      throws IOException, HttpException {

    HttpMethodParams pars = method.getParams();
    pars.setParameter(HttpMethodParams.RETRY_HANDLER,
        (Object) new HttpMethodRetryHandler() {
          public boolean retryMethod(HttpMethod m, IOException e, int exec) {
            return !(e instanceof java.net.ConnectException)
                && (exec < MAX_RETRIES_PER_COLLECTOR);
          }
        });
View Full Code Here

            public XmlRpcTransport createTransport()
                    throws XmlRpcClientException {
                HttpClient client = new HttpClient();
                client.getParams().setParameter(HttpMethodParams.RETRY_HANDLER,
                        new HttpMethodRetryHandler() {

                            public boolean retryMethod(HttpMethod method,
                                    IOException e, int count) {
                                if (count < Integer
                                        .getInteger(
View Full Code Here

        container.activateComponent(http, "http");
       
        container.start();
       
        PostMethod method = new PostMethod("http://localhost:8192/ep1/");
        method.getParams().setParameter(HttpMethodParams.RETRY_HANDLER, new HttpMethodRetryHandler() {
            public boolean retryMethod(HttpMethod method, IOException exception, int executionCount) {
                return false;
            }
        });
        method.setRequestEntity(new StringRequestEntity("<env:Envelope xmlns:env='http://www.w3.org/2003/05/soap-envelope'><env:Body><hello>world</hello></env:body</env:Envelope>"));
View Full Code Here

        this.maxTemplateSizeInByte = maxTemplateSizeInBytes;

        this.totalBytes = 0;
        this.client = new HttpClient(s_httpClientManager);

        myretryhandler = new HttpMethodRetryHandler() {
            @Override
            public boolean retryMethod(final HttpMethod method, final IOException exception, int executionCount) {
                if (executionCount >= 2) {
                    // Do not retry if over max retry count
                    return false;
View Full Code Here

    this.MAX_TEMPLATE_SIZE_IN_BYTES = maxTemplateSizeInBytes;

    this.totalBytes = 0;
    this.client = new HttpClient(s_httpClientManager);

    myretryhandler = new HttpMethodRetryHandler() {
        public boolean retryMethod(
            final HttpMethod method,
            final IOException exception,
            int executionCount) {
            if (executionCount >= 2) {
View Full Code Here

TOP

Related Classes of org.apache.commons.httpclient.HttpMethodRetryHandler

Copyright © 2018 www.massapicom. 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.