Class DefaultChannelPipeline
- All Implemented Interfaces:
ChannelInboundInvoker, ChannelOutboundInvoker, ChannelPipeline, Iterable<Map.Entry<String, ChannelHandler>>
ChannelPipeline implementation. It is usually created
by a Channel implementation when the Channel is created.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal ChannelPipelineaddAfter(EventExecutorGroup group, String baseName, String name, ChannelHandler handler) Inserts aChannelHandlerafter an existing handler of this pipeline.final ChannelPipelineaddAfter(String baseName, String name, ChannelHandler handler) Inserts aChannelHandlerafter an existing handler of this pipeline.final ChannelPipelineaddBefore(EventExecutorGroup group, String baseName, String name, ChannelHandler handler) Inserts aChannelHandlerbefore an existing handler of this pipeline.final ChannelPipelineaddBefore(String baseName, String name, ChannelHandler handler) Inserts aChannelHandlerbefore an existing handler of this pipeline.final ChannelPipelineaddFirst(ChannelHandler handler) final ChannelPipelineaddFirst(ChannelHandler... handlers) InsertsChannelHandlers at the first position of this pipeline.final ChannelPipelineaddFirst(EventExecutorGroup executor, ChannelHandler... handlers) InsertsChannelHandlers at the first position of this pipeline.final ChannelPipelineaddFirst(EventExecutorGroup group, String name, ChannelHandler handler) Inserts aChannelHandlerat the first position of this pipeline.final ChannelPipelineaddFirst(String name, ChannelHandler handler) Inserts aChannelHandlerat the first position of this pipeline.final ChannelPipelineaddLast(ChannelHandler handler) final ChannelPipelineaddLast(ChannelHandler... handlers) InsertsChannelHandlers at the last position of this pipeline.final ChannelPipelineaddLast(EventExecutorGroup executor, ChannelHandler... handlers) InsertsChannelHandlers at the last position of this pipeline.final ChannelPipelineaddLast(EventExecutorGroup group, String name, ChannelHandler handler) Appends aChannelHandlerat the last position of this pipeline.final ChannelPipelineaddLast(String name, ChannelHandler handler) Appends aChannelHandlerat the last position of this pipeline.final ChannelFuturebind(SocketAddress localAddress) Request to bind to the givenSocketAddressand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.final ChannelFuturebind(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.final Channelchannel()Returns theChannelthat this pipeline is attached to.final ChannelFutureclose()Request to close theChanneland notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.final ChannelFutureclose(ChannelPromise promise) Request to close theChanneland notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.final ChannelFutureconnect(SocketAddress remoteAddress) Request to connect to the givenSocketAddressand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.final ChannelFutureconnect(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.final ChannelFutureconnect(SocketAddress remoteAddress, 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.final ChannelFutureconnect(SocketAddress remoteAddress, 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.final ChannelHandlerContextcontext(ChannelHandler handler) Returns the context object of the specifiedChannelHandlerin this pipeline.final ChannelHandlerContextcontext(Class<? extends ChannelHandler> handlerType) Returns the context object of theChannelHandlerof the specified type in this pipeline.final ChannelHandlerContextReturns the context object of theChannelHandlerwith the specified name in this pipeline.protected voiddecrementPendingOutboundBytes(long size) final ChannelFutureRequest to deregister from the previous assignedEventExecutorand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.final 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.final ChannelFutureRequest to disconnect from the remote peer and notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.final 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.final ChannelPipelineAChannelis active now, which means it is connected.final ChannelPipelineAChannelis inactive now, which means it is closed.final ChannelPipelinefireChannelRead(Object msg) AChannelreceived a message.final ChannelPipelineTriggers anChannelInboundHandler.channelReadComplete(ChannelHandlerContext)event to the nextChannelInboundHandlerin theChannelPipeline.final ChannelPipelinefinal ChannelPipelinefinal ChannelPipelineTriggers anChannelInboundHandler.channelWritabilityChanged(ChannelHandlerContext)event to the nextChannelInboundHandlerin theChannelPipeline.final ChannelPipelinefireExceptionCaught(Throwable cause) final ChannelPipelinefireUserEventTriggered(Object event) AChannelreceived an user defined event.final ChannelHandlerfirst()Returns the firstChannelHandlerin this pipeline.final ChannelHandlerContextReturns the context of the firstChannelHandlerin this pipeline.final ChannelPipelineflush()Request to flush all pending messages via this ChannelOutboundInvoker.final <T extends ChannelHandler>
TReturns theChannelHandlerof the specified type in this pipeline.final ChannelHandlerReturns theChannelHandlerwith the specified name in this pipeline.protected voidincrementPendingOutboundBytes(long size) final Iterator<Map.Entry<String, ChannelHandler>> iterator()final ChannelHandlerlast()Returns the lastChannelHandlerin this pipeline.final ChannelHandlerContextReturns the context of the lastChannelHandlerin this pipeline.names()Returns theListof the handler names.final ChannelFuturenewFailedFuture(Throwable cause) Create a newChannelFuturewhich is marked as failed already.Return an newChannelProgressivePromisefinal ChannelPromiseReturn a newChannelPromise.final ChannelFutureCreate a newChannelFuturewhich is marked as succeeded already.protected voidCalled once theChannelInboundHandler.channelWritabilityChanged(ChannelHandlerContext)event hit the end of theChannelPipeline.protected voidCalled once theChannelInboundHandler.channelActive(ChannelHandlerContext)event hit the end of theChannelPipeline.protected voidCalled once theChannelInboundHandler.channelInactive(ChannelHandlerContext)event hit the end of theChannelPipeline.protected voidCalled once theChannelInboundHandler.channelReadComplete(ChannelHandlerContext)event hit the end of theChannelPipeline.protected voidCalled once aThrowablehit the end of theChannelPipelinewithout been handled by the user inChannelHandler.exceptionCaught(ChannelHandlerContext, Throwable).protected voidCalled once a message hit the end of theChannelPipelinewithout been handled by the user inChannelInboundHandler.channelRead(ChannelHandlerContext, Object).protected voidCalled once a message hit the end of theChannelPipelinewithout been handled by the user inChannelInboundHandler.channelRead(ChannelHandlerContext, Object).protected voidCalled once an user event hit the end of theChannelPipelinewithout been handled by the user inChannelInboundHandler.userEventTriggered(ChannelHandlerContext, Object).final 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.final ChannelPipelineremove(ChannelHandler handler) Removes the specifiedChannelHandlerfrom this pipeline.final <T extends ChannelHandler>
TRemoves theChannelHandlerof the specified type from this pipeline.final ChannelHandlerRemoves theChannelHandlerwith the specified name from this pipeline.final ChannelHandlerRemoves the firstChannelHandlerin this pipeline.final <T extends ChannelHandler>
TremoveIfExists(ChannelHandler handler) final <T extends ChannelHandler>
TremoveIfExists(Class<T> handlerType) final <T extends ChannelHandler>
TremoveIfExists(String name) final ChannelHandlerRemoves the lastChannelHandlerin this pipeline.final ChannelPipelinereplace(ChannelHandler oldHandler, String newName, ChannelHandler newHandler) Replaces the specifiedChannelHandlerwith a new handler in this pipeline.final <T extends ChannelHandler>
Treplace(Class<T> oldHandlerType, String newName, ChannelHandler newHandler) Replaces theChannelHandlerof the specified type with a new handler in this pipeline.final ChannelHandlerreplace(String oldName, String newName, ChannelHandler newHandler) Replaces theChannelHandlerof the specified name with a new handler in this pipeline.final Map<String, ChannelHandler> toMap()Converts this pipeline into an orderedMapwhose keys are handler names and whose values are handlers.final StringtoString()Returns theStringrepresentation of this pipeline.final ChannelPromiseReturn a special ChannelPromise which can be reused for different operations.final ChannelFutureRequest to write a message via thisChannelHandlerContextthrough theChannelPipeline.final ChannelFuturewrite(Object msg, ChannelPromise promise) Request to write a message via thisChannelHandlerContextthrough theChannelPipeline.final ChannelFuturewriteAndFlush(Object msg) Shortcut for callChannelOutboundInvoker.write(Object)andChannelOutboundInvoker.flush().final ChannelFuturewriteAndFlush(Object msg, ChannelPromise promise) Shortcut for callChannelOutboundInvoker.write(Object, ChannelPromise)andChannelOutboundInvoker.flush().Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Iterable
forEach, spliterator
-
Constructor Details
-
DefaultChannelPipeline
-
-
Method Details
-
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
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, 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
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
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
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, String baseName, 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
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, String baseName, 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
-
addFirst
Description copied from interface:ChannelPipelineInsertsChannelHandlers at the first position of this pipeline.- Specified by:
addFirstin interfaceChannelPipeline- Parameters:
handlers- the handlers to insert first
-
addFirst
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
-
addLast
Description copied from interface:ChannelPipelineInsertsChannelHandlers at the last position of this pipeline.- Specified by:
addLastin interfaceChannelPipeline- Parameters:
handlers- the handlers to insert last
-
addLast
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
Description copied from interface:ChannelPipelineRemoves the specifiedChannelHandlerfrom this pipeline.- Specified by:
removein interfaceChannelPipeline- Parameters:
handler- theChannelHandlerto remove
-
remove
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
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
-
removeIfExists
-
removeIfExists
-
removeFirst
Description copied from interface:ChannelPipelineRemoves the firstChannelHandlerin this pipeline.- Specified by:
removeFirstin interfaceChannelPipeline- Returns:
- the removed handler
-
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, 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
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(Class<T> oldHandlerType, 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
Description copied from interface:ChannelPipelineReturns the firstChannelHandlerin this pipeline.- Specified by:
firstin interfaceChannelPipeline- Returns:
- the first handler.
nullif this pipeline is empty.
-
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
Description copied from interface:ChannelPipelineReturns the lastChannelHandlerin this pipeline.- Specified by:
lastin interfaceChannelPipeline- Returns:
- the last handler.
nullif this pipeline is empty.
-
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
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
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
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
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
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
Description copied from interface:ChannelPipelineReturns theListof the handler names.- Specified by:
namesin interfaceChannelPipeline
-
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
- Specified by:
iteratorin interfaceIterable<Map.Entry<String, ChannelHandler>>
-
toString
-
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
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
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
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
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
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
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
Description copied from interface:ChannelInboundInvokerTriggers anChannelInboundHandler.channelReadComplete(ChannelHandlerContext)event to the nextChannelInboundHandlerin theChannelPipeline.- Specified by:
fireChannelReadCompletein interfaceChannelInboundInvoker- Specified by:
fireChannelReadCompletein interfaceChannelPipeline
-
fireChannelWritabilityChanged
Description copied from interface:ChannelInboundInvokerTriggers anChannelInboundHandler.channelWritabilityChanged(ChannelHandlerContext)event to the nextChannelInboundHandlerin theChannelPipeline.- Specified by:
fireChannelWritabilityChangedin interfaceChannelInboundInvoker- Specified by:
fireChannelWritabilityChangedin interfaceChannelPipeline
-
bind
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
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
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
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
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
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
Description copied from interface:ChannelOutboundInvokerRequest to flush all pending messages via this ChannelOutboundInvoker.- Specified by:
flushin interfaceChannelOutboundInvoker- Specified by:
flushin interfaceChannelPipeline
-
bind
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
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(SocketAddress remoteAddress, 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
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
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
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
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
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
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
Description copied from interface:ChannelOutboundInvokerShortcut for callChannelOutboundInvoker.write(Object, ChannelPromise)andChannelOutboundInvoker.flush().- Specified by:
writeAndFlushin interfaceChannelOutboundInvoker
-
writeAndFlush
Description copied from interface:ChannelOutboundInvokerShortcut for callChannelOutboundInvoker.write(Object)andChannelOutboundInvoker.flush().- Specified by:
writeAndFlushin interfaceChannelOutboundInvoker
-
newPromise
Description copied from interface:ChannelOutboundInvokerReturn a newChannelPromise.- Specified by:
newPromisein interfaceChannelOutboundInvoker- Specified by:
newPromisein interfaceChannelPipeline
-
newProgressivePromise
Description copied from interface:ChannelOutboundInvokerReturn an newChannelProgressivePromise- Specified by:
newProgressivePromisein interfaceChannelOutboundInvoker- Specified by:
newProgressivePromisein interfaceChannelPipeline
-
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
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
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
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
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
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
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)
-