You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by ol...@apache.org on 2003/05/08 20:39:08 UTC
cvs commit: jakarta-commons/httpclient/src/java/org/apache/commons/httpclient HttpClient.java HttpState.java HttpStatus.java
olegk 2003/05/08 11:39:08
Modified: httpclient/src/examples TrivialApp.java
httpclient/src/java/org/apache/commons/httpclient
HttpClient.java HttpState.java HttpStatus.java
Log:
Changelog:
- HttpConnectionManager is now a property of the HttpClient class, not of the
HttpState class
Contributed by Oleg Kalnichevski
Revision Changes Path
1.13 +4 -4 jakarta-commons/httpclient/src/examples/TrivialApp.java
Index: TrivialApp.java
===================================================================
RCS file: /home/cvs/jakarta-commons/httpclient/src/examples/TrivialApp.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- TrivialApp.java 5 May 2003 16:36:20 -0000 1.12
+++ TrivialApp.java 8 May 2003 18:39:07 -0000 1.13
@@ -114,7 +114,7 @@
//set the default credentials
if (creds != null) {
- client.getState().setCredentials(null, creds);
+ client.getState().setCredentials(null, null, creds);
}
String url = args[0];
1.75 +36 -6 jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpClient.java
Index: HttpClient.java
===================================================================
RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpClient.java,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -r1.74 -r1.75
--- HttpClient.java 3 May 2003 11:09:42 -0000 1.74
+++ HttpClient.java 8 May 2003 18:39:07 -0000 1.75
@@ -141,7 +141,7 @@
}
this.state = new HttpState();
- this.state.setHttpConnectionManager(httpConnectionManager);
+ this.httpConnectionManager = httpConnectionManager;
this.hostConfiguration = new HostConfiguration();
@@ -149,6 +149,9 @@
// ----------------------------------------------------- Instance Variables
+ /** The current connection manager */
+ private HttpConnectionManager httpConnectionManager;
+
/**
* My {@link HttpState state}.
*/
@@ -592,8 +595,13 @@
);
}
}
+
+ HttpConnectionManager connmanager = this.httpConnectionManager;
+ if (state.getHttpConnectionManager() != null) {
+ connmanager = state.getHttpConnectionManager();
+ }
- HttpConnection connection = state.getHttpConnectionManager().getConnection(
+ HttpConnection connection = connmanager.getConnection(
methodConfiguration,
httpConnectionTimeout
);
@@ -672,6 +680,28 @@
*/
public synchronized void setHostConfiguration(HostConfiguration hostConfiguration) {
this.hostConfiguration = hostConfiguration;
+ }
+
+ /**
+ * Returns the httpConnectionManager.
+ * @return HttpConnectionManager
+ *
+ * @since 2.0
+ */
+ public synchronized HttpConnectionManager getHttpConnectionManager() {
+ return httpConnectionManager;
+ }
+
+ /**
+ * Sets the httpConnectionManager.
+ * @param httpConnectionManager The httpConnectionManager to set
+ *
+ * @since 2.0
+ */
+ public synchronized void setHttpConnectionManager(
+ HttpConnectionManager httpConnectionManager
+ ) {
+ this.httpConnectionManager = httpConnectionManager;
}
}
1.22 +10 -5 jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpState.java
Index: HttpState.java
===================================================================
RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpState.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- HttpState.java 19 Apr 2003 22:29:31 -0000 1.21
+++ HttpState.java 8 May 2003 18:39:07 -0000 1.22
@@ -158,7 +158,6 @@
super();
- this.httpConnectionManager = new SimpleHttpConnectionManager();
this.cookiePolicy = CookiePolicy.getDefaultPolicy();
// check the preemptive policy
@@ -706,6 +705,9 @@
* Returns the httpConnectionManager.
* @return HttpConnectionManager
*
+ * @deprecated Connection manager is controlled by the HttpClient class.
+ * Use {@link HttpClient#getHttpConnectionManager()} instead.
+ *
* @since 2.0
*/
public synchronized HttpConnectionManager getHttpConnectionManager() {
@@ -716,6 +718,9 @@
* Sets the httpConnectionManager.
* @param httpConnectionManager The httpConnectionManager to set
*
+ * @deprecated Connection manager is controlled by the HttpClient class.
+ * Use {@link HttpClient#setHttpConnectionManager(HttpConnectionManager)} instead.
+ *
* @since 2.0
*/
public synchronized void setHttpConnectionManager(
1.14 +4 -7 jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpStatus.java
Index: HttpStatus.java
===================================================================
RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpStatus.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- HttpStatus.java 3 May 2003 05:40:31 -0000 1.13
+++ HttpStatus.java 8 May 2003 18:39:07 -0000 1.14
@@ -63,9 +63,6 @@
package org.apache.commons.httpclient;
-import java.util.Hashtable;
-
-
/**
* Constants enumerating the HTTP status codes.
* All status codes defined in RFC1945 (HTTP/1.0, RFC2616 (HTTP/1.1), and
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org