public class DefaultChannelPipeline extends Object implements ChannelPipeline
ChannelPipeline implementation. It is usually created
by a Channel implementation when the Channel is created.| Constructor and Description |
|---|
DefaultChannelPipeline(Channel channel) |
| Modifier and Type | Method and Description |
|---|---|
ChannelPipeline |
addAfter(EventExecutorGroup group,
String baseName,
String name,
ChannelHandler handler)
Inserts a
ChannelHandler after an existing handler of this
pipeline. |
ChannelPipeline |
addAfter(String baseName,
String name,
ChannelHandler handler)
Inserts a
ChannelHandler after an existing handler of this
pipeline. |
ChannelPipeline |
addBefore(EventExecutorGroup group,
String baseName,
String name,
ChannelHandler handler)
Inserts a
ChannelHandler before an existing handler of this
pipeline. |
ChannelPipeline |
addBefore(String baseName,
String name,
ChannelHandler handler)
Inserts a
ChannelHandler before an existing handler of this
pipeline. |
ChannelPipeline |
addFirst(ChannelHandler... handlers) |
ChannelPipeline |
addFirst(EventExecutorGroup executor,
ChannelHandler... handlers) |
ChannelPipeline |
addFirst(EventExecutorGroup group,
String name,
ChannelHandler handler)
Inserts a
ChannelHandler at the first position of this pipeline. |
ChannelPipeline |
addFirst(String name,
ChannelHandler handler)
Inserts a
ChannelHandler at the first position of this pipeline. |
ChannelPipeline |
addLast(ChannelHandler... handlers) |
ChannelPipeline |
addLast(EventExecutorGroup executor,
ChannelHandler... handlers) |
ChannelPipeline |
addLast(EventExecutorGroup group,
String name,
ChannelHandler handler)
Appends a
ChannelHandler at the last position of this pipeline. |
ChannelPipeline |
addLast(String name,
ChannelHandler handler)
Appends a
ChannelHandler at the last position of this pipeline. |
ChannelFuture |
bind(SocketAddress localAddress) |
ChannelFuture |
bind(SocketAddress localAddress,
ChannelFuture future) |
Channel |
channel()
Returns the
Channel that this pipeline is attached to. |
ChannelFuture |
close() |
ChannelFuture |
close(ChannelFuture future) |
ChannelFuture |
connect(SocketAddress remoteAddress) |
ChannelFuture |
connect(SocketAddress remoteAddress,
ChannelFuture future) |
ChannelFuture |
connect(SocketAddress remoteAddress,
SocketAddress localAddress) |
ChannelFuture |
connect(SocketAddress remoteAddress,
SocketAddress localAddress,
ChannelFuture future) |
ChannelHandlerContext |
context(ChannelHandler handler)
Returns the context object of the specified
ChannelHandler in
this pipeline. |
ChannelHandlerContext |
context(Class<? extends ChannelHandler> handlerType)
Returns the context object of the
ChannelHandler of the
specified type in this pipeline. |
ChannelHandlerContext |
context(String name)
Returns the context object of the
ChannelHandler with the
specified name in this pipeline. |
ChannelFuture |
deregister() |
ChannelFuture |
deregister(ChannelFuture future) |
ChannelFuture |
disconnect() |
ChannelFuture |
disconnect(ChannelFuture future) |
void |
fireChannelActive() |
void |
fireChannelInactive() |
void |
fireChannelRegistered() |
void |
fireChannelUnregistered() |
void |
fireExceptionCaught(Throwable cause) |
void |
fireInboundBufferUpdated() |
void |
fireUserEventTriggered(Object event) |
ChannelHandler |
first()
Returns the first
ChannelHandler in this pipeline. |
ChannelHandlerContext |
firstContext()
Returns the context of the first
ChannelHandler in this pipeline. |
ChannelFuture |
flush() |
ChannelFuture |
flush(ChannelFuture future) |
<T extends ChannelHandler> |
get(Class<T> handlerType)
Returns the
ChannelHandler of the specified type in this
pipeline. |
ChannelHandler |
get(String name)
Returns the
ChannelHandler with the specified name in this
pipeline. |
io.netty.buffer.ByteBuf |
inboundByteBuffer() |
io.netty.buffer.MessageBuf<Object> |
inboundMessageBuffer() |
ChannelHandler |
last()
Returns the last
ChannelHandler in this pipeline. |
ChannelHandlerContext |
lastContext()
Returns the context of the last
ChannelHandler in this pipeline. |
List<String> |
names()
Returns the
List of the handler names. |
protected void |
notifyHandlerException(Throwable cause) |
io.netty.buffer.ByteBuf |
outboundByteBuffer() |
io.netty.buffer.MessageBuf<Object> |
outboundMessageBuffer() |
void |
remove(ChannelHandler handler)
Removes the specified
ChannelHandler from this pipeline. |
<T extends ChannelHandler> |
remove(Class<T> handlerType)
Removes the
ChannelHandler of the specified type from this
pipeline |
ChannelHandler |
remove(String name)
Removes the
ChannelHandler with the specified name from this
pipeline. |
ChannelHandler |
removeFirst()
Removes the first
ChannelHandler in this pipeline. |
ChannelHandler |
removeLast()
Removes the last
ChannelHandler in this pipeline. |
void |
replace(ChannelHandler oldHandler,
String newName,
ChannelHandler newHandler)
Replaces the specified
ChannelHandler with a new handler in
this pipeline. |
<T extends ChannelHandler> |
replace(Class<T> oldHandlerType,
String newName,
ChannelHandler newHandler)
Replaces the
ChannelHandler of the specified type with a new
handler in this pipeline. |
ChannelHandler |
replace(String oldName,
String newName,
ChannelHandler newHandler)
Replaces the
ChannelHandler of the specified name with a new
handler in this pipeline. |
Map<String,ChannelHandler> |
toMap()
Converts this pipeline into an ordered
Map whose keys are
handler names and whose values are handlers. |
String |
toString()
Returns the
String representation of this pipeline. |
ChannelFuture |
write(Object message) |
ChannelFuture |
write(Object message,
ChannelFuture future) |
public DefaultChannelPipeline(Channel channel)
public Channel channel()
ChannelPipelineChannel that this pipeline is attached to.channel in interface ChannelPipelinenull if this pipeline is not attached yet.public ChannelPipeline addFirst(String name, ChannelHandler handler)
ChannelPipelineChannelHandler at the first position of this pipeline.addFirst in interface ChannelPipelinename - the name of the handler to insert firsthandler - the handler to insert firstpublic ChannelPipeline addFirst(EventExecutorGroup group, String name, ChannelHandler handler)
ChannelPipelineChannelHandler at the first position of this pipeline.addFirst in interface ChannelPipelinename - the name of the handler to insert firsthandler - the handler to insert firstpublic ChannelPipeline addLast(String name, ChannelHandler handler)
ChannelPipelineChannelHandler at the last position of this pipeline.addLast in interface ChannelPipelinename - the name of the handler to appendhandler - the handler to appendpublic ChannelPipeline addLast(EventExecutorGroup group, String name, ChannelHandler handler)
ChannelPipelineChannelHandler at the last position of this pipeline.addLast in interface ChannelPipelinename - the name of the handler to appendhandler - the handler to appendpublic ChannelPipeline addBefore(String baseName, String name, ChannelHandler handler)
ChannelPipelineChannelHandler before an existing handler of this
pipeline.addBefore in interface ChannelPipelinebaseName - the name of the existing handlername - the name of the handler to insert beforehandler - the handler to insert beforepublic ChannelPipeline addBefore(EventExecutorGroup group, String baseName, String name, ChannelHandler handler)
ChannelPipelineChannelHandler before an existing handler of this
pipeline.addBefore in interface ChannelPipelinebaseName - the name of the existing handlername - the name of the handler to insert beforehandler - the handler to insert beforepublic ChannelPipeline addAfter(String baseName, String name, ChannelHandler handler)
ChannelPipelineChannelHandler after an existing handler of this
pipeline.addAfter in interface ChannelPipelinebaseName - the name of the existing handlername - the name of the handler to insert afterhandler - the handler to insert afterpublic ChannelPipeline addAfter(EventExecutorGroup group, String baseName, String name, ChannelHandler handler)
ChannelPipelineChannelHandler after an existing handler of this
pipeline.addAfter in interface ChannelPipelinebaseName - the name of the existing handlername - the name of the handler to insert afterhandler - the handler to insert afterpublic ChannelPipeline addFirst(ChannelHandler... handlers)
addFirst in interface ChannelPipelinepublic ChannelPipeline addFirst(EventExecutorGroup executor, ChannelHandler... handlers)
addFirst in interface ChannelPipelinepublic ChannelPipeline addLast(ChannelHandler... handlers)
addLast in interface ChannelPipelinepublic ChannelPipeline addLast(EventExecutorGroup executor, ChannelHandler... handlers)
addLast in interface ChannelPipelinepublic void remove(ChannelHandler handler)
ChannelPipelineChannelHandler from this pipeline.remove in interface ChannelPipelinepublic ChannelHandler remove(String name)
ChannelPipelineChannelHandler with the specified name from this
pipeline.remove in interface ChannelPipelinepublic <T extends ChannelHandler> T remove(Class<T> handlerType)
ChannelPipelineChannelHandler of the specified type from this
pipelineremove in interface ChannelPipelineT - the type of the handlerhandlerType - the type of the handlerpublic ChannelHandler removeFirst()
ChannelPipelineChannelHandler in this pipeline.removeFirst in interface ChannelPipelinepublic ChannelHandler removeLast()
ChannelPipelineChannelHandler in this pipeline.removeLast in interface ChannelPipelinepublic void replace(ChannelHandler oldHandler, String newName, ChannelHandler newHandler)
ChannelPipelineChannelHandler with a new handler in
this pipeline.replace in interface ChannelPipelinepublic ChannelHandler replace(String oldName, String newName, ChannelHandler newHandler)
ChannelPipelineChannelHandler of the specified name with a new
handler in this pipeline.replace in interface ChannelPipelinepublic <T extends ChannelHandler> T replace(Class<T> oldHandlerType, String newName, ChannelHandler newHandler)
ChannelPipelineChannelHandler of the specified type with a new
handler in this pipeline.replace in interface ChannelPipelinepublic ChannelHandler first()
ChannelPipelineChannelHandler in this pipeline.first in interface ChannelPipelinenull if this pipeline is empty.public ChannelHandlerContext firstContext()
ChannelPipelineChannelHandler in this pipeline.firstContext in interface ChannelPipelinenull if this pipeline is empty.public ChannelHandler last()
ChannelPipelineChannelHandler in this pipeline.last in interface ChannelPipelinenull if this pipeline is empty.public ChannelHandlerContext lastContext()
ChannelPipelineChannelHandler in this pipeline.lastContext in interface ChannelPipelinenull if this pipeline is empty.public ChannelHandler get(String name)
ChannelPipelineChannelHandler with the specified name in this
pipeline.get in interface ChannelPipelinenull if there's no such handler in this pipeline.public <T extends ChannelHandler> T get(Class<T> handlerType)
ChannelPipelineChannelHandler of the specified type in this
pipeline.get in interface ChannelPipelinenull if there's no such handler in this pipeline.public ChannelHandlerContext context(String name)
ChannelPipelineChannelHandler with the
specified name in this pipeline.context in interface ChannelPipelinenull if there's no such handler in this pipeline.public ChannelHandlerContext context(ChannelHandler handler)
ChannelPipelineChannelHandler in
this pipeline.context in interface ChannelPipelinenull if there's no such handler in this pipeline.public ChannelHandlerContext context(Class<? extends ChannelHandler> handlerType)
ChannelPipelineChannelHandler of the
specified type in this pipeline.context in interface ChannelPipelinenull if there's no such handler in this pipeline.public List<String> names()
ChannelPipelineList of the handler names.names in interface ChannelPipelinepublic Map<String,ChannelHandler> toMap()
ChannelPipelineMap whose keys are
handler names and whose values are handlers.toMap in interface ChannelPipelinepublic io.netty.buffer.MessageBuf<Object> inboundMessageBuffer()
inboundMessageBuffer in interface ChannelPipelinepublic io.netty.buffer.ByteBuf inboundByteBuffer()
inboundByteBuffer in interface ChannelPipelinepublic io.netty.buffer.MessageBuf<Object> outboundMessageBuffer()
outboundMessageBuffer in interface ChannelPipelinepublic io.netty.buffer.ByteBuf outboundByteBuffer()
outboundByteBuffer in interface ChannelPipelinepublic void fireChannelRegistered()
fireChannelRegistered in interface ChannelInboundInvokerpublic void fireChannelUnregistered()
fireChannelUnregistered in interface ChannelInboundInvokerpublic void fireChannelActive()
fireChannelActive in interface ChannelInboundInvokerpublic void fireChannelInactive()
fireChannelInactive in interface ChannelInboundInvokerpublic void fireExceptionCaught(Throwable cause)
fireExceptionCaught in interface ChannelInboundInvokerpublic void fireUserEventTriggered(Object event)
fireUserEventTriggered in interface ChannelInboundInvokerpublic void fireInboundBufferUpdated()
fireInboundBufferUpdated in interface ChannelInboundInvokerpublic ChannelFuture bind(SocketAddress localAddress)
bind in interface ChannelOutboundInvokerpublic ChannelFuture connect(SocketAddress remoteAddress)
connect in interface ChannelOutboundInvokerpublic ChannelFuture connect(SocketAddress remoteAddress, SocketAddress localAddress)
connect in interface ChannelOutboundInvokerpublic ChannelFuture disconnect()
disconnect in interface ChannelOutboundInvokerpublic ChannelFuture close()
close in interface ChannelOutboundInvokerpublic ChannelFuture deregister()
deregister in interface ChannelOutboundInvokerpublic ChannelFuture flush()
flush in interface ChannelOutboundInvokerpublic ChannelFuture write(Object message)
write in interface ChannelOutboundInvokerpublic ChannelFuture bind(SocketAddress localAddress, ChannelFuture future)
bind in interface ChannelOutboundInvokerpublic ChannelFuture connect(SocketAddress remoteAddress, ChannelFuture future)
connect in interface ChannelOutboundInvokerpublic ChannelFuture connect(SocketAddress remoteAddress, SocketAddress localAddress, ChannelFuture future)
connect in interface ChannelOutboundInvokerpublic ChannelFuture disconnect(ChannelFuture future)
disconnect in interface ChannelOutboundInvokerpublic ChannelFuture close(ChannelFuture future)
close in interface ChannelOutboundInvokerpublic ChannelFuture deregister(ChannelFuture future)
deregister in interface ChannelOutboundInvokerpublic ChannelFuture flush(ChannelFuture future)
flush in interface ChannelOutboundInvokerpublic ChannelFuture write(Object message, ChannelFuture future)
write in interface ChannelOutboundInvokerprotected void notifyHandlerException(Throwable cause)
Copyright © 2008-2012 The Netty Project. All Rights Reserved.