Set the default backoff strategy
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1406223 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
dea1131853
commit
3cc8ffe81e
1 changed files with 5 additions and 0 deletions
|
@ -31,6 +31,7 @@ import org.apache.http.conn.ssl.SSLInitializationException;
|
|||
import org.apache.http.conn.ssl.SSLSocketFactory;
|
||||
import org.apache.http.impl.NoConnectionReuseStrategy;
|
||||
import org.apache.http.impl.client.DefaultHttpClient;
|
||||
import org.apache.http.impl.client.DefaultBackoffStrategy;
|
||||
import org.apache.http.impl.conn.PoolingClientConnectionManager;
|
||||
import org.apache.http.impl.conn.SchemeRegistryFactory;
|
||||
import org.apache.http.params.BasicHttpParams;
|
||||
|
@ -129,6 +130,10 @@ public class HttpClientFactory implements LifeCycleListener {
|
|||
connectionManager.setMaxTotal(maxTotal);
|
||||
|
||||
DefaultHttpClient client = new DefaultHttpClient(connectionManager, defaultParameters);
|
||||
|
||||
// Set the default connection backoff
|
||||
client.setConnectionBackoffStrategy(new DefaultBackoffStrategy());
|
||||
|
||||
if (timeToLive <= 0) {
|
||||
client.setReuseStrategy(new NoConnectionReuseStrategy());
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue