geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r598759 - in /geronimo/server/trunk: framework/configs/rmi-naming/ framework/configs/rmi-naming/src/main/plan/ framework/modules/geronimo-core/src/main/java/org/apache/geronimo/pool/ framework/modules/geronimo-core/src/test/java/org/apache/...
Date Tue, 27 Nov 2007 20:32:30 GMT
Author: gawor
Date: Tue Nov 27 12:32:26 2007
New Revision: 598759

URL: http://svn.apache.org/viewvc?rev=598759&view=rev
Log:
add an option for setting minimum thread pool size. also increase thread idle time to 30 secs.
 (GERONIMO-3634)

Modified:
    geronimo/server/trunk/framework/configs/rmi-naming/pom.xml
    geronimo/server/trunk/framework/configs/rmi-naming/src/main/plan/plan.xml
    geronimo/server/trunk/framework/modules/geronimo-core/src/main/java/org/apache/geronimo/pool/ThreadPool.java
    geronimo/server/trunk/framework/modules/geronimo-core/src/test/java/org/apache/geronimo/pool/ThreadPoolTest.java
    geronimo/server/trunk/plugins/connector/transaction/src/main/plan/plan.xml
    geronimo/server/trunk/plugins/system-database/geronimo-timer/src/test/java/org/apache/geronimo/timer/AbstractThreadPooledTimerTest.java

Modified: geronimo/server/trunk/framework/configs/rmi-naming/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/configs/rmi-naming/pom.xml?rev=598759&r1=598758&r2=598759&view=diff
==============================================================================
--- geronimo/server/trunk/framework/configs/rmi-naming/pom.xml (original)
+++ geronimo/server/trunk/framework/configs/rmi-naming/pom.xml Tue Nov 27 12:32:26 2007
@@ -111,8 +111,10 @@
                                     <attribute name="namingProviderUrl">rmi://${ServerHostname}:${NamingPort
+ PortOffset}</attribute>
                                 </gbean>
                                 <gbean name="DefaultThreadPool">
-                                    <attribute name="keepAliveTime">5000</attribute>
-                                    <attribute name="poolSize">${ThreadPoolSize}</attribute>
+                                    <attribute name="keepAliveTime">30000</attribute>
+                                    <attribute name="minPoolSize">${MinThreadPoolSize}</attribute>
+                                    <attribute name="maxPoolSize">${MaxThreadPoolSize}</attribute>
+
                                 </gbean>
                                 <gbean name="DownloadedPluginRepos">
                                     <attribute name="repositoryList">http://geronimo.apache.org/plugins/plugin-repository-list-2.1.txt</attribute>
@@ -122,7 +124,8 @@
                             <config-substitution key="ServerHostname">localhost</config-substitution>
                             <config-substitution key="PortOffset">0</config-substitution>
                             <config-substitution key="NamingPort">1099</config-substitution>
-                            <config-substitution key="ThreadPoolSize">500</config-substitution>
+                            <config-substitution key="MinThreadPoolSize">200</config-substitution>
+                            <config-substitution key="MaxThreadPoolSize">500</config-substitution>
                         </plugin-artifact>
                     </instance>
                 </configuration>

Modified: geronimo/server/trunk/framework/configs/rmi-naming/src/main/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/configs/rmi-naming/src/main/plan/plan.xml?rev=598759&r1=598758&r2=598759&view=diff
==============================================================================
--- geronimo/server/trunk/framework/configs/rmi-naming/src/main/plan/plan.xml (original)
+++ geronimo/server/trunk/framework/configs/rmi-naming/src/main/plan/plan.xml Tue Nov 27 12:32:26
2007
@@ -52,8 +52,9 @@
     </gbean>
 
     <gbean name="DefaultThreadPool" class="org.apache.geronimo.pool.ThreadPool">
-        <attribute name="keepAliveTime">5000</attribute>
-        <attribute name="poolSize">500</attribute>
+        <attribute name="keepAliveTime">30000</attribute>
+        <attribute name="minPoolSize">200</attribute>
+        <attribute name="maxPoolSize">500</attribute>
         <attribute name="poolName">DefaultThreadPool</attribute>
     </gbean>
 

Modified: geronimo/server/trunk/framework/modules/geronimo-core/src/main/java/org/apache/geronimo/pool/ThreadPool.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-core/src/main/java/org/apache/geronimo/pool/ThreadPool.java?rev=598759&r1=598758&r2=598759&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-core/src/main/java/org/apache/geronimo/pool/ThreadPool.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-core/src/main/java/org/apache/geronimo/pool/ThreadPool.java
Tue Nov 27 12:32:26 2007
@@ -60,10 +60,10 @@
     private PoolStatsImpl stats = new PoolStatsImpl();
     private Map clients = new HashMap();
 
-    public ThreadPool(int poolSize, String poolName, long keepAliveTime, ClassLoader classLoader,
String objectName) {
+    public ThreadPool(int minPoolSize, int maxPoolSize, String poolName, long keepAliveTime,
ClassLoader classLoader, String objectName) {
         ThreadPoolExecutor p = new ThreadPoolExecutor(
-            poolSize, // core size
-            poolSize, // max size
+            minPoolSize, // core size
+            maxPoolSize, // max size
             keepAliveTime, TimeUnit.MILLISECONDS,
             new SynchronousQueue());
 
@@ -354,7 +354,8 @@
     static {
         GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(ThreadPool.class, "GBean");
 
-        infoFactory.addAttribute("poolSize", int.class, true);
+        infoFactory.addAttribute("minPoolSize", int.class, true);
+        infoFactory.addAttribute("maxPoolSize", int.class, true);
         infoFactory.addAttribute("poolName", String.class, true);
         infoFactory.addAttribute("keepAliveTime", long.class, true);
         infoFactory.addAttribute("waitWhenBlocked", boolean.class, true);
@@ -364,7 +365,7 @@
 
         infoFactory.addInterface(GeronimoExecutor.class);
 
-        infoFactory.setConstructor(new String[]{"poolSize", "poolName", "keepAliveTime",
"classLoader", "objectName"});
+        infoFactory.setConstructor(new String[]{"minPoolSize", "maxPoolSize", "poolName",
"keepAliveTime", "classLoader", "objectName"});
 
         GBEAN_INFO = infoFactory.getBeanInfo();
     }

Modified: geronimo/server/trunk/framework/modules/geronimo-core/src/test/java/org/apache/geronimo/pool/ThreadPoolTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-core/src/test/java/org/apache/geronimo/pool/ThreadPoolTest.java?rev=598759&r1=598758&r2=598759&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-core/src/test/java/org/apache/geronimo/pool/ThreadPoolTest.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-core/src/test/java/org/apache/geronimo/pool/ThreadPoolTest.java
Tue Nov 27 12:32:26 2007
@@ -63,7 +63,7 @@
     }
 
     public void setUp() throws Exception {
-        threadPool = new ThreadPool(1, "foo", Long.MAX_VALUE, ThreadPoolTest.class.getClassLoader(),
"foo:bar=baz");
+        threadPool = new ThreadPool(1, 1, "foo", Long.MAX_VALUE, ThreadPoolTest.class.getClassLoader(),
"foo:bar=baz");
         threadPool.doStart();
     }
 

Modified: geronimo/server/trunk/plugins/connector/transaction/src/main/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector/transaction/src/main/plan/plan.xml?rev=598759&r1=598758&r2=598759&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector/transaction/src/main/plan/plan.xml (original)
+++ geronimo/server/trunk/plugins/connector/transaction/src/main/plan/plan.xml Tue Nov 27
12:32:26 2007
@@ -28,8 +28,9 @@
     </gbean>
 
     <gbean name="ConnectorThreadPool" class="org.apache.geronimo.pool.ThreadPool">
-        <attribute name="keepAliveTime">5000</attribute>
-        <attribute name="poolSize">30</attribute>
+        <attribute name="keepAliveTime">30000</attribute>
+        <attribute name="minPoolSize">5</attribute>
+        <attribute name="maxPoolSize">30</attribute>
         <attribute name="poolName">ConnectorThreadPool</attribute>
     </gbean>
 

Modified: geronimo/server/trunk/plugins/system-database/geronimo-timer/src/test/java/org/apache/geronimo/timer/AbstractThreadPooledTimerTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/system-database/geronimo-timer/src/test/java/org/apache/geronimo/timer/AbstractThreadPooledTimerTest.java?rev=598759&r1=598758&r2=598759&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/system-database/geronimo-timer/src/test/java/org/apache/geronimo/timer/AbstractThreadPooledTimerTest.java
(original)
+++ geronimo/server/trunk/plugins/system-database/geronimo-timer/src/test/java/org/apache/geronimo/timer/AbstractThreadPooledTimerTest.java
Tue Nov 27 12:32:26 2007
@@ -52,7 +52,7 @@
 
     protected void setUp() throws Exception {
         userTaskFactory = new MockUserTaskFactory();
-        threadPool = new ThreadPool(30, "TestPool", 10000, this.getClass().getClassLoader(),
"foo:bar=baz");
+        threadPool = new ThreadPool(30, 30, "TestPool", 10000, this.getClass().getClassLoader(),
"foo:bar=baz");
         WorkerPersistence workerPersistence = new VMWorkerPersistence();
         timer = new ThreadPooledTimer(executableWorkFactory, workerPersistence, threadPool,
transactionManager);
         timer.doStart();



Mime
View raw message