On Fri, 2006-10-20 at 11:16 -0500, [EMAIL PROTECTED] wrote:
> What is issue that might arise by keeping the HttpClient instance static in
> a Utility class.
>
Vasanth,
I apologize for such a latest response. Users are very much encouraged
to re-use HttpClient instance(s), so I see nothing wrong in keeping a
static instance in a utility class.
Oleg
> 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]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]