tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@apache.org
Subject svn commit: r653178 - in /tomcat/sandbox/tomcat-lite: build.xml coyote-apr/org/apache/coyote/http11/Http11AprProtocol.java
Date Sun, 04 May 2008 04:53:07 GMT
Author: costin
Date: Sat May  3 21:53:06 2008
New Revision: 653178

URL: http://svn.apache.org/viewvc?rev=653178&view=rev
Log:
Add jasper to build.xml, revert some bad changes on Http11AprProcessor ( now should be same
with trunk )


Modified:
    tomcat/sandbox/tomcat-lite/build.xml
    tomcat/sandbox/tomcat-lite/coyote-apr/org/apache/coyote/http11/Http11AprProtocol.java

Modified: tomcat/sandbox/tomcat-lite/build.xml
URL: http://svn.apache.org/viewvc/tomcat/sandbox/tomcat-lite/build.xml?rev=653178&r1=653177&r2=653178&view=diff
==============================================================================
--- tomcat/sandbox/tomcat-lite/build.xml (original)
+++ tomcat/sandbox/tomcat-lite/build.xml Sat May  3 21:53:06 2008
@@ -122,7 +122,7 @@
     <!-- Tomcat-lite -->
     <javac destdir="${classes}" source="${source.vm}" 
            target="${target.vm}"
-      classpathref="runtime-deps"
+           classpathref="runtime-deps"
            includeJavaRuntime="false"
            deprecation="false" 
            debug="false"  >
@@ -134,7 +134,26 @@
                includes="**/*.properties **/*.xml"/>
     </copy>
   </target>
-  
+
+  <target name="compile.jsp">
+    <javac destdir="${classes}" source="${source.vm}" 
+           target="${target.vm}"
+           classpathref="runtime-deps"
+           includeJavaRuntime="false"
+           deprecation="false" 
+           debug="false"  >
+      <src path="java" />
+      <include name ="org/apache/tomcat/lite/**" />
+      <classpath>
+        <pathelement path="webapps/addons-jasper/WEB-INF/lib/jsp-api.jar"/>
+        <pathelement path="webapps/addons-jasper/WEB-INF/lib/el-api.jar"/>
+        <pathelement path="webapps/addons-jasper/WEB-INF/lib/jasper-el.jar"/>
+        <pathelement path="webapps/addons-jasper/WEB-INF/lib/jasper.jar"/>
+        <pathelement path="webapps/addons-jasper/WEB-INF/lib/jasper-jdt.jar"/>
+      </classpath>
+    </javac>
+  </target>
+    
   <target name="clean">
     <delete dir="${classes}" includes="**"/>
   </target>
@@ -163,6 +182,29 @@
     </jar>
   </target>
 
+  <target name="jsp" depends="pack_tomcat-lite-jasper.jar"/>
+  
+  <target name="pack_tomcat-lite-jasper.jar" depends="compile.jsp">
+    <jar destfile="output/tomcat-lite-jsp.jar" manifest="resources/tomcat-lite.MF">
+      <zipfileset src="output/tomcat-lite.jar"/>
+      <zipfileset src="webapps/addons-jasper/WEB-INF/lib/jsp-api.jar"/>
+      <zipfileset src="webapps/addons-jasper/WEB-INF/lib/el-api.jar"/>
+      <zipfileset src="webapps/addons-jasper/WEB-INF/lib/jasper-el.jar"/>
+     </jar>
+    <jar destfile="output/tomcat-lite-jsp-compiler.jar" manifest="resources/tomcat-lite.MF">
+      <fileset dir="${classes}" >
+        <include name ="org/apache/tomcat/servlets/jsp/Jsp**" />
+        <include name ="org/apache/tomcat/servlets/jsp/Jasper**" />
+      </fileset>
+      <zipfileset src="output/tomcat-lite.jar"/>
+      <zipfileset src="webapps/addons-jasper/WEB-INF/lib/jsp-api.jar"/>
+      <zipfileset src="webapps/addons-jasper/WEB-INF/lib/el-api.jar"/>
+      <zipfileset src="webapps/addons-jasper/WEB-INF/lib/jasper-el.jar"/>
+      <zipfileset src="webapps/addons-jasper/WEB-INF/lib/jasper.jar"/>
+      <zipfileset src="webapps/addons-jasper/WEB-INF/lib/jasper-jdt.jar"/>
+     </jar>
+  </target>
+
   <target name="all" depends="tomcat-lite.jar" />
     
   <!-- ============ Download targets for deps ================ -->
@@ -173,6 +215,16 @@
          todir="external" />
     <copy file="${tc6.home}/lib/annotations-api.jar"
          todir="external" />
+    <copy file="${tc6.home}/lib/jsp-api.jar"
+          todir="webapps/addons-jasper/WEB-INF/lib/"/>
+    <copy file="${tc6.home}/lib/el-api.jar"
+          todir="webapps/addons-jasper/WEB-INF/lib/"/>
+    <copy file="${tc6.home}/lib/jasper.jar"
+          todir="webapps/addons-jasper/WEB-INF/lib/"/>
+    <copy file="${tc6.home}/lib/jasper-el.jar"
+          todir="webapps/addons-jasper/WEB-INF/lib/"/>
+    <copy file="${tc6.home}/lib/jasper-jdt.jar"
+          todir="webapps/addons-jasper/WEB-INF/lib/"/>
   </target>
 
 </project>

Modified: tomcat/sandbox/tomcat-lite/coyote-apr/org/apache/coyote/http11/Http11AprProtocol.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/tomcat-lite/coyote-apr/org/apache/coyote/http11/Http11AprProtocol.java?rev=653178&r1=653177&r2=653178&view=diff
==============================================================================
--- tomcat/sandbox/tomcat-lite/coyote-apr/org/apache/coyote/http11/Http11AprProtocol.java
(original)
+++ tomcat/sandbox/tomcat-lite/coyote-apr/org/apache/coyote/http11/Http11AprProtocol.java
Sat May  3 21:53:06 2008
@@ -37,7 +37,6 @@
 import org.apache.coyote.ProtocolHandler;
 import org.apache.coyote.RequestGroupInfo;
 import org.apache.coyote.RequestInfo;
-import org.apache.tomcat.util.collections.SimplePool;
 import org.apache.tomcat.util.modeler.Registry;
 import org.apache.tomcat.util.net.AprEndpoint;
 import org.apache.tomcat.util.net.SocketStatus;
@@ -193,10 +192,6 @@
 
     private Http11ConnectionHandler cHandler = new Http11ConnectionHandler(this);
 
-    public AprEndpoint getEndpoint() {
-      return endpoint;
-    }
-
     /**
      * Processor cache.
      */
@@ -472,18 +467,45 @@
         
         protected ConcurrentHashMap<Long, Http11AprProcessor> connections =
             new ConcurrentHashMap<Long, Http11AprProcessor>();
+        protected ConcurrentLinkedQueue<Http11AprProcessor> recycledProcessors = 
+            new ConcurrentLinkedQueue<Http11AprProcessor>() {
+            protected AtomicInteger size = new AtomicInteger(0);
+            public boolean offer(Http11AprProcessor processor) {
+                boolean offer = (proto.processorCache == -1) ? true : (size.get() < proto.processorCache);
+                //avoid over growing our cache or add after we have stopped
+                boolean result = false;
+                if ( offer ) {
+                    result = super.offer(processor);
+                    if ( result ) {
+                        size.incrementAndGet();
+                    }
+                }
+                if (!result) unregister(processor);
+                return result;
+            }
+            
+            public Http11AprProcessor poll() {
+                Http11AprProcessor result = super.poll();
+                if ( result != null ) {
+                    size.decrementAndGet();
+                }
+                return result;
+            }
+            
+            public void clear() {
+                Http11AprProcessor next = poll();
+                while ( next != null ) {
+                    unregister(next);
+                    next = poll();
+                }
+                super.clear();
+                size.set(0);
+            }
+        };
 
-        protected SimplePool<Http11AprProcessor> recycledProcessors;
 
         Http11ConnectionHandler(Http11AprProtocol proto) {
             this.proto = proto;
-            recycledProcessors =
-              new SimplePool<Http11AprProcessor>(proto.processorCache == -1 ?
-                  1024 : proto.processorCache) {
-                protected void reject(Http11AprProcessor t) {
-                  unregister(t);
-                }
-            };
         }
 
         public SocketState event(long socket, SocketStatus status) {
@@ -584,8 +606,8 @@
             processor.setMaxKeepAliveRequests(proto.maxKeepAliveRequests);
             processor.setTimeout(proto.timeout);
             processor.setDisableUploadTimeout(proto.disableUploadTimeout);
-            processor.setCompression(proto.compression);
             processor.setCompressionMinSize(proto.compressionMinSize);
+            processor.setCompression(proto.compression);
             processor.setNoCompressionUserAgents(proto.noCompressionUserAgents);
             processor.setCompressableMimeTypes(proto.compressableMimeTypes);
             processor.setRestrictedUserAgents(proto.restrictedUserAgents);



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


Mime
View raw message