Mercurial Hosting > luan
diff src/org/eclipse/jetty/server/nio/BlockingChannelConnector.java @ 865:6b210bb66c63
remove ThreadPool
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 02 Oct 2016 20:38:06 -0600 |
parents | 0f53601ea489 |
children | df84a1741687 |
line wrap: on
line diff
--- a/src/org/eclipse/jetty/server/nio/BlockingChannelConnector.java Sun Oct 02 16:17:38 2016 -0600 +++ b/src/org/eclipse/jetty/server/nio/BlockingChannelConnector.java Sun Oct 02 20:38:06 2016 -0600 @@ -27,6 +27,7 @@ import java.nio.channels.SocketChannel; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.RejectedExecutionException; import org.eclipse.jetty.http.HttpException; import org.eclipse.jetty.io.Buffer; @@ -83,7 +84,7 @@ protected void doStart() throws Exception { super.doStart(); - getThreadPool().dispatch(new Runnable() + getThreadPool().execute(new Runnable() { public void run() @@ -224,8 +225,9 @@ /* ------------------------------------------------------------ */ void dispatch() throws IOException { - if (!getThreadPool().dispatch(this)) - { + try { + getThreadPool().execute(this); + } catch(RejectedExecutionException e) { LOG.warn("dispatch failed for {}",_connection); super.close(); } @@ -278,7 +280,7 @@ _idleTimestamp=System.currentTimeMillis(); if (_connection.isIdle()) { - if (getServer().getThreadPool().isLowOnThreads()) + if (getServer().isLowOnThreads()) { int lrmit = getLowResourcesMaxIdleTime(); if (lrmit>=0 && _timeout!= lrmit)