hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r280137 - in /jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote: ./ impl/
Date Sun, 11 Sep 2005 13:48:52 GMT
Author: olegk
Date: Sun Sep 11 06:48:44 2005
New Revision: 280137

URL: http://svn.apache.org/viewcvs?rev=280137&view=rev
Log:
No longer makes any use of NIO

Added:
    jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/impl/DefaultConnectionListener.java
      - copied, changed from r234116, jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/impl/OldIOConnectionListener.java
Removed:
    jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/ConnectionListenerFactory.java
    jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/impl/CoyoteHttpDataReceiverFactory.java
    jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/impl/CoyoteHttpDataTransmitterFactory.java
    jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/impl/DefaultConnectionListenerFactory.java
    jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/impl/NIOConnectionListener.java
    jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/impl/OldIOConnectionListener.java
Modified:
    jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/HttpProtocolHandler.java
    jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/impl/CoyoteHttpConnection.java

Modified: jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/HttpProtocolHandler.java
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/HttpProtocolHandler.java?rev=280137&r1=280136&r2=280137&view=diff
==============================================================================
--- jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/HttpProtocolHandler.java
(original)
+++ jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/HttpProtocolHandler.java
Sun Sep 11 06:48:44 2005
@@ -39,7 +39,7 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.coyote.Adapter;
 import org.apache.coyote.ProtocolHandler;
-import org.apache.http.coyote.impl.DefaultConnectionListenerFactory;
+import org.apache.http.coyote.impl.DefaultConnectionListener;
 import org.apache.http.coyote.impl.DefaultHttpConnectionFactory;
 import org.apache.http.coyote.impl.DefaultHttpConnectionManager;
 import org.apache.http.coyote.impl.DefaultThreadFactory;
@@ -68,7 +68,6 @@
 	private Adapter adapter = null;
 	private int minThreads = 25;
 	private int maxThreads = 150;
-	private boolean useNIO;
     
 	private IOProcessor listener = null;
 	private ExecutorService listenerExecutor = null;
@@ -135,31 +134,7 @@
         HttpConnectionParams.setTcpNoDelay(this.params, b);
     }
 
-	public String getMode() {
-		if (this.useNIO) {
-			return "NIO";
-		} else {
-			return "OldIO";
-		}
-	}
-
-	public void setMode(final String mode) {
-		if ("NIO".equalsIgnoreCase(mode)) {
-			this.useNIO = true;
-		} else if ("ClassicIO".equalsIgnoreCase(mode)) {
-			this.useNIO = false;
-		} else {
-			if (LOG.isWarnEnabled()) {
-				LOG.warn("Illegal mode: " + mode);
-			}
-		}
-	}
-    
 	public void init() throws Exception {
-		if (this.useNIO) {
-            this.params.setParameter(HttpConnectionParams.SO_TIMEOUT, null);
-		}
-		
 		this.conntg = new ThreadGroup("Connection thread group");
 		
         this.requestExecutor = new ThreadPoolExecutor(
@@ -181,13 +156,10 @@
                 new LinkedBlockingQueue<Runnable>(),
                 new DefaultThreadFactory(this.listenertg, "HttpListener-" + getPort()));
         
-        ConnectionListenerFactory listenerfactory = new DefaultConnectionListenerFactory(
-        		this.useNIO);
-        
         HttpConnectionFactory connfactory = new DefaultHttpConnectionFactory(
         		this.params);
         
-        this.listener = listenerfactory.newConnectionListener(
+        this.listener = new DefaultConnectionListener(
         		CoyoteParams.getPort(this.params),
         		connfactory, 
                 this.connmanager);

Modified: jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/impl/CoyoteHttpConnection.java
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/impl/CoyoteHttpConnection.java?rev=280137&r1=280136&r2=280137&view=diff
==============================================================================
--- jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/impl/CoyoteHttpConnection.java
(original)
+++ jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/impl/CoyoteHttpConnection.java
Sun Sep 11 06:48:44 2005
@@ -35,6 +35,8 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.http.impl.DefaultHttpServerConnection;
+import org.apache.http.impl.io.DefaultHttpDataReceiverFactory;
+import org.apache.http.impl.io.DefaultHttpDataTransmitterFactory;
 import org.apache.http.params.HttpParams;
 
 /**
@@ -54,8 +56,8 @@
     public CoyoteHttpConnection() {
         super();
         this.name = "No Connection"; 
-        setReceiverFactory(new CoyoteHttpDataReceiverFactory());
-        setTransmitterFactory(new CoyoteHttpDataTransmitterFactory());
+        setReceiverFactory(new DefaultHttpDataReceiverFactory());
+        setTransmitterFactory(new DefaultHttpDataTransmitterFactory());
     }
 
     @Override

Copied: jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/impl/DefaultConnectionListener.java
(from r234116, jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/impl/OldIOConnectionListener.java)
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/impl/DefaultConnectionListener.java?p2=jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/impl/DefaultConnectionListener.java&p1=jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/impl/OldIOConnectionListener.java&r1=234116&r2=280137&rev=280137&view=diff
==============================================================================
--- jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/impl/OldIOConnectionListener.java
(original)
+++ jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/impl/DefaultConnectionListener.java
Sun Sep 11 06:48:44 2005
@@ -47,9 +47,9 @@
  *
  * @version $Revision$
  */
-public class OldIOConnectionListener implements IOProcessor {
+public class DefaultConnectionListener implements IOProcessor {
 
-    private static Log LOG = LogFactory.getLog(OldIOConnectionListener.class);
+    private static Log LOG = LogFactory.getLog(DefaultConnectionListener.class);
 	
     private volatile boolean destroyed = false;
     
@@ -57,7 +57,7 @@
     private final HttpConnectionManager connmanager;
     private final ServerSocket serversocket;
         
-    public OldIOConnectionListener(
+    public DefaultConnectionListener(
     		int port,
             final HttpConnectionFactory connfactory,
             final HttpConnectionManager connmanager) throws IOException {



Mime
View raw message