Hello David,

> In this case I would have to synchrozize this block of code
> 
> synchronized(foo) {
>    httpClient.setState(getStateForThisUser());
>    HttpMethod getMethod = new HttpMethod();
>    client.executeMethod(getMethod);
>    saveStateForThisUser(httpClient.getState())
> }

No! I suggested to pass a user-specific state object *instead*
of using the default state. Your code would replace the default
state instead of not using it.

> It seems to me I will have to synchronize until the method is complete 
and
> the state in HttpClient updated which is quite a bottleneck. Or am I 
missing
> something?

Please have a look at the JavaDocs of the HttpClient class.
There are several execute methods, and almost all of them
accept an HttpState object as an argument (iirc).

hope that helps,
  Roland

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to