Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
import uk.co.techblue.docusign.resteasy.providers.DocumentFileProvider;
/**
* The HTTP client can be configured adding in the classpath the following properties file:
* uk.co.techblue.docusign.client.DocuSignClient.properties
* DocuSignClient.properties
* The configuration allows to set the timeout and the maximum number of connections per route:
* docusign.connection.timeout=20000
* docusign.max.per.route=50
Expand All @@ -57,12 +57,7 @@
public class DocuSignClient {
public static void main(String[] args) throws ClientProtocolException,
IOException {
ThreadSafeClientConnManager cm = new ThreadSafeClientConnManager();
int maxPerRoute = 50;
cm.setDefaultMaxPerRoute(maxPerRoute);
cm.setMaxTotal(maxPerRoute);

HttpClient client = new DefaultHttpClient(cm);
HttpClient client = getHttpClient();
HttpParams params = client.getParams();
// Allowable time between packets
HttpConnectionParams.setSoTimeout(params, 6000);
Expand Down Expand Up @@ -154,11 +149,12 @@ private static class HttpClientConfiguration {
private ResourceBundle docusignClientBundle = null;
private HttpClientConfiguration () {
try {
docusignClientBundle = ResourceBundle.getBundle(DocuSignClient.class.getCanonicalName());
docusignClientBundle = ResourceBundle.getBundle(DocuSignClient.class.getSimpleName());
}
catch(MissingResourceException mre) {
/* Ignore */
/* Ignore */
}

}

private String getString(String key, String defaultValue) {
Expand Down Expand Up @@ -230,7 +226,6 @@ private static HttpClient getHttpClient() {

int timeout = httpClientConfiguration.getTimeout();
String proxyHost = httpClientConfiguration.getProxyHost();

HttpParams params = client.getParams();
// Allowable time between packets
HttpConnectionParams.setSoTimeout(params, timeout);
Expand Down