You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2005/12/20 20:14:41 UTC

svn commit: r358076 - in /jakarta/httpcomponents/trunk/http-core/src/java/org/apache/http/impl: DefaultHttpClientConnection.java DefaultHttpServerConnection.java

Author: olegk
Date: Tue Dec 20 11:13:42 2005
New Revision: 358076

URL: http://svn.apache.org/viewcvs?rev=358076&view=rev
Log:
Added method to inject EntityGenerator and EntityWriter implementations

Modified:
    jakarta/httpcomponents/trunk/http-core/src/java/org/apache/http/impl/DefaultHttpClientConnection.java
    jakarta/httpcomponents/trunk/http-core/src/java/org/apache/http/impl/DefaultHttpServerConnection.java

Modified: jakarta/httpcomponents/trunk/http-core/src/java/org/apache/http/impl/DefaultHttpClientConnection.java
URL: http://svn.apache.org/viewcvs/jakarta/httpcomponents/trunk/http-core/src/java/org/apache/http/impl/DefaultHttpClientConnection.java?rev=358076&r1=358075&r2=358076&view=diff
==============================================================================
--- jakarta/httpcomponents/trunk/http-core/src/java/org/apache/http/impl/DefaultHttpClientConnection.java (original)
+++ jakarta/httpcomponents/trunk/http-core/src/java/org/apache/http/impl/DefaultHttpClientConnection.java Tue Dec 20 11:13:42 2005
@@ -107,6 +107,20 @@
         this.responsefactory = responsefactory;
     }
 
+    public void setEntityGenerator(final EntityGenerator entitygen) {
+        if (entitygen == null) {
+            throw new IllegalArgumentException("Entity generator may not be null");
+        }
+        this.entitygen = entitygen;
+    }
+
+    public void setEntityWriter(final EntityWriter entitywriter) {
+        if (entitywriter == null) {
+            throw new IllegalArgumentException("Entity writer may not be null");
+        }
+        this.entitywriter = entitywriter;
+    }
+
     public void open(final HttpParams params) throws IOException {
         if (params == null) {
             throw new IllegalArgumentException("HTTP parameters may not be null");

Modified: jakarta/httpcomponents/trunk/http-core/src/java/org/apache/http/impl/DefaultHttpServerConnection.java
URL: http://svn.apache.org/viewcvs/jakarta/httpcomponents/trunk/http-core/src/java/org/apache/http/impl/DefaultHttpServerConnection.java?rev=358076&r1=358075&r2=358076&view=diff
==============================================================================
--- jakarta/httpcomponents/trunk/http-core/src/java/org/apache/http/impl/DefaultHttpServerConnection.java (original)
+++ jakarta/httpcomponents/trunk/http-core/src/java/org/apache/http/impl/DefaultHttpServerConnection.java Tue Dec 20 11:13:42 2005
@@ -87,6 +87,20 @@
         this.requestfactory = requestfactory;
     }
 
+    public void setEntityGenerator(final EntityGenerator entitygen) {
+        if (entitygen == null) {
+            throw new IllegalArgumentException("Entity generator may not be null");
+        }
+        this.entitygen = entitygen;
+    }
+
+    public void setEntityWriter(final EntityWriter entitywriter) {
+        if (entitywriter == null) {
+            throw new IllegalArgumentException("Entity writer may not be null");
+        }
+        this.entitywriter = entitywriter;
+    }
+
     public void bind(final Socket socket, final HttpParams params) throws IOException {
         super.bind(socket, params);
     }