comparison src/org/eclipse/jetty/io/nio/SelectChannelEndPoint.java @ 946:901dcfa05c32

remove SelectChannelEndPoint._interruptable
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 11 Oct 2016 21:10:17 -0600
parents 89fe80dfab2c
children 64f3d8dae31d
comparison
equal deleted inserted replaced
945:89fe80dfab2c 946:901dcfa05c32
86 private boolean _open; 86 private boolean _open;
87 87
88 private volatile long _idleTimestamp; 88 private volatile long _idleTimestamp;
89 private volatile boolean _checkIdle; 89 private volatile boolean _checkIdle;
90 90
91 private boolean _interruptable;
92
93 private boolean _ishut; 91 private boolean _ishut;
94 92
95 /* ------------------------------------------------------------ */ 93 /* ------------------------------------------------------------ */
96 public SelectChannelEndPoint(SocketChannel channel, SelectSet selectSet, SelectionKey key, int maxIdleTime) 94 public SelectChannelEndPoint(SocketChannel channel, SelectSet selectSet, SelectionKey key, int maxIdleTime)
97 throws IOException 95 throws IOException
401 this.wait(timeoutMs>0?(end-now):10000); 399 this.wait(timeoutMs>0?(end-now):10000);
402 } 400 }
403 catch (final InterruptedException e) 401 catch (final InterruptedException e)
404 { 402 {
405 LOG.warn("",e); 403 LOG.warn("",e);
406 if (_interruptable)
407 throw new InterruptedIOException(){{this.initCause(e);}};
408 } 404 }
409 finally 405 finally
410 { 406 {
411 now=_selectSet.getNow(); 407 now=_selectSet.getNow();
412 } 408 }
451 this.wait(timeoutMs>0?(end-now):10000); 447 this.wait(timeoutMs>0?(end-now):10000);
452 } 448 }
453 catch (final InterruptedException e) 449 catch (final InterruptedException e)
454 { 450 {
455 LOG.warn("",e); 451 LOG.warn("",e);
456 if (_interruptable)
457 throw new InterruptedIOException(){{this.initCause(e);}};
458 } 452 }
459 finally 453 finally
460 { 454 {
461 now=_selectSet.getNow(); 455 now=_selectSet.getNow();
462 } 456 }
471 } 465 }
472 } 466 }
473 return true; 467 return true;
474 } 468 }
475 469
476 /* ------------------------------------------------------------ */
477 /** Set the interruptable mode of the endpoint.
478 * If set to false (default), then interrupts are assumed to be spurious
479 * and blocking operations continue unless the endpoint has been closed.
480 * If true, then interrupts of blocking operations result in InterruptedIOExceptions
481 * being thrown.
482 * @param interupable
483 */
484 public void setInterruptable(boolean interupable)
485 {
486 synchronized (this)
487 {
488 _interruptable=interupable;
489 }
490 }
491
492 /* ------------------------------------------------------------ */
493 public boolean isInterruptable()
494 {
495 return _interruptable;
496 }
497
498 /* ------------------------------------------------------------ */ 470 /* ------------------------------------------------------------ */
499 /** 471 /**
500 * @see org.eclipse.jetty.io.AsyncEndPoint#scheduleWrite() 472 * @see org.eclipse.jetty.io.AsyncEndPoint#scheduleWrite()
501 */ 473 */
502 public void scheduleWrite() 474 public void scheduleWrite()