tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1383935 - in /tomcat/trunk/java/org/apache: coyote/spdy/ tomcat/jni/socket/ tomcat/spdy/ tomcat/util/modeler/ tomcat/util/modeler/modules/
Date Wed, 12 Sep 2012 13:41:34 GMT
Author: markt
Date: Wed Sep 12 13:41:33 2012
New Revision: 1383935

URL: http://svn.apache.org/viewvc?rev=1383935&view=rev
Log:
Clean-up: Remove unused code

Modified:
    tomcat/trunk/java/org/apache/coyote/spdy/SpdyProcessor.java
    tomcat/trunk/java/org/apache/tomcat/jni/socket/AprSocketContext.java
    tomcat/trunk/java/org/apache/tomcat/spdy/SpdyConnection.java
    tomcat/trunk/java/org/apache/tomcat/spdy/SpdyContext.java
    tomcat/trunk/java/org/apache/tomcat/spdy/SpdyStream.java
    tomcat/trunk/java/org/apache/tomcat/util/modeler/Registry.java
    tomcat/trunk/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsDigesterSource.java
    tomcat/trunk/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java
    tomcat/trunk/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsSerSource.java
    tomcat/trunk/java/org/apache/tomcat/util/modeler/modules/ModelerSource.java

Modified: tomcat/trunk/java/org/apache/coyote/spdy/SpdyProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/spdy/SpdyProcessor.java?rev=1383935&r1=1383934&r2=1383935&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/spdy/SpdyProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/spdy/SpdyProcessor.java Wed Sep 12 13:41:33 2012
@@ -107,7 +107,6 @@ public class SpdyProcessor extends Abstr
                     bchunk.getStart(), rd);
             inFrame.advance(rd);
             if (inFrame.remaining() == 0) {
-                spdy.getSpdyContext().releaseFrame(inFrame);
                 if (!inFrame.isHalfClose()) {
                     inFrame = null;
                 }

Modified: tomcat/trunk/java/org/apache/tomcat/jni/socket/AprSocketContext.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/jni/socket/AprSocketContext.java?rev=1383935&r1=1383934&r2=1383935&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/jni/socket/AprSocketContext.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/jni/socket/AprSocketContext.java Wed Sep 12 13:41:33
2012
@@ -386,7 +386,7 @@ public class AprSocketContext {
             throw new IOException("Missing certificates for server");
         }
         if (sslMode || !nonBlockingAccept) {
-            acceptorDispatch = new AcceptorDispatchThread(port);
+            acceptorDispatch = new AcceptorDispatchThread();
             acceptorDispatch.setName("AprAcceptorDispatch-" + port);
             acceptorDispatch.start();
         }
@@ -688,10 +688,6 @@ public class AprSocketContext {
                 throw new IOException(e);
             }
 
-            long mode =
-                    SSLExt.sslCtxSetMode(sslCtx, SSLExt.SSL_MODE_ENABLE_PARTIAL_WRITE |
-                            SSLExt.SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);
-
             // TODO: try release buffers
             }
         }
@@ -738,11 +734,11 @@ public class AprSocketContext {
     }
 
     /**
-     * Called on each accepted socket ( for servers ) or after connection (client)
+     * Called on each accepted socket (for servers) or after connection (client)
      * after handshake.
      */
-    protected void onSocket(AprSocket s) {
-
+    protected void onSocket(@SuppressWarnings("unused") AprSocket s) {
+        // Defaults to NO-OP. Parameter is used by sub-classes.
     }
 
     class AcceptorThread extends Thread {
@@ -858,7 +854,7 @@ public class AprSocketContext {
 
     class AcceptorDispatchThread extends Thread {
 
-        AcceptorDispatchThread(int port) {
+        AcceptorDispatchThread() {
             setDaemon(true);
         }
 
@@ -885,19 +881,18 @@ public class AprSocketContext {
     AprPoller allocatePoller() throws IOException {
         long pool = Pool.create(getRootPool());
         int size = maxConnections / pollerThreadCount;
-        int timeout = keepAliveTimeout;
 
-        long serverPollset = allocatePoller(size, pool, timeout);
+        long serverPollset = allocatePoller(size, pool);
 
         if (serverPollset == 0 && size > 1024) {
             log.severe("Falling back to 1024-sized poll, won't scale");
             size = 1024;
-            serverPollset = allocatePoller(size, pool, timeout);
+            serverPollset = allocatePoller(size, pool);
         }
         if (serverPollset == 0) {
             log.severe("Falling back to 62-sized poll, won't scale");
             size = 62;
-            serverPollset = allocatePoller(size, pool, timeout);
+            serverPollset = allocatePoller(size, pool);
         }
 
         AprPoller res = new AprPoller();
@@ -920,12 +915,12 @@ public class AprSocketContext {
     // last test shows a small improvement, can switch later.
     static boolean sizeLogged = false;
 
-    protected long allocatePoller(int size, long pool, int timeout) {
+    protected long allocatePoller(int size, long pool) {
         int flag = threadSafe ? Poll.APR_POLLSET_THREADSAFE: 0;
         for (int i = 0; i < 2; i++) {
             try {
                 //  timeout must be -1 - or ttl will take effect, strange results.
-                return Poll.create(size, pool, flag, -1); // timeout * 1000);
+                return Poll.create(size, pool, flag, -1);
             } catch (Error e) {
                 e.printStackTrace();
                 if (Status.APR_STATUS_IS_EINVAL(e.getError())) {
@@ -1039,7 +1034,6 @@ public class AprSocketContext {
                             // Check for failed sockets and hand this socket off to a worker
                             long mask = desc[pollIdx * 2];
 
-                            boolean hup = ((mask & Poll.APR_POLLHUP) == Poll.APR_POLLHUP);
                             boolean err = ((mask & Poll.APR_POLLERR) == Poll.APR_POLLERR);
                             boolean nval = ((mask & Poll.APR_POLLNVAL) != 0);
                             if (err || nval) {

Modified: tomcat/trunk/java/org/apache/tomcat/spdy/SpdyConnection.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/spdy/SpdyConnection.java?rev=1383935&r1=1383934&r2=1383935&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/spdy/SpdyConnection.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/spdy/SpdyConnection.java Wed Sep 12 13:41:33 2012
@@ -492,7 +492,6 @@ public abstract class SpdyConnection { /
             if (inFrame != null) {
                 inFrame.recyle();
                 if (nextFrame != null) {
-                    getSpdyContext().releaseFrame(inFrame);
                     inFrame = nextFrame;
                     nextFrame = null;
                 }
@@ -547,9 +546,9 @@ public abstract class SpdyConnection { /
             case TYPE_SETTINGS: {
                 int cnt = inFrame.readInt();
                 for (int i = 0; i < cnt; i++) {
-                    int flag = inFrame.readByte();
-                    int id = inFrame.read24();
-                    int value = inFrame.readInt();
+                    inFrame.readByte();
+                    inFrame.read24();
+                    inFrame.readInt();
                 }
                 // TODO: save/interpret settings
                 break;

Modified: tomcat/trunk/java/org/apache/tomcat/spdy/SpdyContext.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/spdy/SpdyContext.java?rev=1383935&r1=1383934&r2=1383935&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/spdy/SpdyContext.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/spdy/SpdyContext.java Wed Sep 12 13:41:33 2012
@@ -92,9 +92,6 @@ public final class SpdyContext {
         return new SpdyFrame(defaultFrameSize);
     }
 
-    public void releaseFrame(SpdyFrame done) {
-    }
-
     /**
      * Set the max frame size.
      *
@@ -198,9 +195,6 @@ public final class SpdyContext {
         return netSupport.getConnection(host, port);
     }
 
-    public void releaseConnection(SpdyConnection con) {
-    }
-
     public final void listen(final int port, String cert, String key) throws IOException
{
         netSupport.listen(port, cert, key);
     }

Modified: tomcat/trunk/java/org/apache/tomcat/spdy/SpdyStream.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/spdy/SpdyStream.java?rev=1383935&r1=1383934&r2=1383935&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/spdy/SpdyStream.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/spdy/SpdyStream.java Wed Sep 12 13:41:33 2012
@@ -239,7 +239,7 @@ public class SpdyStream implements Runna
             // TODO: add the others
             reqFrame.halfClose();
         }
-        getRequest().addHeader("scheme", "http"); // todo
+        getRequest().addHeader("scheme", scheme);
         getRequest().addHeader("method", method);
         getRequest().addHeader("version", "HTTP/1.1");
         if (reqFrame.isHalfClose()) {
@@ -270,9 +270,6 @@ public class SpdyStream implements Runna
 
         private void fill() {
             if (current == null || current.off == current.endData) {
-                if (current != null) {
-                    spdy.spdyContext.releaseFrame(current);
-                }
                 current = getFrame(to);
             }
         }

Modified: tomcat/trunk/java/org/apache/tomcat/util/modeler/Registry.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/modeler/Registry.java?rev=1383935&r1=1383934&r2=1383935&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/modeler/Registry.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/modeler/Registry.java Wed Sep 12 13:41:33 2012
@@ -482,7 +482,7 @@ public class Registry implements Registr
             }
 
             // introspection
-            load("MbeansDescriptorsIntrospectionSource", beanClass, type);
+            load("MbeansDescriptorsIntrospectionSource", beanClass);
 
             managed=findManagedBean(type);
             if( managed==null ) {
@@ -535,23 +535,20 @@ public class Registry implements Registr
      *
      * @param sourceType
      * @param source
-     * @param param
      * @return List of descriptors
      * @throws Exception
      */
-    public List<ObjectName> load( String sourceType, Object source,
-            String param) throws Exception {
+    public List<ObjectName> load( String sourceType, Object source)
+            throws Exception {
         if( log.isTraceEnabled()) {
             log.trace("load " + source );
         }
         String location=null;
-        String type=null;
         Object inputsource=null;
 
         if( source instanceof URL ) {
             URL url=(URL)source;
             location=url.toString();
-            type=param;
             inputsource=url.openStream();
             if( sourceType == null ) {
                 sourceType = sourceTypeFromExt(location);
@@ -559,16 +556,13 @@ public class Registry implements Registr
         } else if( source instanceof File ) {
             location=((File)source).getAbsolutePath();
             inputsource=new FileInputStream((File)source);
-            type=param;
             if( sourceType == null ) {
                 sourceType = sourceTypeFromExt(location);
             }
         } else if( source instanceof InputStream ) {
-            type=param;
             inputsource=source;
         } else if( source instanceof Class<?> ) {
             location=((Class<?>)source).getName();
-            type=param;
             inputsource=source;
             if( sourceType== null ) {
                 sourceType="MbeansDescriptorsIntrospectionSource";
@@ -580,7 +574,7 @@ public class Registry implements Registr
         }
         ModelerSource ds=getModelerSource(sourceType);
         List<ObjectName> mbeans =
-            ds.loadDescriptors(this, type, inputsource);
+            ds.loadDescriptors(this, inputsource);
 
         return mbeans;
     }
@@ -665,7 +659,7 @@ public class Registry implements Registr
         log.debug( "Found " + dURL);
         searchedPaths.put( packageName,  dURL );
         try {
-            load("MbeansDescriptorsDigesterSource", dURL, null);
+            load("MbeansDescriptorsDigesterSource", dURL);
         } catch(Exception ex ) {
             log.error("Error loading " + dURL);
         }

Modified: tomcat/trunk/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsDigesterSource.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsDigesterSource.java?rev=1383935&r1=1383934&r2=1383935&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsDigesterSource.java
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsDigesterSource.java
Wed Sep 12 13:41:33 2012
@@ -38,7 +38,6 @@ public class MbeansDescriptorsDigesterSo
             LogFactory.getLog(MbeansDescriptorsDigesterSource.class);
 
     private Registry registry;
-    private String type;
     private final List<ObjectName> mbeans = new ArrayList<>();
     private static volatile Digester digester = null;
 
@@ -137,23 +136,14 @@ public class MbeansDescriptorsDigesterSo
     }
 
 
-    /** Used if a single component is loaded
-     *
-     * @param type
-     */
-    public void setType( String type ) {
-       this.type=type;
-    }
-
     public void setSource( Object source ) {
         this.source=source;
     }
 
     @Override
-    public List<ObjectName> loadDescriptors( Registry registry, String type,
-            Object source) throws Exception {
+    public List<ObjectName> loadDescriptors( Registry registry, Object source)
+            throws Exception {
         setRegistry(registry);
-        setType(type);
         setSource(source);
         execute();
         return mbeans;

Modified: tomcat/trunk/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java?rev=1383935&r1=1383934&r2=1383935&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java
Wed Sep 12 13:41:33 2012
@@ -61,10 +61,9 @@ public class MbeansDescriptorsIntrospect
     }
 
     @Override
-    public List<ObjectName> loadDescriptors(Registry registry, String type,
-            Object source) throws Exception {
+    public List<ObjectName> loadDescriptors(Registry registry, Object source)
+            throws Exception {
         setRegistry(registry);
-        setType(type);
         setSource(source);
         execute();
         return mbeans;

Modified: tomcat/trunk/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsSerSource.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsSerSource.java?rev=1383935&r1=1383934&r2=1383935&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsSerSource.java
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsSerSource.java
Wed Sep 12 13:41:33 2012
@@ -30,34 +30,24 @@ import org.apache.tomcat.util.modeler.Ma
 import org.apache.tomcat.util.modeler.Registry;
 
 
-public class MbeansDescriptorsSerSource extends ModelerSource
-{
+public class MbeansDescriptorsSerSource extends ModelerSource {
+
     private static final Log log = LogFactory.getLog(MbeansDescriptorsSerSource.class);
     private Registry registry;
-    private String type;
     private final List<ObjectName> mbeans=new ArrayList<>();
 
     public void setRegistry(Registry reg) {
         this.registry=reg;
     }
 
-    /** Used if a single component is loaded
-     *
-     * @param type
-     */
-    public void setType( String type ) {
-       this.type=type;
-    }
-
     public void setSource( Object source ) {
         this.source=source;
     }
 
     @Override
-    public List<ObjectName> loadDescriptors( Registry registry, String type,
-            Object source) throws Exception {
+    public List<ObjectName> loadDescriptors( Registry registry, Object source)
+            throws Exception {
         setRegistry(registry);
-        setType(type);
         setSource(source);
         execute();
         return mbeans;

Modified: tomcat/trunk/java/org/apache/tomcat/util/modeler/modules/ModelerSource.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/modeler/modules/ModelerSource.java?rev=1383935&r1=1383934&r2=1383935&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/modeler/modules/ModelerSource.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/modeler/modules/ModelerSource.java Wed Sep 12
13:41:33 2012
@@ -32,10 +32,9 @@ public abstract class ModelerSource {
      * Load data, returns a list of items.
      *
      * @param registry
-     * @param type
      * @param source Introspected object or some other source
      * @throws Exception
      */
     public abstract List<ObjectName> loadDescriptors(Registry registry,
-            String type, Object source) throws Exception;
+            Object source) throws Exception;
 }



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


Mime
View raw message