Mercurial Hosting > luan
comparison src/org/eclipse/jetty/server/Connector.java @ 906:eaf271fb747f
minor
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Fri, 07 Oct 2016 03:59:44 -0600 |
parents | e7175965e6cf |
children | bc4e299de953 |
comparison
equal
deleted
inserted
replaced
905:e7175965e6cf | 906:eaf271fb747f |
---|---|
219 super.doStart(); | 219 super.doStart(); |
220 | 220 |
221 // Start selector thread | 221 // Start selector thread |
222 ThreadPoolExecutor _threadPool = server.threadPool; | 222 ThreadPoolExecutor _threadPool = server.threadPool; |
223 for (int i = 0; i < _acceptors; i++) | 223 for (int i = 0; i < _acceptors; i++) |
224 _threadPool.execute(new Acceptor(i)); | 224 _threadPool.execute(new Acceptor()); |
225 if (server.isLowOnThreads()) | 225 if (server.isLowOnThreads()) |
226 LOG.warn("insufficient threads configured for {}",this); | 226 LOG.warn("insufficient threads configured for {}",this); |
227 | 227 |
228 LOG.info("Started {}",this); | 228 LOG.info("Started {}",this); |
229 } | 229 } |
278 { | 278 { |
279 return false; | 279 return false; |
280 } | 280 } |
281 | 281 |
282 /* ------------------------------------------------------------ */ | 282 /* ------------------------------------------------------------ */ |
283 protected abstract void accept(int acceptorID) throws IOException, InterruptedException; | 283 protected abstract void accept() throws IOException, InterruptedException; |
284 | 284 |
285 /* ------------------------------------------------------------ */ | 285 /* ------------------------------------------------------------ */ |
286 public void stopAccept(int acceptorID) throws Exception | 286 public void stopAccept(int acceptorID) throws Exception |
287 { | 287 { |
288 } | 288 } |
385 /* ------------------------------------------------------------ */ | 385 /* ------------------------------------------------------------ */ |
386 /* ------------------------------------------------------------ */ | 386 /* ------------------------------------------------------------ */ |
387 /* ------------------------------------------------------------ */ | 387 /* ------------------------------------------------------------ */ |
388 private class Acceptor implements Runnable | 388 private class Acceptor implements Runnable |
389 { | 389 { |
390 int _acceptor = 0; | 390 |
391 | |
392 Acceptor(int id) | |
393 { | |
394 _acceptor = id; | |
395 } | |
396 | |
397 /* ------------------------------------------------------------ */ | |
398 public void run() | 391 public void run() |
399 { | 392 { |
400 Thread current = Thread.currentThread(); | 393 Thread current = Thread.currentThread(); |
401 String name = current.getName(); | 394 String name = current.getName(); |
402 current.setName(name + " Acceptor" + _acceptor + " " + Connector.this); | 395 current.setName(name + " Acceptor" + " " + Connector.this); |
403 | 396 |
404 try | 397 try |
405 { | 398 { |
406 while (isRunning() && getConnection() != null) | 399 while (isRunning() && getConnection() != null) |
407 { | 400 { |
408 try | 401 try |
409 { | 402 { |
410 accept(_acceptor); | 403 accept(); |
411 } | 404 } |
412 catch (EofException e) | 405 catch (EofException e) |
413 { | 406 { |
414 LOG.trace("",e); | 407 LOG.trace("",e); |
415 } | 408 } |