connectionManager = new ThreadSafeClientConnManager(new BasicHttpParams(), schemeRegistry);
HttpParams httpParams = new BasicHttpParams();
httpParams.setParameter("http.default-host", new HttpHost("localhost", port));
DefaultHttpClient httpClient = new DefaultHttpClient(connectionManager, httpParams);
httpClient.setHttpRequestRetryHandler(new NoRetryHandler());
return new ApacheClient(httpClient, "", targetId);
}