tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fha...@apache.org
Subject svn commit: r1357040 - in /tomcat/trunk/java/org/apache: catalina/connector/ coyote/ajp/ coyote/http11/ tomcat/util/net/
Date Wed, 04 Jul 2012 01:59:49 GMT
Author: fhanik
Date: Wed Jul  4 01:59:47 2012
New Revision: 1357040

URL: http://svn.apache.org/viewvc?rev=1357040&view=rev
Log:
rename OPEN to OPEN_READ since we have two different types of operations


Modified:
    tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
    tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java
    tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java
    tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java
    tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
    tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
    tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java
    tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java
    tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
    tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java
    tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
    tomcat/trunk/java/org/apache/tomcat/util/net/SocketStatus.java

Modified: tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java?rev=1357040&r1=1357039&r2=1357040&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java Wed Jul  4 01:59:47
2012
@@ -155,7 +155,7 @@ public class CoyoteAdapter implements Ad
         boolean error = false;
         boolean read = false;
         try {
-            if (status == SocketStatus.OPEN) {
+            if (status == SocketStatus.OPEN_READ) {
                 if (response.isClosed()) {
                     // The event has been closed asynchronously, so call end instead of
                     // read to cleanup the pipeline
@@ -219,7 +219,7 @@ public class CoyoteAdapter implements Ad
                 connector.getService().getContainer().getPipeline().getFirst().event(request,
response, request.getEvent());
             }
             if (response.isClosed() || !request.isComet()) {
-                if (status==SocketStatus.OPEN &&
+                if (status==SocketStatus.OPEN_READ &&
                         request.getEvent().getEventType() != EventType.END) {
                     //CometEvent.close was called during an event other than END
                     request.getEvent().setEventType(CometEvent.EventType.END);
@@ -302,7 +302,7 @@ public class CoyoteAdapter implements Ad
                 if (result.get()) {
                     if (status==SocketStatus.OPEN_WRITE) {
                         //TODO Notify write listener
-                    } else if (status==SocketStatus.OPEN) {
+                    } else if (status==SocketStatus.OPEN_READ) {
                         //TODO Notify read listener
                         asyncConImpl.canRead();
                     }
@@ -324,7 +324,7 @@ public class CoyoteAdapter implements Ad
                 if (!response.isClosed() && !response.isError()) {
                     if (request.getAvailable() || (request.getContentLength() > 0 &&
(!request.isParametersParsed()))) {
                         // Invoke a read event right away if there are available bytes
-                        if (event(req, res, SocketStatus.OPEN)) {
+                        if (event(req, res, SocketStatus.OPEN_READ)) {
                             comet = true;
                             res.action(ActionCode.COMET_BEGIN, null);
                         }
@@ -427,7 +427,7 @@ public class CoyoteAdapter implements Ad
                     if (!response.isClosed() && !response.isError()) {
                         if (request.getAvailable() || (request.getContentLength() > 0
&& (!request.isParametersParsed()))) {
                             // Invoke a read event right away if there are available bytes
-                            if (event(req, res, SocketStatus.OPEN)) {
+                            if (event(req, res, SocketStatus.OPEN_READ)) {
                                 comet = true;
                                 res.action(ActionCode.COMET_BEGIN, null);
                             }

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java?rev=1357040&r1=1357039&r2=1357040&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java Wed Jul  4 01:59:47 2012
@@ -261,7 +261,7 @@ public class AjpAprProcessor extends Abs
         if (actionCode == ActionCode.ASYNC_COMPLETE) {
             if (asyncStateMachine.asyncComplete()) {
                 ((AprEndpoint)endpoint).processSocketAsync(this.socket,
-                        SocketStatus.OPEN);
+                        SocketStatus.OPEN_READ);
             }
         } else if (actionCode == ActionCode.ASYNC_SETTIMEOUT) {
             if (param == null) return;
@@ -270,7 +270,7 @@ public class AjpAprProcessor extends Abs
         } else if (actionCode == ActionCode.ASYNC_DISPATCH) {
             if (asyncStateMachine.asyncDispatch()) {
                 ((AprEndpoint)endpoint).processSocketAsync(this.socket,
-                        SocketStatus.OPEN);
+                        SocketStatus.OPEN_READ);
             }
         }
     }

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java?rev=1357040&r1=1357039&r2=1357040&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java Wed Jul  4 01:59:47 2012
@@ -253,7 +253,7 @@ public class AjpNioProcessor extends Abs
         if (actionCode == ActionCode.ASYNC_COMPLETE) {
             if (asyncStateMachine.asyncComplete()) {
                 ((NioEndpoint)endpoint).processSocket(this.socket,
-                        SocketStatus.OPEN, false);
+                        SocketStatus.OPEN_READ, false);
             }
         } else if (actionCode == ActionCode.ASYNC_SETTIMEOUT) {
             if (param == null) return;
@@ -265,7 +265,7 @@ public class AjpNioProcessor extends Abs
         } else if (actionCode == ActionCode.ASYNC_DISPATCH) {
             if (asyncStateMachine.asyncDispatch()) {
                 ((NioEndpoint)endpoint).processSocket(this.socket,
-                        SocketStatus.OPEN, true);
+                        SocketStatus.OPEN_READ, true);
             }
         }
     }

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java?rev=1357040&r1=1357039&r2=1357040&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java Wed Jul  4 01:59:47 2012
@@ -271,7 +271,7 @@ public class AjpProcessor extends Abstra
         if (actionCode == ActionCode.ASYNC_COMPLETE) {
             if (asyncStateMachine.asyncComplete()) {
                 ((JIoEndpoint)endpoint).processSocketAsync(this.socket,
-                        SocketStatus.OPEN);
+                        SocketStatus.OPEN_READ);
             }
         } else if (actionCode == ActionCode.ASYNC_SETTIMEOUT) {
             if (param == null) return;
@@ -281,7 +281,7 @@ public class AjpProcessor extends Abstra
         } else if (actionCode == ActionCode.ASYNC_DISPATCH) {
             if (asyncStateMachine.asyncDispatch()) {
                 ((JIoEndpoint)endpoint).processSocketAsync(this.socket,
-                        SocketStatus.OPEN);
+                        SocketStatus.OPEN_READ);
             }
         }
     }

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java?rev=1357040&r1=1357039&r2=1357040&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java Wed Jul  4 01:59:47
2012
@@ -455,13 +455,13 @@ public class Http11AprProcessor extends 
             comet = false;
         } else if (actionCode == ActionCode.COMET_CLOSE) {
             ((AprEndpoint)endpoint).processSocketAsync(this.socket,
-                    SocketStatus.OPEN);
+                    SocketStatus.OPEN_READ);
         } else if (actionCode == ActionCode.COMET_SETTIMEOUT) {
             //no op
         } else if (actionCode == ActionCode.ASYNC_COMPLETE) {
             if (asyncStateMachine.asyncComplete()) {
                 ((AprEndpoint)endpoint).processSocketAsync(this.socket,
-                        SocketStatus.OPEN);
+                        SocketStatus.OPEN_READ);
             }
         } else if (actionCode == ActionCode.ASYNC_SETTIMEOUT) {
             if (param==null) {
@@ -472,7 +472,7 @@ public class Http11AprProcessor extends 
         } else if (actionCode == ActionCode.ASYNC_DISPATCH) {
             if (asyncStateMachine.asyncDispatch()) {
                 ((AprEndpoint)endpoint).processSocketAsync(this.socket,
-                        SocketStatus.OPEN);
+                        SocketStatus.OPEN_READ);
             }
         }
 

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java?rev=1357040&r1=1357039&r2=1357040&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java Wed Jul  4 01:59:47
2012
@@ -249,7 +249,7 @@ public class Http11AprProtocol extends A
                 SocketStatus status) {
             if (proto.npnHandler != null) {
                 Processor<Long> processor = null;
-                if (status == SocketStatus.OPEN) {
+                if (status == SocketStatus.OPEN_READ) {
                     processor = connections.get(socket.getSocket());
 
                 }

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java?rev=1357040&r1=1357039&r2=1357040&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java Wed Jul  4 01:59:47
2012
@@ -493,7 +493,7 @@ public class Http11NioProcessor extends 
         } else if (actionCode == ActionCode.ASYNC_COMPLETE) {
             if (asyncStateMachine.asyncComplete()) {
                 ((NioEndpoint)endpoint).processSocket(this.socket.getSocket(),
-                        SocketStatus.OPEN, true);
+                        SocketStatus.OPEN_READ, true);
             }
         } else if (actionCode == ActionCode.ASYNC_SETTIMEOUT) {
             if (param==null) {
@@ -509,7 +509,7 @@ public class Http11NioProcessor extends 
         } else if (actionCode == ActionCode.ASYNC_DISPATCH) {
             if (asyncStateMachine.asyncDispatch()) {
                 ((NioEndpoint)endpoint).processSocket(this.socket.getSocket(),
-                        SocketStatus.OPEN, true);
+                        SocketStatus.OPEN_READ, true);
             }
         } else if (actionCode == ActionCode.ASYNC_DISPATCH_FOR_OPERATION) {
             asyncStateMachine.asyncOperation();

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java?rev=1357040&r1=1357039&r2=1357040&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java Wed Jul  4 01:59:47 2012
@@ -353,7 +353,7 @@ public class Http11Processor extends Abs
         } else if (actionCode == ActionCode.ASYNC_COMPLETE) {
             if (asyncStateMachine.asyncComplete()) {
                 ((JIoEndpoint) endpoint).processSocketAsync(this.socket,
-                        SocketStatus.OPEN);
+                        SocketStatus.OPEN_READ);
             }
         } else if (actionCode == ActionCode.ASYNC_SETTIMEOUT) {
             if (param == null) return;
@@ -363,7 +363,7 @@ public class Http11Processor extends Abs
         } else if (actionCode == ActionCode.ASYNC_DISPATCH) {
             if (asyncStateMachine.asyncDispatch()) {
                 ((JIoEndpoint) endpoint).processSocketAsync(this.socket,
-                        SocketStatus.OPEN);
+                        SocketStatus.OPEN_READ);
             }
         }
     }

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java?rev=1357040&r1=1357039&r2=1357040&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java Wed Jul  4 01:59:47 2012
@@ -1293,7 +1293,7 @@ public class AprEndpoint extends Abstrac
                     // Check for failed sockets and hand this socket off to a worker
                     if (((desc[n*2] & Poll.APR_POLLHUP) == Poll.APR_POLLHUP)
                             || ((desc[n*2] & Poll.APR_POLLERR) == Poll.APR_POLLERR)
-                            || (comet && (!processSocket(desc[n*2+1], SocketStatus.OPEN)))
+                            || (comet && (!processSocket(desc[n*2+1], SocketStatus.OPEN_READ)))
                             || (!comet && (!processSocket(desc[n*2+1])))) {
                         // Close socket and clear pool
                         if (comet) {
@@ -1733,7 +1733,7 @@ public class AprEndpoint extends Abstrac
                     }
                     // Process the request from this socket
                     Handler.SocketState state = handler.process(socket,
-                            SocketStatus.OPEN);
+                            SocketStatus.OPEN_READ);
                     if (state == Handler.SocketState.CLOSED) {
                         // Close socket and pool
                         destroySocket(socket.getSocket().longValue());
@@ -1774,7 +1774,7 @@ public class AprEndpoint extends Abstrac
                 // Process the request from this socket
                 SocketState state = SocketState.OPEN;
                 if (status == null) {
-                    state = handler.process(socket,SocketStatus.OPEN);
+                    state = handler.process(socket,SocketStatus.OPEN_READ);
                 } else {
                     state = handler.process(socket, status);
                 }
@@ -1789,7 +1789,7 @@ public class AprEndpoint extends Abstrac
                     }
                 } else if (state == Handler.SocketState.ASYNC_END) {
                     socket.access();
-                    SocketProcessor proc = new SocketProcessor(socket, SocketStatus.OPEN);
+                    SocketProcessor proc = new SocketProcessor(socket, SocketStatus.OPEN_READ);
                     getExecutor().execute(proc);
                 }
             }

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java?rev=1357040&r1=1357039&r2=1357040&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java Wed Jul  4 01:59:47 2012
@@ -308,7 +308,7 @@ public class JIoEndpoint extends Abstrac
 
                     if ((state != SocketState.CLOSED)) {
                         if (status == null) {
-                            state = handler.process(socket, SocketStatus.OPEN);
+                            state = handler.process(socket, SocketStatus.OPEN_READ);
                         } else {
                             state = handler.process(socket,status);
                         }
@@ -337,7 +337,7 @@ public class JIoEndpoint extends Abstrac
                 } finally {
                     if (launch) {
                         try {
-                            getExecutor().execute(new SocketProcessor(socket, SocketStatus.OPEN));
+                            getExecutor().execute(new SocketProcessor(socket, SocketStatus.OPEN_READ));
                         } catch (RejectedExecutionException x) {
                             log.warn("Socket reprocessing request was rejected for:"+socket,x);
                             try {

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java?rev=1357040&r1=1357039&r2=1357040&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java Wed Jul  4 01:59:47 2012
@@ -1240,7 +1240,7 @@ public class NioEndpoint extends Abstrac
                                 //read goes before write
                                 if (sk.isReadable()) {
                                     //read notification
-                                    if (!processSocket(channel, SocketStatus.OPEN, true))
+                                    if (!processSocket(channel, SocketStatus.OPEN_READ, true))
                                         processSocket(channel, SocketStatus.DISCONNECT, true);
                                 } else {
                                     //future placement of a WRITE notif
@@ -1263,7 +1263,7 @@ public class NioEndpoint extends Abstrac
                                 //read goes before write
                                 if (sk.isReadable()) {
                                     //read notification
-                                    if (!processSocket(channel, SocketStatus.OPEN, true))
+                                    if (!processSocket(channel, SocketStatus.OPEN_READ, true))
                                         close = true;
                                 } else {
                                     //future placement of a WRITE notif
@@ -1425,7 +1425,7 @@ public class NioEndpoint extends Abstrac
                         ka.setCometNotify(false);
                         reg(key,ka,0);//avoid multiple calls, this gets reregistered after
invocation
                         //if (!processSocket(ka.getChannel(), SocketStatus.OPEN_CALLBACK))
processSocket(ka.getChannel(), SocketStatus.DISCONNECT);
-                        if (!processSocket(ka.getChannel(), SocketStatus.OPEN, true)) processSocket(ka.getChannel(),
SocketStatus.DISCONNECT, true);
+                        if (!processSocket(ka.getChannel(), SocketStatus.OPEN_READ, true))
processSocket(ka.getChannel(), SocketStatus.DISCONNECT, true);
                     } else if ((ka.interestOps()&SelectionKey.OP_READ) == SelectionKey.OP_READ
||
                               (ka.interestOps()&SelectionKey.OP_WRITE) == SelectionKey.OP_WRITE)
{
                         //only timeout sockets that we are waiting for a read from
@@ -1661,7 +1661,7 @@ public class NioEndpoint extends Abstrac
                         if (status == null) {
                             state = handler.process(
                                     (KeyAttachment) key.attachment(),
-                                    SocketStatus.OPEN);
+                                    SocketStatus.OPEN_READ);
                         } else {
                             state = handler.process(
                                     (KeyAttachment) key.attachment(),
@@ -1722,7 +1722,7 @@ public class NioEndpoint extends Abstrac
                 } finally {
                     if (launch) {
                         try {
-                            getExecutor().execute(new SocketProcessor(socket, SocketStatus.OPEN));
+                            getExecutor().execute(new SocketProcessor(socket, SocketStatus.OPEN_READ));
                         } catch (NullPointerException npe) {
                             if (running) {
                                 log.error(sm.getString("endpoint.launch.fail"),

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/SocketStatus.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/SocketStatus.java?rev=1357040&r1=1357039&r2=1357040&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/SocketStatus.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/SocketStatus.java Wed Jul  4 01:59:47 2012
@@ -23,5 +23,5 @@ package org.apache.tomcat.util.net;
  * @author remm
  */
 public enum SocketStatus {
-    OPEN, OPEN_WRITE, STOP, TIMEOUT, DISCONNECT, ERROR
+    OPEN_READ, OPEN_WRITE, STOP, TIMEOUT, DISCONNECT, ERROR
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message