Wednesday, March 4, 2009

Tiimout params for spring remoting

All properties can be set for spring remoting including connection timeout.

The HttpInvokerProxyFactoryBean takes in httpInvokerRequestExecutor as a parameter which in turn takes in httpClient(org.apache.commons.httpclient.HttpClient).

Hence all properties for HttpClient as timeout , connectiontime etc can be set.

Code snippet for injecting httpclient into the connection object(with timeout for 5 seconds)

<bean id="httpParamObject"
<property name="httpClient">
<bean class="org.apache.commons.httpclient.HttpClient">
<property name="timeout" value="5000" />

<bean id="testServer"
<property name="serviceUrl"
value="" />
<property name="serviceInterface"
value="" />
<property name="httpInvokerRequestExecutor" ref=" httpParamObject" />


No comments:

Free Domain Names @!