Class DefaultChannelPipeline
- java.lang.Object
-
- io.netty.channel.DefaultChannelPipeline
-
- All Implemented Interfaces:
ChannelInboundInvoker,ChannelOutboundInvoker,ChannelPipeline,java.lang.Iterable<java.util.Map.Entry<java.lang.String,ChannelHandler>>
public class DefaultChannelPipeline extends java.lang.Object implements ChannelPipeline
The defaultChannelPipelineimplementation. It is usually created by aChannelimplementation when theChannelis created.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedDefaultChannelPipeline(Channel channel)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ChannelPipelineaddAfter(EventExecutorGroup group, java.lang.String baseName, java.lang.String name, ChannelHandler handler)Inserts aChannelHandlerafter an existing handler of this pipeline.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)Inserts aChannelHandlerbefore an existing handler of this pipeline.ChannelPipelineaddBefore(java.lang.String baseName, java.lang.String name, ChannelHandler handler)Inserts aChannelHandlerbefore an existing handler of this pipeline.ChannelPipelineaddFirst(ChannelHandler handler)ChannelPipelineaddFirst(ChannelHandler... handlers)InsertsChannelHandlers at the first position of this pipeline.ChannelPipelineaddFirst(EventExecutorGroup executor, ChannelHandler... handlers)InsertsChannelHandlers at the first position of this pipeline.ChannelPipelineaddFirst(EventExecutorGroup group, java.lang.String name, ChannelHandler handler)Inserts aChannelHandlerat the first position of this pipeline.ChannelPipelineaddFirst(java.lang.String name, ChannelHandler handler)Inserts aChannelHandlerat the first position of this pipeline.ChannelPipelineaddLast(ChannelHandler handler)ChannelPipelineaddLast(ChannelHandler... handlers)InsertsChannelHandlers at the last position of this pipeline.ChannelPipelineaddLast(EventExecutorGroup executor, ChannelHandler... handlers)InsertsChannelHandlers at the last position of this pipeline.ChannelPipelineaddLast(EventExecutorGroup group, java.lang.String name, ChannelHandler handler)Appends aChannelHandlerat the last position of this pipeline.ChannelPipelineaddLast(java.lang.String name, ChannelHandler handler)Appends aChannelHandlerat the last position of this pipeline.ChannelFuturebind(java.net.SocketAddress localAddress)Request to bind to the givenSocketAddressand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.ChannelFuturebind(java.net.SocketAddress localAddress, ChannelPromise promise)Request to bind to the givenSocketAddressand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.Channelchannel()Returns theChannelthat this pipeline is attached to.ChannelFutureclose()Request to close theChanneland notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.ChannelFutureclose(ChannelPromise promise)Request to close theChanneland notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.ChannelFutureconnect(java.net.SocketAddress remoteAddress)Request to connect to the givenSocketAddressand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.ChannelFutureconnect(java.net.SocketAddress remoteAddress, ChannelPromise promise)Request to connect to the givenSocketAddressand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.ChannelFutureconnect(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress)Request to connect to the givenSocketAddresswhile bind to the localAddress and notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.ChannelFutureconnect(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress, ChannelPromise promise)Request to connect to the givenSocketAddresswhile bind to the localAddress and notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.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.protected voiddecrementPendingOutboundBytes(long size)ChannelFuturederegister()Request to deregister from the previous assignedEventExecutorand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.ChannelFuturederegister(ChannelPromise promise)Request to deregister from the previous assignedEventExecutorand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.ChannelFuturedisconnect()Request to disconnect from the remote peer and notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.ChannelFuturedisconnect(ChannelPromise promise)Request to disconnect from the remote peer and notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.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.protected voidincrementPendingOutboundBytes(long size)java.util.Iterator<java.util.Map.Entry<java.lang.String,ChannelHandler>>iterator()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.ChannelFuturenewFailedFuture(java.lang.Throwable cause)Create a newChannelFuturewhich is marked as failed already.ChannelProgressivePromisenewProgressivePromise()Return an newChannelProgressivePromiseChannelPromisenewPromise()Return a newChannelPromise.ChannelFuturenewSucceededFuture()Create a newChannelFuturewhich is marked as succeeded already.protected voidonUnhandledChannelWritabilityChanged()Called once theChannelInboundHandler.channelWritabilityChanged(ChannelHandlerContext)event hit the end of theChannelPipeline.protected voidonUnhandledInboundChannelActive()Called once theChannelInboundHandler.channelActive(ChannelHandlerContext)event hit the end of theChannelPipeline.protected voidonUnhandledInboundChannelInactive()Called once theChannelInboundHandler.channelInactive(ChannelHandlerContext)event hit the end of theChannelPipeline.protected voidonUnhandledInboundChannelReadComplete()Called once theChannelInboundHandler.channelReadComplete(ChannelHandlerContext)event hit the end of theChannelPipeline.protected voidonUnhandledInboundException(java.lang.Throwable cause)Called once aThrowablehit the end of theChannelPipelinewithout been handled by the user inChannelHandler.exceptionCaught(ChannelHandlerContext, Throwable).protected voidonUnhandledInboundMessage(ChannelHandlerContext ctx, java.lang.Object msg)Called once a message hit the end of theChannelPipelinewithout been handled by the user inChannelInboundHandler.channelRead(ChannelHandlerContext, Object).protected voidonUnhandledInboundMessage(java.lang.Object msg)Called once a message hit the end of theChannelPipelinewithout been handled by the user inChannelInboundHandler.channelRead(ChannelHandlerContext, Object).protected voidonUnhandledInboundUserEventTriggered(java.lang.Object evt)Called once an user event hit the end of theChannelPipelinewithout been handled by the user inChannelInboundHandler.userEventTriggered(ChannelHandlerContext, Object).ChannelPipelineread()Request to Read data from theChannelinto the first inbound buffer, triggers anChannelInboundHandler.channelRead(ChannelHandlerContext, Object)event if data was read, and triggers achannelReadCompleteevent so the handler can decide to continue reading.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.<T extends ChannelHandler>
TremoveIfExists(ChannelHandler handler)<T extends ChannelHandler>
TremoveIfExists(java.lang.Class<T> handlerType)<T extends ChannelHandler>
TremoveIfExists(java.lang.String name)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.java.lang.StringtoString()Returns theStringrepresentation of this pipeline.ChannelPromisevoidPromise()Return a special ChannelPromise which can be reused for different operations.ChannelFuturewrite(java.lang.Object msg)Request to write a message via thisChannelHandlerContextthrough theChannelPipeline.ChannelFuturewrite(java.lang.Object msg, ChannelPromise promise)Request to write a message via thisChannelHandlerContextthrough theChannelPipeline.ChannelFuturewriteAndFlush(java.lang.Object msg)Shortcut for callChannelOutboundInvoker.write(Object)andChannelOutboundInvoker.flush().ChannelFuturewriteAndFlush(java.lang.Object msg, ChannelPromise promise)Shortcut for callChannelOutboundInvoker.write(Object, ChannelPromise)andChannelOutboundInvoker.flush().
-
-
-
Constructor Detail
-
DefaultChannelPipeline
protected DefaultChannelPipeline(Channel channel)
-
-
Method Detail
-
channel
public final Channel channel()
Description copied from interface:ChannelPipelineReturns theChannelthat this pipeline is attached to.- Specified by:
channelin interfaceChannelPipeline- Returns:
- the channel.
nullif this pipeline is not attached yet.
-
addFirst
public final ChannelPipeline addFirst(java.lang.String name, ChannelHandler handler)
Description copied from interface:ChannelPipelineInserts aChannelHandlerat the first position of this pipeline.- Specified by:
addFirstin interfaceChannelPipeline- Parameters:
name- the name of the handler to insert firsthandler- the handler to insert first
-
addFirst
public final ChannelPipeline addFirst(EventExecutorGroup group, java.lang.String name, ChannelHandler handler)
Description copied from interface:ChannelPipelineInserts aChannelHandlerat the first position of this pipeline.- Specified by:
addFirstin interfaceChannelPipeline- Parameters:
group- theEventExecutorGroupwhich will be used to execute theChannelHandlermethodsname- the name of the handler to insert firsthandler- the handler to insert first
-
addLast
public final ChannelPipeline addLast(java.lang.String name, ChannelHandler handler)
Description copied from interface:ChannelPipelineAppends aChannelHandlerat the last position of this pipeline.- Specified by:
addLastin interfaceChannelPipeline- Parameters:
name- the name of the handler to appendhandler- the handler to append
-
addLast
public final ChannelPipeline addLast(EventExecutorGroup group, java.lang.String name, ChannelHandler handler)
Description copied from interface:ChannelPipelineAppends aChannelHandlerat the last position of this pipeline.- Specified by:
addLastin interfaceChannelPipeline- Parameters:
group- theEventExecutorGroupwhich will be used to execute theChannelHandlermethodsname- the name of the handler to appendhandler- the handler to append
-
addBefore
public final ChannelPipeline addBefore(java.lang.String baseName, java.lang.String name, ChannelHandler handler)
Description copied from interface:ChannelPipelineInserts aChannelHandlerbefore an existing handler of this pipeline.- Specified by:
addBeforein interfaceChannelPipeline- Parameters:
baseName- the name of the existing handlername- the name of the handler to insert beforehandler- the handler to insert before
-
addBefore
public final ChannelPipeline addBefore(EventExecutorGroup group, java.lang.String baseName, java.lang.String name, ChannelHandler handler)
Description copied from interface:ChannelPipelineInserts aChannelHandlerbefore an existing handler of this pipeline.- Specified by:
addBeforein interfaceChannelPipeline- 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
-
addAfter
public final ChannelPipeline addAfter(java.lang.String baseName, java.lang.String name, ChannelHandler handler)
Description copied from interface:ChannelPipelineInserts aChannelHandlerafter an existing handler of this pipeline.- Specified by:
addAfterin interfaceChannelPipeline- Parameters:
baseName- the name of the existing handlername- the name of the handler to insert afterhandler- the handler to insert after
-
addAfter
public final ChannelPipeline addAfter(EventExecutorGroup group, java.lang.String baseName, java.lang.String name, ChannelHandler handler)
Description copied from interface:ChannelPipelineInserts aChannelHandlerafter an existing handler of this pipeline.- Specified by:
addAfterin interfaceChannelPipeline- 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
-
addFirst
public final ChannelPipeline addFirst(ChannelHandler handler)
-
addFirst
public final ChannelPipeline addFirst(ChannelHandler... handlers)
Description copied from interface:ChannelPipelineInsertsChannelHandlers at the first position of this pipeline.- Specified by:
addFirstin interfaceChannelPipeline- Parameters:
handlers- the handlers to insert first
-
addFirst
public final ChannelPipeline addFirst(EventExecutorGroup executor, ChannelHandler... handlers)
Description copied from interface:ChannelPipelineInsertsChannelHandlers at the first position of this pipeline.- Specified by:
addFirstin interfaceChannelPipeline- Parameters:
executor- theEventExecutorGroupwhich will be used to execute theChannelHandlers methods.handlers- the handlers to insert first
-
addLast
public final ChannelPipeline addLast(ChannelHandler handler)
-
addLast
public final ChannelPipeline addLast(ChannelHandler... handlers)
Description copied from interface:ChannelPipelineInsertsChannelHandlers at the last position of this pipeline.- Specified by:
addLastin interfaceChannelPipeline- Parameters:
handlers- the handlers to insert last
-
addLast
public final ChannelPipeline addLast(EventExecutorGroup executor, ChannelHandler... handlers)
Description copied from interface:ChannelPipelineInsertsChannelHandlers at the last position of this pipeline.- Specified by:
addLastin interfaceChannelPipeline- Parameters:
executor- theEventExecutorGroupwhich will be used to execute theChannelHandlers methods.handlers- the handlers to insert last
-
remove
public final ChannelPipeline remove(ChannelHandler handler)
Description copied from interface:ChannelPipelineRemoves the specifiedChannelHandlerfrom this pipeline.- Specified by:
removein interfaceChannelPipeline- Parameters:
handler- theChannelHandlerto remove
-
remove
public final ChannelHandler remove(java.lang.String name)
Description copied from interface:ChannelPipelineRemoves theChannelHandlerwith the specified name from this pipeline.- Specified by:
removein interfaceChannelPipeline- Parameters:
name- the name under which theChannelHandlerwas stored.- Returns:
- the removed handler
-
remove
public final <T extends ChannelHandler> T remove(java.lang.Class<T> handlerType)
Description copied from interface:ChannelPipelineRemoves theChannelHandlerof the specified type from this pipeline.- Specified by:
removein interfaceChannelPipeline- Type Parameters:
T- the type of the handler- Parameters:
handlerType- the type of the handler- Returns:
- the removed handler
-
removeIfExists
public final <T extends ChannelHandler> T removeIfExists(java.lang.String name)
-
removeIfExists
public final <T extends ChannelHandler> T removeIfExists(java.lang.Class<T> handlerType)
-
removeIfExists
public final <T extends ChannelHandler> T removeIfExists(ChannelHandler handler)
-
removeFirst
public final ChannelHandler removeFirst()
Description copied from interface:ChannelPipelineRemoves the firstChannelHandlerin this pipeline.- Specified by:
removeFirstin interfaceChannelPipeline- Returns:
- the removed handler
-
removeLast
public final ChannelHandler removeLast()
Description copied from interface:ChannelPipelineRemoves the lastChannelHandlerin this pipeline.- Specified by:
removeLastin interfaceChannelPipeline- Returns:
- the removed handler
-
replace
public final ChannelPipeline replace(ChannelHandler oldHandler, java.lang.String newName, ChannelHandler newHandler)
Description copied from interface:ChannelPipelineReplaces the specifiedChannelHandlerwith a new handler in this pipeline.- Specified by:
replacein interfaceChannelPipeline- Parameters:
oldHandler- theChannelHandlerto be replacednewName- the name under which the replacement should be addednewHandler- theChannelHandlerwhich is used as replacement- Returns:
- itself
-
replace
public final ChannelHandler replace(java.lang.String oldName, java.lang.String newName, ChannelHandler newHandler)
Description copied from interface:ChannelPipelineReplaces theChannelHandlerof the specified name with a new handler in this pipeline.- Specified by:
replacein interfaceChannelPipeline- 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
-
replace
public final <T extends ChannelHandler> T replace(java.lang.Class<T> oldHandlerType, java.lang.String newName, ChannelHandler newHandler)
Description copied from interface:ChannelPipelineReplaces theChannelHandlerof the specified type with a new handler in this pipeline.- Specified by:
replacein interfaceChannelPipeline- 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
-
first
public final ChannelHandler first()
Description copied from interface:ChannelPipelineReturns the firstChannelHandlerin this pipeline.- Specified by:
firstin interfaceChannelPipeline- Returns:
- the first handler.
nullif this pipeline is empty.
-
firstContext
public final ChannelHandlerContext firstContext()
Description copied from interface:ChannelPipelineReturns the context of the firstChannelHandlerin this pipeline.- Specified by:
firstContextin interfaceChannelPipeline- Returns:
- the context of the first handler.
nullif this pipeline is empty.
-
last
public final ChannelHandler last()
Description copied from interface:ChannelPipelineReturns the lastChannelHandlerin this pipeline.- Specified by:
lastin interfaceChannelPipeline- Returns:
- the last handler.
nullif this pipeline is empty.
-
lastContext
public final ChannelHandlerContext lastContext()
Description copied from interface:ChannelPipelineReturns the context of the lastChannelHandlerin this pipeline.- Specified by:
lastContextin interfaceChannelPipeline- Returns:
- the context of the last handler.
nullif this pipeline is empty.
-
get
public final ChannelHandler get(java.lang.String name)
Description copied from interface:ChannelPipelineReturns theChannelHandlerwith the specified name in this pipeline.- Specified by:
getin interfaceChannelPipeline- Returns:
- the handler with the specified name.
nullif there's no such handler in this pipeline.
-
get
public final <T extends ChannelHandler> T get(java.lang.Class<T> handlerType)
Description copied from interface:ChannelPipelineReturns theChannelHandlerof the specified type in this pipeline.- Specified by:
getin interfaceChannelPipeline- Returns:
- the handler of the specified handler type.
nullif there's no such handler in this pipeline.
-
context
public final ChannelHandlerContext context(java.lang.String name)
Description copied from interface:ChannelPipelineReturns the context object of theChannelHandlerwith the specified name in this pipeline.- Specified by:
contextin interfaceChannelPipeline- Returns:
- the context object of the handler with the specified name.
nullif there's no such handler in this pipeline.
-
context
public final ChannelHandlerContext context(ChannelHandler handler)
Description copied from interface:ChannelPipelineReturns the context object of the specifiedChannelHandlerin this pipeline.- Specified by:
contextin interfaceChannelPipeline- Returns:
- the context object of the specified handler.
nullif there's no such handler in this pipeline.
-
context
public final ChannelHandlerContext context(java.lang.Class<? extends ChannelHandler> handlerType)
Description copied from interface:ChannelPipelineReturns the context object of theChannelHandlerof the specified type in this pipeline.- Specified by:
contextin interfaceChannelPipeline- Returns:
- the context object of the handler of the specified type.
nullif there's no such handler in this pipeline.
-
names
public final java.util.List<java.lang.String> names()
Description copied from interface:ChannelPipelineReturns theListof the handler names.- Specified by:
namesin interfaceChannelPipeline
-
toMap
public final java.util.Map<java.lang.String,ChannelHandler> toMap()
Description copied from interface:ChannelPipelineConverts this pipeline into an orderedMapwhose keys are handler names and whose values are handlers.- Specified by:
toMapin interfaceChannelPipeline
-
iterator
public final java.util.Iterator<java.util.Map.Entry<java.lang.String,ChannelHandler>> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<java.util.Map.Entry<java.lang.String,ChannelHandler>>
-
toString
public final java.lang.String toString()
Returns theStringrepresentation of this pipeline.- Overrides:
toStringin classjava.lang.Object
-
fireChannelRegistered
public final 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- Specified by:
fireChannelRegisteredin interfaceChannelPipeline
-
fireChannelUnregistered
public final 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- Specified by:
fireChannelUnregisteredin interfaceChannelPipeline
-
fireChannelActive
public final 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- Specified by:
fireChannelActivein interfaceChannelPipeline
-
fireChannelInactive
public final 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- Specified by:
fireChannelInactivein interfaceChannelPipeline
-
fireExceptionCaught
public final 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- Specified by:
fireExceptionCaughtin interfaceChannelPipeline
-
fireUserEventTriggered
public final 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- Specified by:
fireUserEventTriggeredin interfaceChannelPipeline
-
fireChannelRead
public final 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- Specified by:
fireChannelReadin interfaceChannelPipeline
-
fireChannelReadComplete
public final ChannelPipeline fireChannelReadComplete()
Description copied from interface:ChannelInboundInvokerTriggers anChannelInboundHandler.channelReadComplete(ChannelHandlerContext)event to the nextChannelInboundHandlerin theChannelPipeline.- Specified by:
fireChannelReadCompletein interfaceChannelInboundInvoker- Specified by:
fireChannelReadCompletein interfaceChannelPipeline
-
fireChannelWritabilityChanged
public final ChannelPipeline fireChannelWritabilityChanged()
Description copied from interface:ChannelInboundInvokerTriggers anChannelInboundHandler.channelWritabilityChanged(ChannelHandlerContext)event to the nextChannelInboundHandlerin theChannelPipeline.- Specified by:
fireChannelWritabilityChangedin interfaceChannelInboundInvoker- Specified by:
fireChannelWritabilityChangedin interfaceChannelPipeline
-
bind
public final ChannelFuture bind(java.net.SocketAddress localAddress)
Description copied from interface:ChannelOutboundInvokerRequest to bind to the givenSocketAddressand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.This will result in having the
ChannelOutboundHandler.bind(ChannelHandlerContext, SocketAddress, ChannelPromise)method called of the nextChannelOutboundHandlercontained in theChannelPipelineof theChannel.- Specified by:
bindin interfaceChannelOutboundInvoker
-
connect
public final ChannelFuture connect(java.net.SocketAddress remoteAddress)
Description copied from interface:ChannelOutboundInvokerRequest to connect to the givenSocketAddressand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.If the connection fails because of a connection timeout, the
ChannelFuturewill get failed with aConnectTimeoutException. If it fails because of connection refused aConnectExceptionwill be used.This will result in having the
ChannelOutboundHandler.connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)method called of the nextChannelOutboundHandlercontained in theChannelPipelineof theChannel.- Specified by:
connectin interfaceChannelOutboundInvoker
-
connect
public final ChannelFuture connect(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress)
Description copied from interface:ChannelOutboundInvokerRequest to connect to the givenSocketAddresswhile bind to the localAddress and notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.This will result in having the
ChannelOutboundHandler.connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)method called of the nextChannelOutboundHandlercontained in theChannelPipelineof theChannel.- Specified by:
connectin interfaceChannelOutboundInvoker
-
disconnect
public final ChannelFuture disconnect()
Description copied from interface:ChannelOutboundInvokerRequest to disconnect from the remote peer and notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.This will result in having the
ChannelOutboundHandler.disconnect(ChannelHandlerContext, ChannelPromise)method called of the nextChannelOutboundHandlercontained in theChannelPipelineof theChannel.- Specified by:
disconnectin interfaceChannelOutboundInvoker
-
close
public final ChannelFuture close()
Description copied from interface:ChannelOutboundInvokerRequest to close theChanneland notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error. After it is closed it is not possible to reuse it again.This will result in having the
ChannelOutboundHandler.close(ChannelHandlerContext, ChannelPromise)method called of the nextChannelOutboundHandlercontained in theChannelPipelineof theChannel.- Specified by:
closein interfaceChannelOutboundInvoker
-
deregister
public final ChannelFuture deregister()
Description copied from interface:ChannelOutboundInvokerRequest to deregister from the previous assignedEventExecutorand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.This will result in having the
ChannelOutboundHandler.deregister(ChannelHandlerContext, ChannelPromise)method called of the nextChannelOutboundHandlercontained in theChannelPipelineof theChannel.- Specified by:
deregisterin interfaceChannelOutboundInvoker
-
flush
public final ChannelPipeline flush()
Description copied from interface:ChannelOutboundInvokerRequest to flush all pending messages via this ChannelOutboundInvoker.- Specified by:
flushin interfaceChannelOutboundInvoker- Specified by:
flushin interfaceChannelPipeline
-
bind
public final ChannelFuture bind(java.net.SocketAddress localAddress, ChannelPromise promise)
Description copied from interface:ChannelOutboundInvokerRequest to bind to the givenSocketAddressand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error. The givenChannelPromisewill be notified.This will result in having the
ChannelOutboundHandler.bind(ChannelHandlerContext, SocketAddress, ChannelPromise)method called of the nextChannelOutboundHandlercontained in theChannelPipelineof theChannel.- Specified by:
bindin interfaceChannelOutboundInvoker
-
connect
public final ChannelFuture connect(java.net.SocketAddress remoteAddress, ChannelPromise promise)
Description copied from interface:ChannelOutboundInvokerRequest to connect to the givenSocketAddressand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error. The givenChannelFuturewill be notified.If the connection fails because of a connection timeout, the
ChannelFuturewill get failed with aConnectTimeoutException. If it fails because of connection refused aConnectExceptionwill be used.This will result in having the
ChannelOutboundHandler.connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)method called of the nextChannelOutboundHandlercontained in theChannelPipelineof theChannel.- Specified by:
connectin interfaceChannelOutboundInvoker
-
connect
public final ChannelFuture connect(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress, ChannelPromise promise)
Description copied from interface:ChannelOutboundInvokerRequest to connect to the givenSocketAddresswhile bind to the localAddress and notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error. The givenChannelPromisewill be notified and also returned.This will result in having the
ChannelOutboundHandler.connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)method called of the nextChannelOutboundHandlercontained in theChannelPipelineof theChannel.- Specified by:
connectin interfaceChannelOutboundInvoker
-
disconnect
public final ChannelFuture disconnect(ChannelPromise promise)
Description copied from interface:ChannelOutboundInvokerRequest to disconnect from the remote peer and notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error. The givenChannelPromisewill be notified.This will result in having the
ChannelOutboundHandler.disconnect(ChannelHandlerContext, ChannelPromise)method called of the nextChannelOutboundHandlercontained in theChannelPipelineof theChannel.- Specified by:
disconnectin interfaceChannelOutboundInvoker
-
close
public final ChannelFuture close(ChannelPromise promise)
Description copied from interface:ChannelOutboundInvokerRequest to close theChanneland notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error. After it is closed it is not possible to reuse it again. The givenChannelPromisewill be notified.This will result in having the
ChannelOutboundHandler.close(ChannelHandlerContext, ChannelPromise)method called of the nextChannelOutboundHandlercontained in theChannelPipelineof theChannel.- Specified by:
closein interfaceChannelOutboundInvoker
-
deregister
public final ChannelFuture deregister(ChannelPromise promise)
Description copied from interface:ChannelOutboundInvokerRequest to deregister from the previous assignedEventExecutorand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error. The givenChannelPromisewill be notified.This will result in having the
ChannelOutboundHandler.deregister(ChannelHandlerContext, ChannelPromise)method called of the nextChannelOutboundHandlercontained in theChannelPipelineof theChannel.- Specified by:
deregisterin interfaceChannelOutboundInvoker
-
read
public final ChannelPipeline read()
Description copied from interface:ChannelOutboundInvokerRequest to Read data from theChannelinto the first inbound buffer, triggers anChannelInboundHandler.channelRead(ChannelHandlerContext, Object)event if data was read, and triggers achannelReadCompleteevent so the handler can decide to continue reading. If there's a pending read operation already, this method does nothing.This will result in having the
ChannelOutboundHandler.read(ChannelHandlerContext)method called of the nextChannelOutboundHandlercontained in theChannelPipelineof theChannel.- Specified by:
readin interfaceChannelOutboundInvoker
-
write
public final ChannelFuture write(java.lang.Object msg)
Description copied from interface:ChannelOutboundInvokerRequest to write a message via thisChannelHandlerContextthrough theChannelPipeline. This method will not request to actual flush, so be sure to callChannelOutboundInvoker.flush()once you want to request to flush all pending data to the actual transport.- Specified by:
writein interfaceChannelOutboundInvoker
-
write
public final ChannelFuture write(java.lang.Object msg, ChannelPromise promise)
Description copied from interface:ChannelOutboundInvokerRequest to write a message via thisChannelHandlerContextthrough theChannelPipeline. This method will not request to actual flush, so be sure to callChannelOutboundInvoker.flush()once you want to request to flush all pending data to the actual transport.- Specified by:
writein interfaceChannelOutboundInvoker
-
writeAndFlush
public final ChannelFuture writeAndFlush(java.lang.Object msg, ChannelPromise promise)
Description copied from interface:ChannelOutboundInvokerShortcut for callChannelOutboundInvoker.write(Object, ChannelPromise)andChannelOutboundInvoker.flush().- Specified by:
writeAndFlushin interfaceChannelOutboundInvoker
-
writeAndFlush
public final ChannelFuture writeAndFlush(java.lang.Object msg)
Description copied from interface:ChannelOutboundInvokerShortcut for callChannelOutboundInvoker.write(Object)andChannelOutboundInvoker.flush().- Specified by:
writeAndFlushin interfaceChannelOutboundInvoker
-
newPromise
public final ChannelPromise newPromise()
Description copied from interface:ChannelOutboundInvokerReturn a newChannelPromise.- Specified by:
newPromisein interfaceChannelOutboundInvoker- Specified by:
newPromisein interfaceChannelPipeline
-
newProgressivePromise
public final ChannelProgressivePromise newProgressivePromise()
Description copied from interface:ChannelOutboundInvokerReturn an newChannelProgressivePromise- Specified by:
newProgressivePromisein interfaceChannelOutboundInvoker- Specified by:
newProgressivePromisein interfaceChannelPipeline
-
newSucceededFuture
public final ChannelFuture newSucceededFuture()
Description copied from interface:ChannelOutboundInvokerCreate a newChannelFuturewhich is marked as succeeded already. SoFuture.isSuccess()will returntrue. AllFutureListeneradded to it will be notified directly. Also every call of blocking methods will just return without blocking.- Specified by:
newSucceededFuturein interfaceChannelOutboundInvoker
-
newFailedFuture
public final 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- Specified by:
newFailedFuturein interfaceChannelPipeline
-
voidPromise
public final ChannelPromise voidPromise()
Description copied from interface:ChannelOutboundInvokerReturn a special ChannelPromise which can be reused for different operations.It's only supported to use it for
ChannelOutboundInvoker.write(Object, ChannelPromise).Be aware that the returned
Be aware this is an expert feature and should be used with care!ChannelPromisewill not support most operations and should only be used if you want to save an object allocation for every write operation. You will not be able to detect if the operation was complete, only if it failed as the implementation will callChannelPipeline.fireExceptionCaught(Throwable)in this case.- Specified by:
voidPromisein interfaceChannelOutboundInvoker
-
onUnhandledInboundException
protected void onUnhandledInboundException(java.lang.Throwable cause)
Called once aThrowablehit the end of theChannelPipelinewithout been handled by the user inChannelHandler.exceptionCaught(ChannelHandlerContext, Throwable).
-
onUnhandledInboundChannelActive
protected void onUnhandledInboundChannelActive()
Called once theChannelInboundHandler.channelActive(ChannelHandlerContext)event hit the end of theChannelPipeline.
-
onUnhandledInboundChannelInactive
protected void onUnhandledInboundChannelInactive()
Called once theChannelInboundHandler.channelInactive(ChannelHandlerContext)event hit the end of theChannelPipeline.
-
onUnhandledInboundMessage
protected void onUnhandledInboundMessage(java.lang.Object msg)
Called once a message hit the end of theChannelPipelinewithout been handled by the user inChannelInboundHandler.channelRead(ChannelHandlerContext, Object). This method is responsible to callReferenceCountUtil.release(Object)on the given msg at some point.
-
onUnhandledInboundMessage
protected void onUnhandledInboundMessage(ChannelHandlerContext ctx, java.lang.Object msg)
Called once a message hit the end of theChannelPipelinewithout been handled by the user inChannelInboundHandler.channelRead(ChannelHandlerContext, Object). This method is responsible to callReferenceCountUtil.release(Object)on the given msg at some point.
-
onUnhandledInboundChannelReadComplete
protected void onUnhandledInboundChannelReadComplete()
Called once theChannelInboundHandler.channelReadComplete(ChannelHandlerContext)event hit the end of theChannelPipeline.
-
onUnhandledInboundUserEventTriggered
protected void onUnhandledInboundUserEventTriggered(java.lang.Object evt)
Called once an user event hit the end of theChannelPipelinewithout been handled by the user inChannelInboundHandler.userEventTriggered(ChannelHandlerContext, Object). This method is responsible to callReferenceCountUtil.release(Object)on the given event at some point.
-
onUnhandledChannelWritabilityChanged
protected void onUnhandledChannelWritabilityChanged()
Called once theChannelInboundHandler.channelWritabilityChanged(ChannelHandlerContext)event hit the end of theChannelPipeline.
-
incrementPendingOutboundBytes
protected void incrementPendingOutboundBytes(long size)
-
decrementPendingOutboundBytes
protected void decrementPendingOutboundBytes(long size)
-
-