/** * TODO Add method documentation */ public final void offerFailedReadFuture(Throwable exception) { newReadFuture().setException(exception); }
/** * Associates a message to a ReadFuture * * @param message the message to associate to the ReadFuture * */ public final void offerReadFuture(Object message) { newReadFuture().setRead(message); }
/** * Inform the ReadFuture that the session has been closed */ public final void offerClosedReadFuture() { Queue<ReadFuture> readyReadFutures = getReadyReadFutures(); synchronized (readyReadFutures) { newReadFuture().setClosed(); } }
/** * {@inheritDoc} */ public final ReadFuture read() { if (!getConfig().isUseReadOperation()) { throw new IllegalStateException("useReadOperation is not enabled."); } Queue<ReadFuture> readyReadFutures = getReadyReadFutures(); ReadFuture future; synchronized (readyReadFutures) { future = readyReadFutures.poll(); if (future != null) { if (future.isClosed()) { // Let other readers get notified. readyReadFutures.offer(future); } } else { future = new DefaultReadFuture(this); getWaitingReadFutures().offer(future); } } return future; }
/** * TODO Add method documentation */ public final void offerClosedReadFuture() { Queue<ReadFuture> readyReadFutures = getReadyReadFutures(); synchronized (readyReadFutures) { newReadFuture().setClosed(); } }
/** * {@inheritDoc} */ public final ReadFuture read() { if (!getConfig().isUseReadOperation()) { throw new IllegalStateException("useReadOperation is not enabled."); } Queue<ReadFuture> readyReadFutures = getReadyReadFutures(); ReadFuture future; synchronized (readyReadFutures) { future = readyReadFutures.poll(); if (future != null) { if (future.isClosed()) { // Let other readers get notified. readyReadFutures.offer(future); } } else { future = new DefaultReadFuture(this); getWaitingReadFutures().offer(future); } } return future; }
/** * Inform the ReadFuture that the session has been closed */ public final void offerClosedReadFuture() { Queue<ReadFuture> readyReadFutures = getReadyReadFutures(); synchronized (readyReadFutures) { newReadFuture().setClosed(); } }
/** * Associates a message to a ReadFuture * * @param message the message to associate to the ReadFuture * */ public final void offerReadFuture(Object message) { newReadFuture().setRead(message); }
/** * Associates a failure to a ReadFuture * * @param exception the exception to associate to the ReadFuture */ public final void offerFailedReadFuture(Throwable exception) { newReadFuture().setException(exception); }
/** * {@inheritDoc} */ public final ReadFuture read() { if (!getConfig().isUseReadOperation()) { throw new IllegalStateException("useReadOperation is not enabled."); } Queue<ReadFuture> readyReadFutures = getReadyReadFutures(); ReadFuture future; synchronized (readyReadFutures) { future = readyReadFutures.poll(); if (future != null) { if (future.isClosed()) { // Let other readers get notified. readyReadFutures.offer(future); } } else { future = new DefaultReadFuture(this); getWaitingReadFutures().offer(future); } } return future; }
/** * TODO Add method documentation */ public final void offerClosedReadFuture() { Queue<ReadFuture> readyReadFutures = getReadyReadFutures(); synchronized (readyReadFutures) { newReadFuture().setClosed(); } }
/** * TODO Add method documentation */ public final void offerReadFuture(Object message) { newReadFuture().setRead(message); }
/** * TODO Add method documentation */ public final void offerFailedReadFuture(Throwable exception) { newReadFuture().setException(exception); }
/** * {@inheritDoc} */ @Override public final ReadFuture read() { if (!getConfig().isUseReadOperation()) { throw new IllegalStateException("useReadOperation is not enabled."); } Queue<ReadFuture> readyReadFutures = getReadyReadFutures(); ReadFuture future; synchronized (readyReadFutures) { future = readyReadFutures.poll(); if (future != null) { if (future.isClosed()) { // Let other readers get notified. readyReadFutures.offer(future); } } else { future = new DefaultReadFuture(this); getWaitingReadFutures().offer(future); } } return future; }
/** * TODO Add method documentation */ public final void offerReadFuture(Object message) { newReadFuture().setRead(message); }
/** * Associates a failure to a ReadFuture * * @param exception the exception to associate to the ReadFuture */ public final void offerFailedReadFuture(Throwable exception) { newReadFuture().setException(exception); }