Mercurial Hosting > luan
comparison 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 |
comparison
equal
deleted
inserted
replaced
864:e21ca9878a10 | 865:6b210bb66c63 |
---|---|
25 import java.nio.channels.SelectionKey; | 25 import java.nio.channels.SelectionKey; |
26 import java.nio.channels.ServerSocketChannel; | 26 import java.nio.channels.ServerSocketChannel; |
27 import java.nio.channels.SocketChannel; | 27 import java.nio.channels.SocketChannel; |
28 import java.util.Set; | 28 import java.util.Set; |
29 import java.util.concurrent.ConcurrentHashMap; | 29 import java.util.concurrent.ConcurrentHashMap; |
30 import java.util.concurrent.RejectedExecutionException; | |
30 | 31 |
31 import org.eclipse.jetty.http.HttpException; | 32 import org.eclipse.jetty.http.HttpException; |
32 import org.eclipse.jetty.io.Buffer; | 33 import org.eclipse.jetty.io.Buffer; |
33 import org.eclipse.jetty.io.ConnectedEndPoint; | 34 import org.eclipse.jetty.io.ConnectedEndPoint; |
34 import org.eclipse.jetty.io.Connection; | 35 import org.eclipse.jetty.io.Connection; |
81 */ | 82 */ |
82 @Override | 83 @Override |
83 protected void doStart() throws Exception | 84 protected void doStart() throws Exception |
84 { | 85 { |
85 super.doStart(); | 86 super.doStart(); |
86 getThreadPool().dispatch(new Runnable() | 87 getThreadPool().execute(new Runnable() |
87 { | 88 { |
88 | 89 |
89 public void run() | 90 public void run() |
90 { | 91 { |
91 while (isRunning()) | 92 while (isRunning()) |
222 } | 223 } |
223 | 224 |
224 /* ------------------------------------------------------------ */ | 225 /* ------------------------------------------------------------ */ |
225 void dispatch() throws IOException | 226 void dispatch() throws IOException |
226 { | 227 { |
227 if (!getThreadPool().dispatch(this)) | 228 try { |
228 { | 229 getThreadPool().execute(this); |
230 } catch(RejectedExecutionException e) { | |
229 LOG.warn("dispatch failed for {}",_connection); | 231 LOG.warn("dispatch failed for {}",_connection); |
230 super.close(); | 232 super.close(); |
231 } | 233 } |
232 } | 234 } |
233 | 235 |
276 while (isOpen()) | 278 while (isOpen()) |
277 { | 279 { |
278 _idleTimestamp=System.currentTimeMillis(); | 280 _idleTimestamp=System.currentTimeMillis(); |
279 if (_connection.isIdle()) | 281 if (_connection.isIdle()) |
280 { | 282 { |
281 if (getServer().getThreadPool().isLowOnThreads()) | 283 if (getServer().isLowOnThreads()) |
282 { | 284 { |
283 int lrmit = getLowResourcesMaxIdleTime(); | 285 int lrmit = getLowResourcesMaxIdleTime(); |
284 if (lrmit>=0 && _timeout!= lrmit) | 286 if (lrmit>=0 && _timeout!= lrmit) |
285 { | 287 { |
286 _timeout=lrmit; | 288 _timeout=lrmit; |