What is issue that might arise by keeping the HttpClient instance static in
a Utility class.
Before I use the static instance of the httpClient I make the check and
initialize it.
Please let me know if there is a better way to implement this?
//Initialize the HttpClient & enable Concurrent execution of
HTTPmethods
if(httpClient==null) {
MultiThreadedHttpConnectionManager connectionManager =
new MultiThreadedHttpConnectionManager();
httpClient = new HttpClient(connectionManager);
/*Set the proxy*/
if (proxy != null) {
httpClient.getHostConfiguration().setProxy(proxy,
proxyPort);
}
}
Thanks & Regards,
Vasanth.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]