Interface ChannelPipeline
-
- All Superinterfaces:
ChannelInboundInvoker,ChannelOutboundInvoker,java.lang.Iterable<java.util.Map.Entry<java.lang.String,ChannelHandler>>
- All Known Implementing Classes:
DefaultChannelPipeline
public interface ChannelPipeline extends ChannelInboundInvoker, ChannelOutboundInvoker, java.lang.Iterable<java.util.Map.Entry<java.lang.String,ChannelHandler>>
A list ofChannelHandlers which handles or intercepts inbound events and outbound operations of aChannel.ChannelPipelineimplements an advanced form of the Intercepting Filter pattern to give a user full control over how an event is handled and how theChannelHandlers in a pipeline interact with each other.Creation of a pipeline
Each channel has its own pipeline and it is created automatically when a new channel is created.How an event flows in a pipeline
The following diagram describes how I/O events are processed byChannelHandlers in aChannelPipelinetypically. An I/O event is handled by either aChannelInboundHandleror aChannelOutboundHandlerand be forwarded to its closest handler by calling the event propagation methods defined inChannelHandlerContext, such asChannelHandlerContext.fireChannelRead(Object)andChannelOutboundInvoker.write(Object).I/O Request viaAn inbound event is handled by the inbound handlers in the bottom-up direction as shown on the left side of the diagram. An inbound handler usually handles the inbound data generated by the I/O thread on the bottom of the diagram. The inbound data is often read from a remote peer via the actual input operation such asChannelorChannelHandlerContext| +---------------------------------------------------+---------------+ | ChannelPipeline | | | \|/ | | +---------------------+ +-----------+----------+ | | | Inbound Handler N | | Outbound Handler 1 | | | +----------+----------+ +-----------+----------+ | | /|\ | | | | \|/ | | +----------+----------+ +-----------+----------+ | | | Inbound Handler N-1 | | Outbound Handler 2 | | | +----------+----------+ +-----------+----------+ | | /|\ . | | . . | | ChannelHandlerContext.fireIN_EVT() ChannelHandlerContext.OUT_EVT()| | [ method call] [method call] | | . . | | . \|/ | | +----------+----------+ +-----------+----------+ | | | Inbound Handler 2 | | Outbound Handler M-1 | | | +----------+----------+ +-----------+----------+ | | /|\ | | | | \|/ | | +----------+----------+ +-----------+----------+ | | | Inbound Handler 1 | | Outbound Handler M | | | +----------+----------+ +-----------+----------+ | | /|\ | | +---------------+-----------------------------------+---------------+ | \|/ +---------------+-----------------------------------+---------------+ | | | | | [ Socket.read() ] [ Socket.write() ] | | | | Netty Internal I/O Threads (Transport Implementation) | +-------------------------------------------------------------------+SocketChannel.read(ByteBuffer). If an inbound event goes beyond the top inbound handler, it is discarded silently, or logged if it needs your attention.An outbound event is handled by the outbound handler in the top-down direction as shown on the right side of the diagram. An outbound handler usually generates or transforms the outbound traffic such as write requests. If an outbound event goes beyond the bottom outbound handler, it is handled by an I/O thread associated with the
Channel. The I/O thread often performs the actual output operation such asSocketChannel.write(ByteBuffer).For example, let us assume that we created the following pipeline:
In the example above, the class whose name starts withChannelPipelinep = ...; p.addLast("1", new InboundHandlerA()); p.addLast("2", new InboundHandlerB()); p.addLast("3", new OutboundHandlerA()); p.addLast("4", new OutboundHandlerB()); p.addLast("5", new InboundOutboundHandlerX());Inboundmeans it is an inbound handler. The class whose name starts withOutboundmeans it is a outbound handler.In the given example configuration, the handler evaluation order is 1, 2, 3, 4, 5 when an event goes inbound. When an event goes outbound, the order is 5, 4, 3, 2, 1. On top of this principle,
ChannelPipelineskips the evaluation of certain handlers to shorten the stack depth:- 3 and 4 don't implement
ChannelInboundHandler, and therefore the actual evaluation order of an inbound event will be: 1, 2, and 5. - 1 and 2 don't implement
ChannelOutboundHandler, and therefore the actual evaluation order of a outbound event will be: 5, 4, and 3. - If 5 implements both
ChannelInboundHandlerandChannelOutboundHandler, the evaluation order of an inbound and a outbound event could be 125 and 543 respectively.
Forwarding an event to the next handler
As you might noticed in the diagram shows, a handler has to invoke the event propagation methods inChannelHandlerContextto forward an event to its next handler. Those methods include:- Inbound event propagation methods:
ChannelHandlerContext.fireChannelRegistered()ChannelHandlerContext.fireChannelActive()ChannelHandlerContext.fireChannelRead(Object)ChannelHandlerContext.fireChannelReadComplete()ChannelHandlerContext.fireExceptionCaught(Throwable)ChannelHandlerContext.fireUserEventTriggered(Object)ChannelHandlerContext.fireChannelWritabilityChanged()ChannelHandlerContext.fireChannelInactive()ChannelHandlerContext.fireChannelUnregistered()
- Outbound event propagation methods:
ChannelOutboundInvoker.bind(SocketAddress, ChannelPromise)ChannelOutboundInvoker.connect(SocketAddress, SocketAddress, ChannelPromise)ChannelOutboundInvoker.write(Object, ChannelPromise)ChannelHandlerContext.flush()ChannelHandlerContext.read()ChannelOutboundInvoker.disconnect(ChannelPromise)ChannelOutboundInvoker.close(ChannelPromise)ChannelOutboundInvoker.deregister(ChannelPromise)
public class MyInboundHandler extends
ChannelInboundHandlerAdapter{@Overridepublic void channelActive(ChannelHandlerContextctx) { System.out.println("Connected!"); ctx.fireChannelActive(); } } public class MyOutboundHandler extendsChannelOutboundHandlerAdapter{@Overridepublic void close(ChannelHandlerContextctx,ChannelPromisepromise) { System.out.println("Closing .."); ctx.close(promise); } }Building a pipeline
A user is supposed to have one or more
ChannelHandlers in a pipeline to receive I/O events (e.g. read) and to request I/O operations (e.g. write and close). For example, a typical server will have the following handlers in each channel's pipeline, but your mileage may vary depending on the complexity and characteristics of the protocol and business logic:- Protocol Decoder - translates binary data (e.g.
ByteBuf) into a Java object. - Protocol Encoder - translates a Java object into binary data.
- Business Logic Handler - performs the actual business logic.
...
ChannelPipelinepipeline = ch.pipeline(); pipeline.addLast("decoder", new MyProtocolDecoder()); pipeline.addLast("encoder", new MyProtocolEncoder()); pipeline.addLast("handler", new MyBusinessLogicHandler());Thread safety
A
ChannelHandlercan be added or removed at any time because aChannelPipelineis thread safe. For example, you can insert an encryption handler when sensitive information is about to be exchanged, and remove it after the exchange.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description ChannelPipelineaddAfter(EventExecutorGroup group, java.lang.String baseName, java.lang.String name, ChannelHandler handler)Deprecated.ChannelPipelineaddAfter(java.lang.String baseName, java.lang.String name, ChannelHandler handler)Inserts aChannelHandlerafter an existing handler of this pipeline.ChannelPipelineaddBefore(EventExecutorGroup group, java.lang.String baseName, java.lang.String name, ChannelHandler handler)Deprecated.ChannelPipelineaddBefore(java.lang.String baseName, java.lang.String name, ChannelHandler handler)Inserts aChannelHandlerbefore an existing handler of this pipeline.ChannelPipelineaddFirst(ChannelHandler... handlers)InsertsChannelHandlers at the first position of this pipeline.ChannelPipelineaddFirst(EventExecutorGroup group, ChannelHandler... handlers)Deprecated.ChannelPipelineaddFirst(EventExecutorGroup group, java.lang.String name, ChannelHandler handler)Deprecated.ChannelPipelineaddFirst(java.lang.String name, ChannelHandler handler)Inserts aChannelHandlerat the first position of this pipeline.ChannelPipelineaddLast(ChannelHandler... handlers)InsertsChannelHandlers at the last position of this pipeline.ChannelPipelineaddLast(EventExecutorGroup group, ChannelHandler... handlers)Deprecated.ChannelPipelineaddLast(EventExecutorGroup group, java.lang.String name, ChannelHandler handler)Deprecated.ChannelPipelineaddLast(java.lang.String name, ChannelHandler handler)Appends aChannelHandlerat the last position of this pipeline.Channelchannel()Returns theChannelthat this pipeline is attached to.ChannelHandlerContextcontext(ChannelHandler handler)Returns the context object of the specifiedChannelHandlerin this pipeline.ChannelHandlerContextcontext(java.lang.Class<? extends ChannelHandler> handlerType)Returns the context object of theChannelHandlerof the specified type in this pipeline.ChannelHandlerContextcontext(java.lang.String name)Returns the context object of theChannelHandlerwith the specified name in this pipeline.ChannelPipelinefireChannelActive()AChannelis active now, which means it is connected.ChannelPipelinefireChannelInactive()AChannelis inactive now, which means it is closed.ChannelPipelinefireChannelRead(java.lang.Object msg)AChannelreceived a message.ChannelPipelinefireChannelReadComplete()Triggers anChannelInboundHandler.channelReadComplete(ChannelHandlerContext)event to the nextChannelInboundHandlerin theChannelPipeline.ChannelPipelinefireChannelRegistered()ChannelPipelinefireChannelUnregistered()ChannelPipelinefireChannelWritabilityChanged()Triggers anChannelInboundHandler.channelWritabilityChanged(ChannelHandlerContext)event to the nextChannelInboundHandlerin theChannelPipeline.ChannelPipelinefireExceptionCaught(java.lang.Throwable cause)AChannelreceived anThrowablein one of its inbound operations.ChannelPipelinefireUserEventTriggered(java.lang.Object event)AChannelreceived an user defined event.ChannelHandlerfirst()Returns the firstChannelHandlerin this pipeline.ChannelHandlerContextfirstContext()Returns the context of the firstChannelHandlerin this pipeline.ChannelPipelineflush()Request to flush all pending messages via this ChannelOutboundInvoker.<T extends ChannelHandler>
Tget(java.lang.Class<T> handlerType)Returns theChannelHandlerof the specified type in this pipeline.ChannelHandlerget(java.lang.String name)Returns theChannelHandlerwith the specified name in this pipeline.ChannelHandlerlast()Returns the lastChannelHandlerin this pipeline.ChannelHandlerContextlastContext()Returns the context of the lastChannelHandlerin this pipeline.java.util.List<java.lang.String>names()Returns theListof the handler names.default ChannelFuturenewFailedFuture(java.lang.Throwable cause)Create a newChannelFuturewhich is marked as failed already.default ChannelProgressivePromisenewProgressivePromise()Return an newChannelProgressivePromisedefault ChannelPromisenewPromise()Return a newChannelPromise.ChannelPipelineremove(ChannelHandler handler)Removes the specifiedChannelHandlerfrom this pipeline.<T extends ChannelHandler>
Tremove(java.lang.Class<T> handlerType)Removes theChannelHandlerof the specified type from this pipeline.ChannelHandlerremove(java.lang.String name)Removes theChannelHandlerwith the specified name from this pipeline.ChannelHandlerremoveFirst()Removes the firstChannelHandlerin this pipeline.ChannelHandlerremoveLast()Removes the lastChannelHandlerin this pipeline.ChannelPipelinereplace(ChannelHandler oldHandler, java.lang.String newName, ChannelHandler newHandler)Replaces the specifiedChannelHandlerwith a new handler in this pipeline.<T extends ChannelHandler>
Treplace(java.lang.Class<T> oldHandlerType, java.lang.String newName, ChannelHandler newHandler)Replaces theChannelHandlerof the specified type with a new handler in this pipeline.ChannelHandlerreplace(java.lang.String oldName, java.lang.String newName, ChannelHandler newHandler)Replaces theChannelHandlerof the specified name with a new handler in this pipeline.java.util.Map<java.lang.String,ChannelHandler>toMap()Converts this pipeline into an orderedMapwhose keys are handler names and whose values are handlers.-
Methods inherited from interface io.netty.channel.ChannelOutboundInvoker
bind, bind, close, close, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, newSucceededFuture, read, voidPromise, write, write, writeAndFlush, writeAndFlush
-
-
-
-
Method Detail
-
addFirst
ChannelPipeline addFirst(java.lang.String name, ChannelHandler handler)
Inserts aChannelHandlerat the first position of this pipeline.- Parameters:
name- the name of the handler to insert firsthandler- the handler to insert first- Throws:
java.lang.IllegalArgumentException- if there's an entry with the same name already in the pipelinejava.lang.NullPointerException- if the specified handler isnull
-
addFirst
@Deprecated ChannelPipeline addFirst(EventExecutorGroup group, java.lang.String name, ChannelHandler handler)
Deprecated.Inserts aChannelHandlerat the first position of this pipeline.- Parameters:
group- theEventExecutorGroupwhich will be used to execute theChannelHandlermethodsname- the name of the handler to insert firsthandler- the handler to insert first- Throws:
java.lang.IllegalArgumentException- if there's an entry with the same name already in the pipelinejava.lang.NullPointerException- if the specified handler isnull
-
addLast
ChannelPipeline addLast(java.lang.String name, ChannelHandler handler)
Appends aChannelHandlerat the last position of this pipeline.- Parameters:
name- the name of the handler to appendhandler- the handler to append- Throws:
java.lang.IllegalArgumentException- if there's an entry with the same name already in the pipelinejava.lang.NullPointerException- if the specified handler isnull
-
addLast
@Deprecated ChannelPipeline addLast(EventExecutorGroup group, java.lang.String name, ChannelHandler handler)
Deprecated.Appends aChannelHandlerat the last position of this pipeline.- Parameters:
group- theEventExecutorGroupwhich will be used to execute theChannelHandlermethodsname- the name of the handler to appendhandler- the handler to append- Throws:
java.lang.IllegalArgumentException- if there's an entry with the same name already in the pipelinejava.lang.NullPointerException- if the specified handler isnull
-
addBefore
ChannelPipeline addBefore(java.lang.String baseName, java.lang.String name, ChannelHandler handler)
Inserts aChannelHandlerbefore an existing handler of this pipeline.- Parameters:
baseName- the name of the existing handlername- the name of the handler to insert beforehandler- the handler to insert before- Throws:
java.util.NoSuchElementException- if there's no such entry with the specifiedbaseNamejava.lang.IllegalArgumentException- if there's an entry with the same name already in the pipelinejava.lang.NullPointerException- if the specified baseName or handler isnull
-
addBefore
@Deprecated ChannelPipeline addBefore(EventExecutorGroup group, java.lang.String baseName, java.lang.String name, ChannelHandler handler)
Deprecated.Inserts aChannelHandlerbefore an existing handler of this pipeline.- Parameters:
group- theEventExecutorGroupwhich will be used to execute theChannelHandlermethodsbaseName- the name of the existing handlername- the name of the handler to insert beforehandler- the handler to insert before- Throws:
java.util.NoSuchElementException- if there's no such entry with the specifiedbaseNamejava.lang.IllegalArgumentException- if there's an entry with the same name already in the pipelinejava.lang.NullPointerException- if the specified baseName or handler isnull
-
addAfter
ChannelPipeline addAfter(java.lang.String baseName, java.lang.String name, ChannelHandler handler)
Inserts aChannelHandlerafter an existing handler of this pipeline.- Parameters:
baseName- the name of the existing handlername- the name of the handler to insert afterhandler- the handler to insert after- Throws:
java.util.NoSuchElementException- if there's no such entry with the specifiedbaseNamejava.lang.IllegalArgumentException- if there's an entry with the same name already in the pipelinejava.lang.NullPointerException- if the specified baseName or handler isnull
-
addAfter
@Deprecated ChannelPipeline addAfter(EventExecutorGroup group, java.lang.String baseName, java.lang.String name, ChannelHandler handler)
Deprecated.Inserts aChannelHandlerafter an existing handler of this pipeline.- Parameters:
group- theEventExecutorGroupwhich will be used to execute theChannelHandlermethodsbaseName- the name of the existing handlername- the name of the handler to insert afterhandler- the handler to insert after- Throws:
java.util.NoSuchElementException- if there's no such entry with the specifiedbaseNamejava.lang.IllegalArgumentException- if there's an entry with the same name already in the pipelinejava.lang.NullPointerException- if the specified baseName or handler isnull
-
addFirst
ChannelPipeline addFirst(ChannelHandler... handlers)
InsertsChannelHandlers at the first position of this pipeline.- Parameters:
handlers- the handlers to insert first
-
addFirst
@Deprecated ChannelPipeline addFirst(EventExecutorGroup group, ChannelHandler... handlers)
Deprecated.InsertsChannelHandlers at the first position of this pipeline.- Parameters:
group- theEventExecutorGroupwhich will be used to execute theChannelHandlers methods.handlers- the handlers to insert first
-
addLast
ChannelPipeline addLast(ChannelHandler... handlers)
InsertsChannelHandlers at the last position of this pipeline.- Parameters:
handlers- the handlers to insert last
-
addLast
@Deprecated ChannelPipeline addLast(EventExecutorGroup group, ChannelHandler... handlers)
Deprecated.InsertsChannelHandlers at the last position of this pipeline.- Parameters:
group- theEventExecutorGroupwhich will be used to execute theChannelHandlers methods.handlers- the handlers to insert last
-
remove
ChannelPipeline remove(ChannelHandler handler)
Removes the specifiedChannelHandlerfrom this pipeline.- Parameters:
handler- theChannelHandlerto remove- Throws:
java.util.NoSuchElementException- if there's no such handler in this pipelinejava.lang.NullPointerException- if the specified handler isnull
-
remove
ChannelHandler remove(java.lang.String name)
Removes theChannelHandlerwith the specified name from this pipeline.- Parameters:
name- the name under which theChannelHandlerwas stored.- Returns:
- the removed handler
- Throws:
java.util.NoSuchElementException- if there's no such handler with the specified name in this pipelinejava.lang.NullPointerException- if the specified name isnull
-
remove
<T extends ChannelHandler> T remove(java.lang.Class<T> handlerType)
Removes theChannelHandlerof the specified type from this pipeline.- Type Parameters:
T- the type of the handler- Parameters:
handlerType- the type of the handler- Returns:
- the removed handler
- Throws:
java.util.NoSuchElementException- if there's no such handler of the specified type in this pipelinejava.lang.NullPointerException- if the specified handler type isnull
-
removeFirst
ChannelHandler removeFirst()
Removes the firstChannelHandlerin this pipeline.- Returns:
- the removed handler
- Throws:
java.util.NoSuchElementException- if this pipeline is empty
-
removeLast
ChannelHandler removeLast()
Removes the lastChannelHandlerin this pipeline.- Returns:
- the removed handler
- Throws:
java.util.NoSuchElementException- if this pipeline is empty
-
replace
ChannelPipeline replace(ChannelHandler oldHandler, java.lang.String newName, ChannelHandler newHandler)
Replaces the specifiedChannelHandlerwith a new handler in this pipeline.- Parameters:
oldHandler- theChannelHandlerto be replacednewName- the name under which the replacement should be addednewHandler- theChannelHandlerwhich is used as replacement- Returns:
- itself
- Throws:
java.util.NoSuchElementException- if the specified old handler does not exist in this pipelinejava.lang.IllegalArgumentException- if a handler with the specified new name already exists in this pipeline, except for the handler to be replacedjava.lang.NullPointerException- if the specified old handler or new handler isnull
-
replace
ChannelHandler replace(java.lang.String oldName, java.lang.String newName, ChannelHandler newHandler)
Replaces theChannelHandlerof the specified name with a new handler in this pipeline.- Parameters:
oldName- the name of theChannelHandlerto be replacednewName- the name under which the replacement should be addednewHandler- theChannelHandlerwhich is used as replacement- Returns:
- the removed handler
- Throws:
java.util.NoSuchElementException- if the handler with the specified old name does not exist in this pipelinejava.lang.IllegalArgumentException- if a handler with the specified new name already exists in this pipeline, except for the handler to be replacedjava.lang.NullPointerException- if the specified old handler or new handler isnull
-
replace
<T extends ChannelHandler> T replace(java.lang.Class<T> oldHandlerType, java.lang.String newName, ChannelHandler newHandler)
Replaces theChannelHandlerof the specified type with a new handler in this pipeline.- Parameters:
oldHandlerType- the type of the handler to be removednewName- the name under which the replacement should be addednewHandler- theChannelHandlerwhich is used as replacement- Returns:
- the removed handler
- Throws:
java.util.NoSuchElementException- if the handler of the specified old handler type does not exist in this pipelinejava.lang.IllegalArgumentException- if a handler with the specified new name already exists in this pipeline, except for the handler to be replacedjava.lang.NullPointerException- if the specified old handler or new handler isnull
-
first
ChannelHandler first()
Returns the firstChannelHandlerin this pipeline.- Returns:
- the first handler.
nullif this pipeline is empty.
-
firstContext
ChannelHandlerContext firstContext()
Returns the context of the firstChannelHandlerin this pipeline.- Returns:
- the context of the first handler.
nullif this pipeline is empty.
-
last
ChannelHandler last()
Returns the lastChannelHandlerin this pipeline.- Returns:
- the last handler.
nullif this pipeline is empty.
-
lastContext
ChannelHandlerContext lastContext()
Returns the context of the lastChannelHandlerin this pipeline.- Returns:
- the context of the last handler.
nullif this pipeline is empty.
-
get
ChannelHandler get(java.lang.String name)
Returns theChannelHandlerwith the specified name in this pipeline.- Returns:
- the handler with the specified name.
nullif there's no such handler in this pipeline.
-
get
<T extends ChannelHandler> T get(java.lang.Class<T> handlerType)
Returns theChannelHandlerof the specified type in this pipeline.- Returns:
- the handler of the specified handler type.
nullif there's no such handler in this pipeline.
-
context
ChannelHandlerContext context(ChannelHandler handler)
Returns the context object of the specifiedChannelHandlerin this pipeline.- Returns:
- the context object of the specified handler.
nullif there's no such handler in this pipeline.
-
context
ChannelHandlerContext context(java.lang.String name)
Returns the context object of theChannelHandlerwith the specified name in this pipeline.- Returns:
- the context object of the handler with the specified name.
nullif there's no such handler in this pipeline.
-
context
ChannelHandlerContext context(java.lang.Class<? extends ChannelHandler> handlerType)
Returns the context object of theChannelHandlerof the specified type in this pipeline.- Returns:
- the context object of the handler of the specified type.
nullif there's no such handler in this pipeline.
-
channel
Channel channel()
Returns theChannelthat this pipeline is attached to.- Returns:
- the channel.
nullif this pipeline is not attached yet.
-
names
java.util.List<java.lang.String> names()
Returns theListof the handler names.
-
toMap
java.util.Map<java.lang.String,ChannelHandler> toMap()
Converts this pipeline into an orderedMapwhose keys are handler names and whose values are handlers.
-
fireChannelRegistered
ChannelPipeline fireChannelRegistered()
Description copied from interface:ChannelInboundInvokerAChannelwas registered to itsEventLoop. This will result in having theChannelInboundHandler.channelRegistered(ChannelHandlerContext)method called of the nextChannelInboundHandlercontained in theChannelPipelineof theChannel.- Specified by:
fireChannelRegisteredin interfaceChannelInboundInvoker
-
fireChannelUnregistered
ChannelPipeline fireChannelUnregistered()
Description copied from interface:ChannelInboundInvokerAChannelwas unregistered from itsEventLoop. This will result in having theChannelInboundHandler.channelUnregistered(ChannelHandlerContext)method called of the nextChannelInboundHandlercontained in theChannelPipelineof theChannel.- Specified by:
fireChannelUnregisteredin interfaceChannelInboundInvoker
-
fireChannelActive
ChannelPipeline fireChannelActive()
Description copied from interface:ChannelInboundInvokerAChannelis active now, which means it is connected. This will result in having theChannelInboundHandler.channelActive(ChannelHandlerContext)method called of the nextChannelInboundHandlercontained in theChannelPipelineof theChannel.- Specified by:
fireChannelActivein interfaceChannelInboundInvoker
-
fireChannelInactive
ChannelPipeline fireChannelInactive()
Description copied from interface:ChannelInboundInvokerAChannelis inactive now, which means it is closed. This will result in having theChannelInboundHandler.channelInactive(ChannelHandlerContext)method called of the nextChannelInboundHandlercontained in theChannelPipelineof theChannel.- Specified by:
fireChannelInactivein interfaceChannelInboundInvoker
-
fireExceptionCaught
ChannelPipeline fireExceptionCaught(java.lang.Throwable cause)
Description copied from interface:ChannelInboundInvokerAChannelreceived anThrowablein one of its inbound operations. This will result in having theChannelInboundHandler.exceptionCaught(ChannelHandlerContext, Throwable)method called of the nextChannelInboundHandlercontained in theChannelPipelineof theChannel.- Specified by:
fireExceptionCaughtin interfaceChannelInboundInvoker
-
fireUserEventTriggered
ChannelPipeline fireUserEventTriggered(java.lang.Object event)
Description copied from interface:ChannelInboundInvokerAChannelreceived an user defined event. This will result in having theChannelInboundHandler.userEventTriggered(ChannelHandlerContext, Object)method called of the nextChannelInboundHandlercontained in theChannelPipelineof theChannel.- Specified by:
fireUserEventTriggeredin interfaceChannelInboundInvoker
-
fireChannelRead
ChannelPipeline fireChannelRead(java.lang.Object msg)
Description copied from interface:ChannelInboundInvokerAChannelreceived a message. This will result in having theChannelInboundHandler.channelRead(ChannelHandlerContext, Object)method called of the nextChannelInboundHandlercontained in theChannelPipelineof theChannel.- Specified by:
fireChannelReadin interfaceChannelInboundInvoker
-
fireChannelReadComplete
ChannelPipeline fireChannelReadComplete()
Description copied from interface:ChannelInboundInvokerTriggers anChannelInboundHandler.channelReadComplete(ChannelHandlerContext)event to the nextChannelInboundHandlerin theChannelPipeline.- Specified by:
fireChannelReadCompletein interfaceChannelInboundInvoker
-
fireChannelWritabilityChanged
ChannelPipeline fireChannelWritabilityChanged()
Description copied from interface:ChannelInboundInvokerTriggers anChannelInboundHandler.channelWritabilityChanged(ChannelHandlerContext)event to the nextChannelInboundHandlerin theChannelPipeline.- Specified by:
fireChannelWritabilityChangedin interfaceChannelInboundInvoker
-
flush
ChannelPipeline flush()
Description copied from interface:ChannelOutboundInvokerRequest to flush all pending messages via this ChannelOutboundInvoker.- Specified by:
flushin interfaceChannelOutboundInvoker
-
newPromise
default ChannelPromise newPromise()
Description copied from interface:ChannelOutboundInvokerReturn a newChannelPromise.- Specified by:
newPromisein interfaceChannelOutboundInvoker
-
newProgressivePromise
default ChannelProgressivePromise newProgressivePromise()
Description copied from interface:ChannelOutboundInvokerReturn an newChannelProgressivePromise- Specified by:
newProgressivePromisein interfaceChannelOutboundInvoker
-
newFailedFuture
default ChannelFuture newFailedFuture(java.lang.Throwable cause)
Description copied from interface:ChannelOutboundInvokerCreate a newChannelFuturewhich is marked as failed already. SoFuture.isSuccess()will returnfalse. AllFutureListeneradded to it will be notified directly. Also every call of blocking methods will just return without blocking.- Specified by:
newFailedFuturein interfaceChannelOutboundInvoker
-
-