tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1746495 - in /tomcat/trunk/java/org/apache/tomcat/util/net: AbstractEndpoint.java AprEndpoint.java Nio2Endpoint.java NioEndpoint.java
Date Wed, 01 Jun 2016 21:06:44 GMT
Author: markt
Date: Wed Jun  1 21:06:43 2016
New Revision: 1746495

URL: http://svn.apache.org/viewvc?rev=1746495&view=rev
Log:
Add a boolean return to the abstract processSocket() method facilitate the merging of the
two processSocket() methods in each of the end points.

Modified:
    tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java
    tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
    tomcat/trunk/java/org/apache/tomcat/util/net/Nio2Endpoint.java
    tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java?rev=1746495&r1=1746494&r2=1746495&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java Wed Jun  1 21:06:43
2016
@@ -774,8 +774,10 @@ public abstract class AbstractEndpoint<S
      * @param socketStatus  The input status to the processing
      * @param dispatch      Should the processing be performed on a new
      *                          container thread
+     *
+     * @return if processing was triggered successfully
      */
-    public abstract void processSocket(SocketWrapperBase<S> socketWrapper,
+    public abstract boolean processSocket(SocketWrapperBase<S> socketWrapper,
             SocketEvent socketStatus, boolean dispatch);
 
 

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=1746495&r1=1746494&r2=1746495&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java Wed Jun  1 21:06:43 2016
@@ -833,7 +833,7 @@ public class AprEndpoint extends Abstrac
 
 
     @Override
-    public void processSocket(SocketWrapperBase<Long> socket, SocketEvent status,
+    public boolean processSocket(SocketWrapperBase<Long> socket, SocketEvent status,
             boolean dispatch) {
         try {
             // Synchronisation is required here as this code may be called as a
@@ -850,12 +850,15 @@ public class AprEndpoint extends Abstrac
             }
         } catch (RejectedExecutionException ree) {
             log.warn(sm.getString("endpoint.executor.fail", socket) , ree);
+            return false;
         } catch (Throwable t) {
             ExceptionUtils.handleThrowable(t);
             // This means we got an OOM or similar creating a thread, or that
             // the pool and its queue are full
             log.error(sm.getString("endpoint.process.fail"), t);
+            return false;
         }
+        return true;
     }
 
     private void closeSocket(long socket) {

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/Nio2Endpoint.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/Nio2Endpoint.java?rev=1746495&r1=1746494&r2=1746495&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/Nio2Endpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/Nio2Endpoint.java Wed Jun  1 21:06:43 2016
@@ -377,9 +377,9 @@ public class Nio2Endpoint extends Abstra
     }
 
     @Override
-    public void processSocket(SocketWrapperBase<Nio2Channel> socketWrapper,
+    public boolean  processSocket(SocketWrapperBase<Nio2Channel> socketWrapper,
             SocketEvent socketStatus, boolean dispatch) {
-        processSocket0(socketWrapper, socketStatus, dispatch);
+        return processSocket0(socketWrapper, socketStatus, dispatch);
     }
 
     protected boolean processSocket0(SocketWrapperBase<Nio2Channel> socketWrapper,
SocketEvent status, boolean dispatch) {

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=1746495&r1=1746494&r2=1746495&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java Wed Jun  1 21:06:43 2016
@@ -434,9 +434,9 @@ public class NioEndpoint extends Abstrac
 
 
     @Override
-    public void processSocket(SocketWrapperBase<NioChannel> socketWrapper,
+    public boolean processSocket(SocketWrapperBase<NioChannel> socketWrapper,
             SocketEvent event, boolean dispatch) {
-        processSocket((NioSocketWrapper) socketWrapper, event, dispatch);
+        return processSocket((NioSocketWrapper) socketWrapper, event, dispatch);
     }
 
     protected boolean processSocket(NioSocketWrapper socketWrapper, SocketEvent event, boolean
dispatch) {



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


Mime
View raw message