[xgws-dev] CVS Update: codes/xsul/java/modules/invoker_over_http/xsul/invoker/http
Aleksander Andrzej Slominski
xgws-dev_at_extreme.indiana.edu
Sat Apr 1 18:52:01 2006
aslom 06/04/01 18:51:21
Modified: xsul/java/modules/invoker_over_http/xsul/invoker/http
HttpDynamicInfosetInvoker.java
Log:
added ability to set timeout per invocation - fixed way it is set
Revision Changes Path
1.20 +21 -3 codes/xsul/java/modules/invoker_over_http/xsul/invoker/http/HttpDynamicInfosetInvoker.java
Index: HttpDynamicInfosetInvoker.java
===================================================================
RCS file: /l/extreme/cvs/codes/xsul/java/modules/invoker_over_http/xsul/invoker/http/HttpDynamicInfosetInvoker.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -t -w -r1.19 -r1.20
--- HttpDynamicInfosetInvoker.java 20 Feb 2006 08:35:40 -0000 1.19
+++ HttpDynamicInfosetInvoker.java 1 Apr 2006 23:51:20 -0000 1.20
@@ -3,7 +3,7 @@
*
* This software is open source. See the bottom of this file for the licence.
*
- * $Id: HttpDynamicInfosetInvoker.java,v 1.19 2006/02/20 08:35:40 aslom Exp $
+ * $Id: HttpDynamicInfosetInvoker.java,v 1.20 2006/04/01 23:51:20 aslom Exp $
*/
package xsul.invoker.http;
@@ -46,7 +46,7 @@
* This class allows to send XML to HTTP endpoint.
* Simply set endpoint location and execute invoke*().
*
- * @version $Revision: 1.19 $
+ * @version $Revision: 1.20 $
* @author <a href="http://www.extreme.indiana.edu/~aslom/">Aleksander Slominski</a>
*/
public class HttpDynamicInfosetInvoker implements DynamicInfosetInvoker {
@@ -71,6 +71,8 @@
private int port;
private String requestUri;
private boolean keepAlive = DEFAULT_KA;
+ private int timeout = DEFAULT_TIMEOUT;
+
static {
String disableKaVal = null;
@@ -116,15 +118,18 @@
}
public HttpDynamicInfosetInvoker() {
connMgr = HttpClientReuseLastConnectionManager.newInstance();
+ init();
}
public HttpDynamicInfosetInvoker(ClientSocketFactory socketFactory) {
//connMgr = HttpClientConnectionManager.newInstance(socketFactory);
connMgr = HttpClientReuseLastConnectionManager.newInstance(socketFactory);
+ init();
}
public HttpDynamicInfosetInvoker(HttpClientConnectionManager connMgr) {
this.connMgr = connMgr;
+ init();
}
public HttpDynamicInfosetInvoker(String locationUrl)
@@ -134,6 +139,11 @@
setLocation(locationUrl);
}
+ private void init() {
+ keepAlive = DEFAULT_KA;
+ timeout = DEFAULT_TIMEOUT;
+ }
+
public String getLocation() {
return location;
}
@@ -168,6 +178,14 @@
}
+ public void setTimeout(int timeout) {
+ this.timeout = timeout;
+ }
+
+ public int getTimeout() {
+ return timeout;
+ }
+
public void setSoapAction(String soapAction) {
this.soapAcion = soapAction;
}
@@ -229,7 +247,7 @@
boolean secure = location.startsWith("https://");
logger.finest("host="+host+" port="+port+" secure="+secure);
- int timeout = DEFAULT_TIMEOUT;
+ timeout = DEFAULT_TIMEOUT;
HttpClientRequest req;
if(secure) {
if(secureConnMgr == null) {