Package org.apache.commons.httpclient

Examples of org.apache.commons.httpclient.HttpMethodRetryHandler


        PostMethod httppost = new PostMethod("http://127.0.0.1:"
                + (UtilServer.TESTING_PORT)
                + "/axis/services/EchoService/mtomSample");

        HttpMethodRetryHandler myretryhandler = new HttpMethodRetryHandler() {
            public boolean retryMethod(final HttpMethod method,
                                       final IOException exception,
                                       int executionCount) {
                if (executionCount >= 10) {
                    return false;
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

        System.err.println(writer.toString());
    }
   
    public void testRequest() throws Exception {
        PostMethod method = new PostMethod("http://localhost:8194/Service/");
        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

                HttpMethodParams.USE_EXPECT_CONTINUE, false);
        this.httpclient.getHttpConnectionManager().getParams()
                .setStaleCheckingEnabled(false);
        this.httpclient.getParams().setSoTimeout(15000);

        HttpMethodRetryHandler retryhandler = new HttpMethodRetryHandler() {

            public boolean retryMethod(final HttpMethod httpmethod, final IOException ex, int count) {
                return false;
            }
View Full Code Here

  private void doPost(PostMethod method, RequestEntity data, 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

  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

  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

        MAX_TEMPLATE_SIZE_IN_BYTES = maxTemplateSizeInBytes;

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

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

        maxTemplateSizeInByte = maxTemplateSizeInBytes;

        totalBytes = 0;
        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

        HttpClientParams params = new HttpClientParams();
        params.setConnectionManagerTimeout(timeout);
        params.setSoTimeout(timeout);

        HttpClient client = new HttpClient(params, manager);
        HttpMethodRetryHandler retryHandler = new DefaultHttpMethodRetryHandler(1, true);
        client.getParams().setParameter(HttpMethodParams.RETRY_HANDLER, retryHandler);

        if (!proxyHost.isEmpty())
        {
            client.getHostConfiguration().setProxy(proxyHost, Integer.parseInt(proxyPort));
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.