Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 414 | espaco | 1 | package br.com.swconsultoria.nfe.ws; |
| 2 | |||
| 3 | import org.apache.axis2.client.Stub; |
||
| 4 | import org.apache.axis2.transport.http.HTTPConstants; |
||
| 5 | import org.apache.commons.httpclient.DefaultHttpMethodRetryHandler; |
||
| 6 | import org.apache.commons.httpclient.params.HttpMethodParams; |
||
| 7 | |||
| 8 | /** |
||
| 9 | * |
||
| 10 | * @author Leonardo Wiest |
||
| 11 | * |
||
| 12 | */ |
||
| 13 | public class RetryParameter { |
||
| 14 | |||
| 15 | private RetryParameter() { |
||
| 16 | |||
| 17 | } |
||
| 18 | |||
| 19 | /** |
||
| 20 | * |
||
| 21 | * @param stub |
||
| 22 | * Client connection |
||
| 23 | * @param retry |
||
| 24 | * Connection retry |
||
| 25 | */ |
||
| 26 | public static void populateRetry(Stub stub, Integer retry) { |
||
| 27 | |||
| 28 | HttpMethodParams methodParams = new HttpMethodParams(); |
||
| 29 | |||
| 30 | methodParams.setParameter(HttpMethodParams.RETRY_HANDLER, new DefaultHttpMethodRetryHandler(retry, retry != 0)); |
||
| 31 | |||
| 32 | stub._getServiceClient().getOptions().setProperty(HTTPConstants.HTTP_METHOD_PARAMS, methodParams); |
||
| 33 | |||
| 34 | } |
||
| 35 | |||
| 36 | } |