Author: ccustine
Date: Tue Feb  3 08:18:01 2009
New Revision: 740243

URL: http://svn.apache.org/viewvc?rev=740243&view=rev
Log:
SM-1634 Update JettyContextManager to use QueuedThreadPool (BoundedThreadPool 
is deprecated)

Modified:
    
servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/jetty/JettyContextManager.java
    
servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-http/src/test/java/org/apache/servicemix/http/ServerManagerTest.java

Modified: 
servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/jetty/JettyContextManager.java
URL: 
http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/jetty/JettyContextManager.java?rev=740243&r1=740242&r2=740243&view=diff
==============================================================================
--- 
servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/jetty/JettyContextManager.java
 (original)
+++ 
servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/jetty/JettyContextManager.java
 Tue Feb  3 08:18:01 2009
@@ -58,7 +58,9 @@
 import org.mortbay.jetty.servlet.ServletHolder;
 import org.mortbay.jetty.servlet.ServletMapping;
 import org.mortbay.management.MBeanContainer;
-import org.mortbay.thread.BoundedThreadPool;
+
+import org.mortbay.thread.QueuedThreadPool;
+
 import org.mortbay.thread.ThreadPool;
 import org.mortbay.util.ByteArrayISO8859Writer;
 import org.mortbay.util.LazyList;
@@ -71,7 +73,7 @@
 
     private Map<String, Server> servers;
     private HttpConfiguration configuration;
-    private BoundedThreadPool threadPool;
+    private QueuedThreadPool threadPool;
     private Map<String, SslParameters> sslParams;
     private MBeanServer mBeanServer;
     private MBeanContainer mbeanContainer;
@@ -100,9 +102,9 @@
         }
         servers = new HashMap<String, Server>();
         sslParams = new HashMap<String, SslParameters>();
-        BoundedThreadPool btp = new BoundedThreadPool();
-        btp.setMaxThreads(this.configuration.getJettyThreadPoolSize());
-        threadPool = btp;
+        QueuedThreadPool qtp = new QueuedThreadPool();
+        qtp.setMaxThreads(this.configuration.getJettyThreadPoolSize());
+        threadPool = qtp;
     }
 
     public void shutDown() throws Exception {

Modified: 
servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-http/src/test/java/org/apache/servicemix/http/ServerManagerTest.java
URL: 
http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-http/src/test/java/org/apache/servicemix/http/ServerManagerTest.java?rev=740243&r1=740242&r2=740243&view=diff
==============================================================================
--- 
servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-http/src/test/java/org/apache/servicemix/http/ServerManagerTest.java
 (original)
+++ 
servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-http/src/test/java/org/apache/servicemix/http/ServerManagerTest.java
 Tue Feb  3 08:18:01 2009
@@ -30,7 +30,7 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.servicemix.components.http.InvalidStatusResponseException;
 import org.apache.servicemix.http.jetty.JettyContextManager;
-import org.mortbay.thread.BoundedThreadPool;
+import org.mortbay.thread.QueuedThreadPool;
 
 public class ServerManagerTest extends TestCase {
     private static transient Log log = 
LogFactory.getLog(ServerManagerTest.class);
@@ -110,8 +110,8 @@
         int maxThreads = 512;
         configuration.setJettyThreadPoolSize(maxThreads);
         server.init();
-        assertTrue(server.getThreadPool() instanceof BoundedThreadPool);
-        int threads = ((BoundedThreadPool) 
server.getThreadPool()).getMaxThreads();
+        assertTrue(server.getThreadPool() instanceof QueuedThreadPool);
+        int threads = ((QueuedThreadPool) 
server.getThreadPool()).getMaxThreads();
         assertEquals("The max number of threads is incorrect!", maxThreads, 
threads);
     }
 


Reply via email to