private void drainSelectorQueue() { ServerConnection sc = (ServerConnection)this.selectorQueue.poll(); CancelException cce = null; while (sc != null) { try { finishCon(sc); } catch (CancelException e) { if (cce == null) { cce = e; } } sc = (ServerConnection)this.selectorQueue.poll(); } Iterator it = selectorRegistrations.iterator(); while (it.hasNext()) { try { finishCon((ServerConnection)it.next()); } catch (CancelException e) { if (cce == null) { cce = e; } } } // while if (cce != null) { throw cce; } }
private void drainSelectorQueue() { ServerConnection sc = (ServerConnection)this.selectorQueue.poll(); CancelException cce = null; while (sc != null) { try { finishCon(sc); } catch (CancelException e) { if (cce == null) { cce = e; } } sc = (ServerConnection)this.selectorQueue.poll(); } Iterator it = selectorRegistrations.iterator(); while (it.hasNext()) { try { finishCon((ServerConnection)it.next()); } catch (CancelException e) { if (cce == null) { cce = e; } } } // while if (cce != null) { throw cce; } }
private int checkRegisteredKeys(int count) { int result = count; CancelException cce = null; if (count > 0) { Iterator it = this.selectorRegistrations.iterator(); while (it.hasNext()) { ServerConnection sc = (ServerConnection)it.next(); if (isRegisteredObjectClosed(sc)) { result--; it.remove(); try { finishCon(sc); } catch (CancelException e) { if (cce == null) { cce = e; } } } } // while } if (cce != null) { throw cce; } return result; }
private int checkRegisteredKeys(int count) { int result = count; CancelException cce = null; if (count > 0) { Iterator it = this.selectorRegistrations.iterator(); while (it.hasNext()) { ServerConnection sc = (ServerConnection)it.next(); if (isRegisteredObjectClosed(sc)) { result--; it.remove(); try { finishCon(sc); } catch (CancelException e) { if (cce == null) { cce = e; } } } } // while } if (cce != null) { throw cce; } return result; }
public void registerSC(ServerConnection sc) { synchronized (this.syncLock) { if (!isRunning()) { finishCon(sc); return; } } getSelectorQueue().offer(sc); wakeupSelector(); }
public void registerSC(ServerConnection sc) { synchronized (this.syncLock) { if (!isRunning()) { finishCon(sc); return; } } getSelectorQueue().offer(sc); wakeupSelector(); }
finishCon(sc); } catch (IOException ex) { finishCon(sc); logger.warn(LocalizedMessage.create(LocalizedStrings.AcceptorImpl_IGNORING, ex)); } catch (RuntimeException ex) { finishCon(sc); logger.warn(LocalizedMessage.create(LocalizedStrings.AcceptorImpl_IGNORING, ex)); finishCon(sc); continue; } catch (IOException ex) { finishCon(sc); if(isRunning()) { logger.warn(LocalizedMessage.create(LocalizedStrings.AcceptorImpl_UNEXPECTED, ex)); AcceptorImpl.this.pool.execute(sc); } catch (RejectedExecutionException rejected) { finishCon(sc); AcceptorImpl.this.stats.decThreadQueueSize(); if (!isRunning()) { finishCon(sc); if (key.isValid()) { logger.warn(LocalizedMessage.create(LocalizedStrings.AcceptorImpl_IGNORING_EVENT_ON_SELECTOR_KEY__0, key)); finishCon(sc);
finishCon(sc); continue; } catch (IOException ex) { finishCon(sc); if(isRunning()) { logger.warn(LocalizedMessage.create(LocalizedStrings.AcceptorImpl_UNEXPECTED_EXCEPTION, ex)); AcceptorImpl.this.pool.execute(sc); } catch (RejectedExecutionException rejected) { finishCon(sc); AcceptorImpl.this.stats.decThreadQueueSize(); if (!isRunning()) { finishCon(sc); continue; } catch (IOException ex) {
finishCon(sc); continue; } catch (IOException ex) { finishCon(sc); if(isRunning()) { if(logger.warningEnabled()) { AcceptorImpl.this.pool.execute(sc); } catch (RejectedExecutionException rejected) { finishCon(sc); AcceptorImpl.this.stats.decThreadQueueSize(); if (!isRunning()) { finishCon(sc); continue; } catch (IOException ex) {
finishCon(sc); } catch (IOException ex) { finishCon(sc); if (logger.warningEnabled()) { logger.warning(LocalizedStrings.AcceptorImpl_IGNORING, ex); finishCon(sc); if (logger.warningEnabled()) { logger.warning(LocalizedStrings.AcceptorImpl_IGNORING, ex); finishCon(sc); continue; } catch (IOException ex) { finishCon(sc); if(isRunning()) { if(logger.warningEnabled()) { AcceptorImpl.this.pool.execute(sc); } catch (RejectedExecutionException rejected) { finishCon(sc); AcceptorImpl.this.stats.decThreadQueueSize(); if (!isRunning()) { finishCon(sc); if (key.isValid()) { logger.warning(LocalizedStrings.AcceptorImpl_IGNORING_EVENT_ON_SELECTOR_KEY__0, key); finishCon(sc);