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;
    }
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 ( ) ) { readyReadFutures . offer ( future ) ; } } else { future = new DefaultReadFuture ( this ) ; getWaitingReadFutures ( ) . offer ( future ) ; } } return future ; }
{@inheritDoc}