That certainly does. Thanks Roland. Appreciate it.
So, is it safe to assume that one HttpClient instance can be reused for all
clients for all remote services (using the following method):
public int executeMethod(HostConfiguration hostconfig,
HttpMethod method,
HttpState state)
throws IOException,
HttpException
-----Original Message-----
From: Roland Weber [mailto:[EMAIL PROTECTED]
Sent: Saturday, June 10, 2006 1:26 AM
To: HttpClient User Discussion
Subject: Re: Concurrency question
Hello Sidd,
> Since the connection needs to be conversational, we need to maintain
> cookies. I noticed the class that wraps this is HttpState.
> HttpClient wraps this class.
HttpClient wraps only the default HttpState object, for those that
don't need to maintain separate states.
> So I declared HttpClient as static to reuse it for all requests to all
> remote services. And I passed it the MultiThreadedHttpConnectionManager
for
> handling concurrent requests. But I cannot figure out how to set HttpState
> in a thread-safe manner.
The trick is to choose the appropriate executeRequest(...) method.
This one will use the HttpState you pass as the third argument:
http://jakarta.apache.org/commons/httpclient/apidocs/org/apache/commons/http
client/HttpClient.html#executeMethod(org.apache.commons.httpclient.HostConfi
guration,%20org.apache.commons.httpclient.HttpMethod,%20org.apache.commons.h
ttpclient.HttpState)
hope that helps,
Roland
---------------------------------------------------------------------
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]