tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1360615 - in /tomcat/trunk/java/org/apache/coyote/http11: AbstractHttp11JsseProtocol.java AbstractHttp11Protocol.java Http11AprProtocol.java Http11NioProtocol.java Http11Protocol.java NpnHandler.java
Date Thu, 12 Jul 2012 10:18:20 GMT
Author: markt
Date: Thu Jul 12 10:18:20 2012
New Revision: 1360615

URL: http://svn.apache.org/viewvc?rev=1360615&view=rev
Log:
Fix more warnings
 - More generics for npn
 - Use final where appropriate

Modified:
    tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11JsseProtocol.java
    tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
    tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
    tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java
    tomcat/trunk/java/org/apache/coyote/http11/Http11Protocol.java
    tomcat/trunk/java/org/apache/coyote/http11/NpnHandler.java

Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11JsseProtocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11JsseProtocol.java?rev=1360615&r1=1360614&r2=1360615&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11JsseProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11JsseProtocol.java Thu Jul 12
10:18:20 2012
@@ -18,8 +18,8 @@ package org.apache.coyote.http11;
 
 import org.apache.tomcat.util.net.SSLImplementation;
 
-public abstract class AbstractHttp11JsseProtocol
-        extends AbstractHttp11Protocol {
+public abstract class AbstractHttp11JsseProtocol<S>
+        extends AbstractHttp11Protocol<S> {
 
     protected SSLImplementation sslImplementation = null;
 

Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Protocol.java?rev=1360615&r1=1360614&r2=1360615&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Protocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Protocol.java Thu Jul 12 10:18:20
2012
@@ -18,16 +18,8 @@ package org.apache.coyote.http11;
 
 
 import org.apache.coyote.AbstractProtocol;
-import org.apache.tomcat.util.res.StringManager;
-
-public abstract class AbstractHttp11Protocol extends AbstractProtocol {
-
-    /**
-     * The string manager for this package.
-     */
-    protected static final StringManager sm =
-        StringManager.getManager(Constants.Package);
 
+public abstract class AbstractHttp11Protocol<S> extends AbstractProtocol {
 
     @Override
     protected String getProtocolName() {
@@ -184,11 +176,12 @@ public abstract class AbstractHttp11Prot
         endpoint.setMaxKeepAliveRequests(mkar);
     }
 
-    protected NpnHandler npnHandler;
+    protected NpnHandler<S> npnHandler;
+    @SuppressWarnings("unchecked")
     public void setNpnHandler(String impl) {
         try {
             Class<?> c = Class.forName(impl);
-            npnHandler = (NpnHandler) c.newInstance();
+            npnHandler = (NpnHandler<S>) c.newInstance();
         } catch (Exception ex) {
             getLog().warn("Failed to init light protocol " + impl, ex);
         }

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=1360615&r1=1360614&r2=1360615&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java Thu Jul 12 10:18:20
2012
@@ -39,7 +39,7 @@ import org.apache.tomcat.util.net.Socket
  * @author Remy Maucherat
  * @author Costin Manolache
  */
-public class Http11AprProtocol extends AbstractHttp11Protocol {
+public class Http11AprProtocol extends AbstractHttp11Protocol<Long> {
 
     private static final Log log = LogFactory.getLog(Http11AprProtocol.class);
 

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java?rev=1360615&r1=1360614&r2=1360615&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java Thu Jul 12 10:18:20
2012
@@ -47,7 +47,7 @@ import org.apache.tomcat.util.net.Socket
  * @author Costin Manolache
  * @author Filip Hanik
  */
-public class Http11NioProtocol extends AbstractHttp11JsseProtocol {
+public class Http11NioProtocol extends AbstractHttp11JsseProtocol<NioChannel> {
 
     private static final Log log = LogFactory.getLog(Http11NioProtocol.class);
 
@@ -86,7 +86,7 @@ public class Http11NioProtocol extends A
 
     // -------------------- Properties--------------------
 
-    private Http11ConnectionHandler cHandler;
+    private final Http11ConnectionHandler cHandler;
 
     // -------------------- Pool setup --------------------
 

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11Protocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11Protocol.java?rev=1360615&r1=1360614&r2=1360615&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11Protocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11Protocol.java Thu Jul 12 10:18:20 2012
@@ -40,7 +40,7 @@ import org.apache.tomcat.util.net.Socket
  * @author Remy Maucherat
  * @author Costin Manolache
  */
-public class Http11Protocol extends AbstractHttp11JsseProtocol {
+public class Http11Protocol extends AbstractHttp11JsseProtocol<Socket> {
 
 
     private static final org.apache.juli.logging.Log log
@@ -71,7 +71,7 @@ public class Http11Protocol extends Abst
 
     // ----------------------------------------------------------------- Fields
 
-    protected Http11ConnectionHandler cHandler;
+    private final Http11ConnectionHandler cHandler;
 
 
     // ------------------------------------------------ HTTP specific properties

Modified: tomcat/trunk/java/org/apache/coyote/http11/NpnHandler.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/NpnHandler.java?rev=1360615&r1=1360614&r2=1360615&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/NpnHandler.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/NpnHandler.java Thu Jul 12 10:18:20 2012
@@ -27,7 +27,7 @@ import org.apache.tomcat.util.net.Socket
  * Interface specific for protocols that negotiate at NPN level, like
  * SPDY. This is only available for APR, will replace the HTTP framing.
  */
-public interface NpnHandler<T> {
+public interface NpnHandler<S> {
 
     /**
      * Check if the socket has negotiated the right NPN and process it.
@@ -37,7 +37,7 @@ public interface NpnHandler<T> {
      * @return OPEN if the socket doesn't have the right npn.
      *    CLOSE if processing is done. LONG to request read polling.
      */
-    SocketState process(SocketWrapper<T> socket, SocketStatus status);
+    SocketState process(SocketWrapper<S> socket, SocketStatus status);
 
     /**
      * Initialize the npn handler.



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


Mime
View raw message