@Override public synchronized void flush() throws IOException { final Connection c = feedableBodyGenerator.context.getConnection(); if (isReady()) { boolean notReady = writeUntilFullOrDone(c); if (!isDone()) { if (notReady) { notifyReadyToFeed(new ReadyToFeedListenerImpl()); } else { // write queue is full, leverage WriteListener to let us know // when it is safe to write again. c.notifyCanWrite(new WriteHandlerImpl()); } } } else { notifyReadyToFeed(new ReadyToFeedListenerImpl()); } }
@Override public synchronized void flush() throws IOException { final Connection c = feedableBodyGenerator.context.getConnection(); if (isReady()) { boolean notReady = writeUntilFullOrDone(c); if (!isDone()) { if (notReady) { notifyReadyToFeed(new ReadyToFeedListenerImpl()); } else { // write queue is full, leverage WriteListener to let us know // when it is safe to write again. c.notifyCanWrite(new WriteHandlerImpl()); } } } else { notifyReadyToFeed(new ReadyToFeedListenerImpl()); } }
@Override public synchronized void flush() throws IOException { final Connection c = feedableBodyGenerator.context.getConnection(); if (isReady()) { boolean notReady = writeUntilFullOrDone(c); if (!isDone()) { if (notReady) { notifyReadyToFeed(new ReadyToFeedListenerImpl()); } else { // write queue is full, leverage WriteListener to let us know // when it is safe to write again. c.notifyCanWrite(new WriteHandlerImpl()); } } } else { notifyReadyToFeed(new ReadyToFeedListenerImpl()); } }
@Override public synchronized void flush() throws IOException { final Connection c = feedableBodyGenerator.context.getConnection(); if (isReady()) { boolean notReady = writeUntilFullOrDone(c); if (!isDone()) { if (notReady) { notifyReadyToFeed(new ReadyToFeedListenerImpl()); } else { // write queue is full, leverage WriteListener to let us know // when it is safe to write again. c.notifyCanWrite(new WriteHandlerImpl()); } } } else { notifyReadyToFeed(new ReadyToFeedListenerImpl()); } }