diff src/org/eclipse/jetty/server/AbstractConnector.java @ 865:6b210bb66c63

remove ThreadPool
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 02 Oct 2016 20:38:06 -0600
parents e21ca9878a10
children 688b875e18ba
line wrap: on
line diff
--- a/src/org/eclipse/jetty/server/AbstractConnector.java	Sun Oct 02 16:17:38 2016 -0600
+++ b/src/org/eclipse/jetty/server/AbstractConnector.java	Sun Oct 02 20:38:06 2016 -0600
@@ -22,6 +22,7 @@
 import java.net.InetAddress;
 import java.net.Socket;
 import java.net.UnknownHostException;
+import java.util.concurrent.ThreadPoolExecutor;
 import java.util.concurrent.atomic.AtomicLong;
 
 import javax.servlet.ServletRequest;
@@ -40,7 +41,6 @@
 import org.eclipse.jetty.util.component.Dumpable;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.eclipse.jetty.util.thread.ThreadPool;
 
 /**
  * Abstract Connector implementation. This abstract implementation of the Connector interface provides:
@@ -112,7 +112,7 @@
 	}
 
 	/* ------------------------------------------------------------ */
-	public ThreadPool getThreadPool()
+	public ThreadPoolExecutor getThreadPool()
 	{
 		return _server.getThreadPool();
 	}
@@ -297,11 +297,10 @@
 		{
 			_acceptorThreads = new Thread[getAcceptors()];
 
-			ThreadPool _threadPool = getThreadPool();
+			ThreadPoolExecutor _threadPool = getThreadPool();
 			for (int i = 0; i < _acceptorThreads.length; i++)
-				if (!_threadPool.dispatch(new Acceptor(i)))
-					throw new IllegalStateException("!accepting");
-			if (_threadPool.isLowOnThreads())
+				_threadPool.execute(new Acceptor(i));
+			if (_server.isLowOnThreads())
 				LOG.warn("insufficient threads configured for {}",this);
 		}
 
@@ -1012,9 +1011,9 @@
 	}
 
 	/* ------------------------------------------------------------ */
-	public boolean isLowResources()
+	public final boolean isLowResources()
 	{
-		return getThreadPool().isLowOnThreads();
+		return _server.isLowOnThreads();
 	}
 
 	/* ------------------------------------------------------------ */