geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jboy...@apache.org
Subject svn commit: r225650 - in /geronimo/trunk/modules: assembly/src/plan/ jetty-builder/src/test/org/apache/geronimo/jetty/deployment/ jetty/src/java/org/apache/geronimo/jetty/connector/ jetty/src/test/org/apache/geronimo/jetty/
Date Wed, 27 Jul 2005 23:21:02 GMT
Author: jboynes
Date: Wed Jul 27 16:20:56 2005
New Revision: 225650

URL: http://svn.apache.org/viewcvs?rev=225650&view=rev
Log:
Apply patch for GERONIMO-826 from Matt Hogstrom; Added support to configure min and max threads
to the Jetty Container

Modified:
    geronimo/trunk/modules/assembly/src/plan/jetty-config.xml
    geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
    geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/connector/JettyConnector.java
    geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/AbstractWebModuleTest.java
    geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/ContainerTest.java

Modified: geronimo/trunk/modules/assembly/src/plan/jetty-config.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/assembly/src/plan/jetty-config.xml?rev=225650&r1=225649&r2=225650&view=diff
==============================================================================
--- geronimo/trunk/modules/assembly/src/plan/jetty-config.xml (original)
+++ geronimo/trunk/modules/assembly/src/plan/jetty-config.xml Wed Jul 27 16:20:56 2005
@@ -42,8 +42,8 @@
     <gbean name="JettyWebConnector" class="org.apache.geronimo.jetty.connector.HTTPConnector">
         <attribute name="port">${PlanHTTPPort}</attribute>
         <reference name="JettyContainer"><name>WebContainer</name></reference>
-        <!--        <attribute name="MaxConnections">10</attribute>-->
-        <!--        <attribute name="MaxIdleTime">10</attribute>-->
+        <attribute name="maxThreads">50</attribute>
+        <attribute name="minThreads">10</attribute>
     </gbean>
 
     <gbean name="JettySSLConnector" class="org.apache.geronimo.jetty.connector.HTTPSConnector">
@@ -54,6 +54,8 @@
         <attribute name="keyPassword">secret</attribute>
         <attribute name="needClientAuth">false</attribute>
         <attribute name="protocol">TLS</attribute>
+        <attribute name="maxThreads">50</attribute>
+        <attribute name="minThreads">10</attribute>
         <reference name="JettyContainer"><name>WebContainer</name></reference>
         <reference name="ServerInfo"><module>org/apache/geronimo/System</module><name>ServerInfo</name></reference>
     </gbean>

Modified: geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java?rev=225650&r1=225649&r2=225650&view=diff
==============================================================================
--- geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
(original)
+++ geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
Wed Jul 27 16:20:56 2005
@@ -273,6 +273,8 @@
 
         connector = new GBeanData(connectorName, HTTPConnector.GBEAN_INFO);
         connector.setAttribute("port", new Integer(5678));
+        connector.setAttribute("maxThreads", new Integer(50));
+        connector.setAttribute("minThreads", new Integer(10));
         connector.setReferencePattern("JettyContainer", containerName);
 
         start(container);

Modified: geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/connector/JettyConnector.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/connector/JettyConnector.java?rev=225650&r1=225649&r2=225650&view=diff
==============================================================================
--- geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/connector/JettyConnector.java
(original)
+++ geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/connector/JettyConnector.java
Wed Jul 27 16:20:56 2005
@@ -26,6 +26,7 @@
 import org.apache.geronimo.jetty.JettyContainer;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.mortbay.http.HttpListener;
+import org.mortbay.http.SocketListener;
 import org.mortbay.util.ThreadedServer;
 
 /**
@@ -45,12 +46,12 @@
 
     public JettyConnector(JettyContainer container) {
         this.container = container;
-        this.listener = null;
+        this.listener = null; 
     }
 
     public JettyConnector(JettyContainer container, HttpListener listener) {
         this.container = container;
-        this.listener = listener;
+        this.listener = listener; 
     }
 
     public String getDefaultScheme() {
@@ -74,6 +75,32 @@
         listener.setPort(port);
     }
 
+
+    public void setMinThreads(int minThreads) {
+      ((ThreadedServer)listener).setMinThreads(minThreads);
+    }
+
+    public int getMinThreads() {
+      return ((ThreadedServer)listener).getMinThreads();
+    }
+
+
+    public void setMaxThreads(int maxThreads) {
+      ((ThreadedServer)listener).setMaxThreads(maxThreads);
+    }
+
+    public int getMaxThreads() {
+      return ((ThreadedServer)listener).getMaxThreads();
+    }
+
+    public int getThreads() {
+      return ((ThreadedServer)listener).getThreads();
+    }
+
+    public int getIdlethreads() {
+      return ((ThreadedServer)listener).getIdleThreads();
+    }
+    
     public InetSocketAddress getAddress() {
         return new InetSocketAddress(getHost(), getPort());
     }
@@ -114,6 +141,10 @@
         infoFactory.addAttribute("defaultScheme", String.class, false);
         infoFactory.addAttribute("host", String.class, true);
         infoFactory.addAttribute("port", int.class, true);
+        infoFactory.addAttribute("minThreads", int.class, true);
+        infoFactory.addAttribute("maxThreads", int.class, true);
+        infoFactory.addAttribute("threads", int.class, false);
+        infoFactory.addAttribute("idleThreads", int.class, false);
         infoFactory.addAttribute("address", InetSocketAddress.class, false);
         infoFactory.addReference("JettyContainer", JettyContainer.class, NameFactory.GERONIMO_SERVICE);
         infoFactory.setConstructor(new String[] {"JettyContainer"});

Modified: geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/AbstractWebModuleTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/AbstractWebModuleTest.java?rev=225650&r1=225649&r2=225650&view=diff
==============================================================================
--- geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/AbstractWebModuleTest.java
(original)
+++ geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/AbstractWebModuleTest.java
Wed Jul 27 16:20:56 2005
@@ -272,6 +272,8 @@
 
         connector = new GBeanData(connectorName, HTTPConnector.GBEAN_INFO);
         connector.setAttribute("port", new Integer(5678));
+        connector.setAttribute("maxThreads",  new Integer(50));
+        connector.setAttribute("minThreads",  new Integer(10));
         connector.setReferencePattern("JettyContainer", containerName);
 
         start(container);

Modified: geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/ContainerTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/ContainerTest.java?rev=225650&r1=225649&r2=225650&view=diff
==============================================================================
--- geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/ContainerTest.java (original)
+++ geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/ContainerTest.java Wed
Jul 27 16:20:56 2005
@@ -52,6 +52,8 @@
     public void testHTTPConnector() throws Exception {
         GBeanData connector = new GBeanData(connectorName, HTTPConnector.GBEAN_INFO);
         connector.setAttribute("port", new Integer(5678));
+        connector.setAttribute("maxThreads", new Integer(50));
+        connector.setAttribute("minThreads", new Integer(10));
         connector.setReferencePatterns("JettyContainer", containerPatterns);
         start(connector);
 
@@ -72,6 +74,8 @@
     public void testWebServiceHandler() throws Exception {
         GBeanData connector = new GBeanData(connectorName, HTTPConnector.GBEAN_INFO);
         connector.setAttribute("port", new Integer(5678));
+        connector.setAttribute("maxThreads", new Integer(50));
+        connector.setAttribute("minThreads", new Integer(10));
         connector.setReferencePatterns("JettyContainer", containerPatterns);
         start(connector);
 



Mime
View raw message