/** * Check if there was any {@link Throwable} received and if so rethrow it. */ public void checkException() { checkException(voidPromise()); }
/** * Ensure the {@link Channel} is open and if not throw an exception. */ protected final void ensureOpen() { if (!checkOpen(true)) { checkException(); } }
/** * Check if there was any {@link Throwable} received and if so rethrow it. */ public void checkException() { checkException(voidPromise()); }
/** * Ensure the {@link Channel} is open and if not throw an exception. */ protected final void ensureOpen() { if (!checkOpen(true)) { checkException(); } }
/** * Check if there was any {@link Throwable} received and if so rethrow it. */ public void checkException() { checkException(voidPromise()); }
/** * Ensure the {@link Channel} is open and if not throw an exception. */ protected final void ensureOpen() { if (!checkOpen(true)) { checkException(); } }
/** * Writes one message to the outbound of this {@link Channel} and does not flush it. This * method is conceptually equivalent to {@link #write(Object, ChannelPromise)}. * * @see #writeOneInbound(Object, ChannelPromise) */ public ChannelFuture writeOneOutbound(Object msg, ChannelPromise promise) { if (checkOpen(true)) { return write(msg, promise); } return checkException(promise); }
/** * Writes one message to the outbound of this {@link Channel} and does not flush it. This * method is conceptually equivalent to {@link #write(Object, ChannelPromise)}. * * @see #writeOneInbound(Object, ChannelPromise) */ public ChannelFuture writeOneOutbound(Object msg, ChannelPromise promise) { if (checkOpen(true)) { return write(msg, promise); } return checkException(promise); }
/** * Writes one message to the inbound of this {@link Channel} and does not flush it. This * method is conceptually equivalent to {@link #write(Object, ChannelPromise)}. * * @see #writeOneOutbound(Object, ChannelPromise) */ public ChannelFuture writeOneInbound(Object msg, ChannelPromise promise) { if (checkOpen(true)) { pipeline().fireChannelRead(msg); } return checkException(promise); }
/** * Flushes the outbound of this {@link Channel}. This method is conceptually equivalent to {@link #flush()}. * * @see #flushInbound() */ public EmbeddedChannel flushOutbound() { if (checkOpen(true)) { flushOutbound0(); } checkException(voidPromise()); return this; }
/** * Writes one message to the outbound of this {@link Channel} and does not flush it. This * method is conceptually equivalent to {@link #write(Object, ChannelPromise)}. * * @see #writeOneInbound(Object, ChannelPromise) */ public ChannelFuture writeOneOutbound(Object msg, ChannelPromise promise) { if (checkOpen(true)) { return write(msg, promise); } return checkException(promise); }
/** * Flushes the outbound of this {@link Channel}. This method is conceptually equivalent to {@link #flush()}. * * @see #flushInbound() */ public EmbeddedChannel flushOutbound() { if (checkOpen(true)) { flushOutbound0(); } checkException(voidPromise()); return this; }
/** * Writes one message to the inbound of this {@link Channel} and does not flush it. This * method is conceptually equivalent to {@link #write(Object, ChannelPromise)}. * * @see #writeOneOutbound(Object, ChannelPromise) */ public ChannelFuture writeOneInbound(Object msg, ChannelPromise promise) { if (checkOpen(true)) { pipeline().fireChannelRead(msg); } return checkException(promise); }
private ChannelFuture flushInbound(boolean recordException, ChannelPromise promise) { if (checkOpen(recordException)) { pipeline().fireChannelReadComplete(); runPendingTasks(); } return checkException(promise); }
private ChannelFuture flushInbound(boolean recordException, ChannelPromise promise) { if (checkOpen(recordException)) { pipeline().fireChannelReadComplete(); runPendingTasks(); } return checkException(promise); }
/** * Flushes the outbound of this {@link Channel}. This method is conceptually equivalent to {@link #flush()}. * * @see #flushInbound() */ public EmbeddedChannel flushOutbound() { if (checkOpen(true)) { flushOutbound0(); } checkException(voidPromise()); return this; }
/** * Writes one message to the inbound of this {@link Channel} and does not flush it. This * method is conceptually equivalent to {@link #write(Object, ChannelPromise)}. * * @see #writeOneOutbound(Object, ChannelPromise) */ public ChannelFuture writeOneInbound(Object msg, ChannelPromise promise) { if (checkOpen(true)) { pipeline().fireChannelRead(msg); } return checkException(promise); }
/** * Mark this {@link Channel} as finished. Any further try to write data to it will fail. * * @param releaseAll if {@code true} all pending message in the inbound and outbound buffer are released. * @return bufferReadable returns {@code true} if any of the used buffers has something left to read */ private boolean finish(boolean releaseAll) { close(); try { checkException(); return isNotEmpty(inboundMessages) || isNotEmpty(outboundMessages); } finally { if (releaseAll) { releaseAll(inboundMessages); releaseAll(outboundMessages); } } }
private ChannelFuture flushInbound(boolean recordException, ChannelPromise promise) { if (checkOpen(recordException)) { pipeline().fireChannelReadComplete(); runPendingTasks(); } return checkException(promise); }
/** * Mark this {@link Channel} as finished. Any further try to write data to it will fail. * * @param releaseAll if {@code true} all pending message in the inbound and outbound buffer are released. * @return bufferReadable returns {@code true} if any of the used buffers has something left to read */ private boolean finish(boolean releaseAll) { close(); try { checkException(); return isNotEmpty(inboundMessages) || isNotEmpty(outboundMessages); } finally { if (releaseAll) { releaseAll(inboundMessages); releaseAll(outboundMessages); } } }