You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@ws.apache.org by Jimisola Laursen <li...@jimisola.com> on 2005/10/17 06:42:18 UTC

Re: HttpClient - usage etc

Hi!

I made the post below almost a month ago. I can still make use of any 
information since I haven't had time to look into it myself yet.

Regards,
Jimisola

----- Original Message ----- 
From: "Jimisola Laursen" <li...@jimisola.com>
To: <xm...@ws.apache.org>
Sent: Saturday, September 24, 2005 5:13 PM
Subject: HttpClient - usage etc


> Hi!
>
> I have server-client solution where we have problem with timeouts. Under 1.4 
> you
> have to use properties to set read and/connection timeout for the whole 
> program.
> So, I was delighted to see that HttpClient is available in XMLRPC-2.0 as
> timeouts can be set directly on the HttpClient.
>
> However, I spend some time last night trying to figure out 1) how to actually
> use it and 2) how to set timeouts.
>
> Is there no factory class to use with XmlRpcClient constructor for use of 
> HttpClient. The
> DefaultXmlRpcTransportFactory seems to be more than just a plain factory class
> as I in createTransportFactory noticed the Reflection construction call to a
> constructor with signature  java.util.Properties properties
> (CONSTRUCTOR_SIGNATURE_STRING).
>
> So, my questions are:
>
> 1) How do use Commons HttpClient and also set additional properties? Do I need
> to create a new factory class or extend DefaultXmlRpcTransportFactory and then
> adjust it after my needs? Or can I use DefaultXmlRpcTransportFactory as is - 
> in
> some way that I haven't been able to figure out yet? (might be interesting 
> with
> an example on the web site)
>
> 2) It says that "Note: Currently this transport is not thread safe": 
> http://ws.apache.org/xmlrpc/apidocs/index.html
> What exactly does this mean? To refer to item 52 in Effective Java, is it:
>
> - conditionally thread-safe: thread-safe in methods are called in right 
> sequence
> - thread-compatible: thread-safe if all methods have external synchronization 
> (e.g. Collection classes)
> - thread-hostile: not thread-safe even if all methods have external 
> synchronization
>
> Read on that " HttpClient is fully thread-safe when used with a thread-safe 
> connection manager such as MultiThreadedHttpConnectionManager " (more info on 
> http://jakarta.apache.org/commons/httpclient/threading.html).
> I am not very familiar with HttpClient, so bear with my questions. Does this 
> thread-safety only apply for HttpClient 3.0 (which seems to be close now)?
>
> Kind regards,
> Jimisola
>
>
> 



Re: HttpClient - usage etc

Posted by Jimisola Laursen <li...@jimisola.com>.
Noteworthy, there is no information on http-client on 
http://ws.apache.org/xmlrpc/client.html

Regards,
Jimisola

----- Original Message ----- 
From: "Jimisola Laursen" <li...@jimisola.com>
To: <xm...@ws.apache.org>
Sent: Monday, October 17, 2005 6:42 AM
Subject: Re: HttpClient - usage etc


> Hi!
>
> I made the post below almost a month ago. I can still make use of any 
> information since I haven't had time to look into it myself yet.
>
> Regards,
> Jimisola
>
> ----- Original Message ----- 
> From: "Jimisola Laursen" <li...@jimisola.com>
> To: <xm...@ws.apache.org>
> Sent: Saturday, September 24, 2005 5:13 PM
> Subject: HttpClient - usage etc
>
>
>> Hi!
>>
>> I have server-client solution where we have problem with timeouts. Under 1.4 
>> you
>> have to use properties to set read and/connection timeout for the whole 
>> program.
>> So, I was delighted to see that HttpClient is available in XMLRPC-2.0 as
>> timeouts can be set directly on the HttpClient.
>>
>> However, I spend some time last night trying to figure out 1) how to actually
>> use it and 2) how to set timeouts.
>>
>> Is there no factory class to use with XmlRpcClient constructor for use of 
>> HttpClient. The
>> DefaultXmlRpcTransportFactory seems to be more than just a plain factory 
>> class
>> as I in createTransportFactory noticed the Reflection construction call to a
>> constructor with signature  java.util.Properties properties
>> (CONSTRUCTOR_SIGNATURE_STRING).
>>
>> So, my questions are:
>>
>> 1) How do use Commons HttpClient and also set additional properties? Do I 
>> need
>> to create a new factory class or extend DefaultXmlRpcTransportFactory and 
>> then
>> adjust it after my needs? Or can I use DefaultXmlRpcTransportFactory as is - 
>> in
>> some way that I haven't been able to figure out yet? (might be interesting 
>> with
>> an example on the web site)
>>
>> 2) It says that "Note: Currently this transport is not thread safe": 
>> http://ws.apache.org/xmlrpc/apidocs/index.html
>> What exactly does this mean? To refer to item 52 in Effective Java, is it:
>>
>> - conditionally thread-safe: thread-safe in methods are called in right 
>> sequence
>> - thread-compatible: thread-safe if all methods have external synchronization 
>> (e.g. Collection classes)
>> - thread-hostile: not thread-safe even if all methods have external 
>> synchronization
>>
>> Read on that " HttpClient is fully thread-safe when used with a thread-safe 
>> connection manager such as MultiThreadedHttpConnectionManager " (more info on 
>> http://jakarta.apache.org/commons/httpclient/threading.html).
>> I am not very familiar with HttpClient, so bear with my questions. Does this 
>> thread-safety only apply for HttpClient 3.0 (which seems to be close now)?
>>
>> Kind regards,
>> Jimisola
>>
>>
>>
>
>
>