}
public void init() throws HttpException, IOException {
HostConfiguration hostConfig = new HostConfiguration();
// hostConfig.setHost("www.somehost.com");
HttpConnectionManager connectionManager = new MultiThreadedHttpConnectionManager();
HttpConnectionManagerParams params = new HttpConnectionManagerParams();
int maxHostConnections = 20;
params.setMaxConnectionsPerHost(hostConfig, maxHostConnections);
connectionManager.setParams(params);
httpclient = new HttpClient(connectionManager);
Credentials creds = new UsernamePasswordCredentials(userName, password);
httpclient.getState().setCredentials(AuthScope.ANY, creds);
httpclient.setHostConfiguration(hostConfig);