View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.transport.http;
8   
9   import java.io.IOException;
10  import java.net.SocketException;
11  
12  import org.apache.commons.httpclient.DefaultHttpMethodRetryHandler;
13  import org.apache.commons.httpclient.HttpMethod;
14  
15  public class MuleHttpMethodRetryHandler extends DefaultHttpMethodRetryHandler
16  {
17      @Override
18      public boolean retryMethod(final HttpMethod method, final IOException exception, int executionCount)
19      {
20          if ((executionCount < this.getRetryCount()) && (exception instanceof SocketException))
21          {
22              return true;
23          }
24          
25          return super.retryMethod(method, exception, executionCount);
26      }
27  }