@Deprecated public class StaticChannelPipeline extends Object implements ChannelPipeline
ChannelPipeline
that might perform better at the cost of
disabled dynamic insertion and removal of ChannelHandler
s.
An attempt to insert, remove, or replace a handler in this pipeline will
trigger an UnsupportedOperationException
.Constructor and Description |
---|
StaticChannelPipeline(ChannelHandler... handlers)
Deprecated.
Creates a new pipeline from the specified handlers.
|
Modifier and Type | Method and Description |
---|---|
void |
addAfter(String baseName,
String name,
ChannelHandler handler)
Deprecated.
Inserts a
ChannelHandler after an existing handler of this
pipeline. |
void |
addBefore(String baseName,
String name,
ChannelHandler handler)
Deprecated.
Inserts a
ChannelHandler before an existing handler of this
pipeline. |
void |
addFirst(String name,
ChannelHandler handler)
Deprecated.
Inserts a
ChannelHandler at the first position of this pipeline. |
void |
addLast(String name,
ChannelHandler handler)
Deprecated.
Appends a
ChannelHandler at the last position of this pipeline. |
void |
attach(Channel channel,
ChannelSink sink)
Deprecated.
Attaches this pipeline to the specified
Channel and
ChannelSink . |
ChannelFuture |
execute(Runnable task)
Deprecated.
Schedules the specified task to be executed in the I/O thread associated
with this pipeline's
Channel . |
<T extends ChannelHandler> |
get(Class<T> handlerType)
Deprecated.
Returns the
ChannelHandler of the specified type in this
pipeline. |
ChannelHandler |
get(String name)
Deprecated.
Returns the
ChannelHandler with the specified name in this
pipeline. |
Channel |
getChannel()
Deprecated.
Returns the
Channel that this pipeline is attached to. |
ChannelHandlerContext |
getContext(ChannelHandler handler)
Deprecated.
Returns the context object of the specified
ChannelHandler in
this pipeline. |
ChannelHandlerContext |
getContext(Class<? extends ChannelHandler> handlerType)
Deprecated.
Returns the context object of the
ChannelHandler of the
specified type in this pipeline. |
ChannelHandlerContext |
getContext(String name)
Deprecated.
Returns the context object of the
ChannelHandler with the
specified name in this pipeline. |
ChannelHandler |
getFirst()
Deprecated.
Returns the first
ChannelHandler in this pipeline. |
ChannelHandler |
getLast()
Deprecated.
Returns the last
ChannelHandler in this pipeline. |
List<String> |
getNames()
Deprecated.
Returns the
List of the handler names. |
ChannelSink |
getSink()
Deprecated.
Returns the
ChannelSink that this pipeline is attached to. |
boolean |
isAttached()
Deprecated.
Returns
true if and only if this pipeline is attached to
a Channel . |
protected void |
notifyHandlerException(ChannelEvent e,
Throwable t)
Deprecated.
|
void |
remove(ChannelHandler handler)
Deprecated.
Removes the specified
ChannelHandler from this pipeline. |
<T extends ChannelHandler> |
remove(Class<T> handlerType)
Deprecated.
Removes the
ChannelHandler of the specified type from this
pipeline |
ChannelHandler |
remove(String name)
Deprecated.
Removes the
ChannelHandler with the specified name from this
pipeline. |
ChannelHandler |
removeFirst()
Deprecated.
Removes the first
ChannelHandler in this pipeline. |
ChannelHandler |
removeLast()
Deprecated.
Removes the last
ChannelHandler in this pipeline. |
void |
replace(ChannelHandler oldHandler,
String newName,
ChannelHandler newHandler)
Deprecated.
Replaces the specified
ChannelHandler with a new handler in
this pipeline. |
<T extends ChannelHandler> |
replace(Class<T> oldHandlerType,
String newName,
ChannelHandler newHandler)
Deprecated.
Replaces the
ChannelHandler of the specified type with a new
handler in this pipeline. |
ChannelHandler |
replace(String oldName,
String newName,
ChannelHandler newHandler)
Deprecated.
Replaces the
ChannelHandler of the specified name with a new
handler in this pipeline. |
void |
sendDownstream(ChannelEvent e)
Deprecated.
Sends the specified
ChannelEvent to the last
ChannelDownstreamHandler in this pipeline. |
void |
sendUpstream(ChannelEvent e)
Deprecated.
Sends the specified
ChannelEvent to the first
ChannelUpstreamHandler in this pipeline. |
Map<String,ChannelHandler> |
toMap()
Deprecated.
Converts this pipeline into an ordered
Map whose keys are
handler names and whose values are handlers. |
String |
toString()
Deprecated.
Returns the
String representation of this pipeline. |
public StaticChannelPipeline(ChannelHandler... handlers)
"0"
, the second handler's name is
"1"
, the third handler's name is "2"
, and so on.public ChannelFuture execute(Runnable task)
ChannelPipeline
Channel
.execute
in interface ChannelPipeline
public Channel getChannel()
ChannelPipeline
Channel
that this pipeline is attached to.getChannel
in interface ChannelPipeline
null
if this pipeline is not attached yet.public ChannelSink getSink()
ChannelPipeline
ChannelSink
that this pipeline is attached to.getSink
in interface ChannelPipeline
null
if this pipeline is not attached yet.public void attach(Channel channel, ChannelSink sink)
ChannelPipeline
Channel
and
ChannelSink
. Once a pipeline is attached, it can't be detached
nor attached again.attach
in interface ChannelPipeline
public boolean isAttached()
ChannelPipeline
true
if and only if this pipeline is attached to
a Channel
.isAttached
in interface ChannelPipeline
public void addFirst(String name, ChannelHandler handler)
ChannelPipeline
ChannelHandler
at the first position of this pipeline.addFirst
in interface ChannelPipeline
name
- the name of the handler to insert firsthandler
- the handler to insert firstpublic void addLast(String name, ChannelHandler handler)
ChannelPipeline
ChannelHandler
at the last position of this pipeline.addLast
in interface ChannelPipeline
name
- the name of the handler to appendhandler
- the handler to appendpublic void addBefore(String baseName, String name, ChannelHandler handler)
ChannelPipeline
ChannelHandler
before an existing handler of this
pipeline.addBefore
in interface ChannelPipeline
baseName
- the name of the existing handlername
- the name of the handler to insert beforehandler
- the handler to insert beforepublic void addAfter(String baseName, String name, ChannelHandler handler)
ChannelPipeline
ChannelHandler
after an existing handler of this
pipeline.addAfter
in interface ChannelPipeline
baseName
- the name of the existing handlername
- the name of the handler to insert afterhandler
- the handler to insert afterpublic void remove(ChannelHandler handler)
ChannelPipeline
ChannelHandler
from this pipeline.remove
in interface ChannelPipeline
public ChannelHandler remove(String name)
ChannelPipeline
ChannelHandler
with the specified name from this
pipeline.remove
in interface ChannelPipeline
public <T extends ChannelHandler> T remove(Class<T> handlerType)
ChannelPipeline
ChannelHandler
of the specified type from this
pipelineremove
in interface ChannelPipeline
T
- the type of the handlerhandlerType
- the type of the handlerpublic ChannelHandler removeFirst()
ChannelPipeline
ChannelHandler
in this pipeline.removeFirst
in interface ChannelPipeline
public ChannelHandler removeLast()
ChannelPipeline
ChannelHandler
in this pipeline.removeLast
in interface ChannelPipeline
public void replace(ChannelHandler oldHandler, String newName, ChannelHandler newHandler)
ChannelPipeline
ChannelHandler
with a new handler in
this pipeline.replace
in interface ChannelPipeline
public ChannelHandler replace(String oldName, String newName, ChannelHandler newHandler)
ChannelPipeline
ChannelHandler
of the specified name with a new
handler in this pipeline.replace
in interface ChannelPipeline
public <T extends ChannelHandler> T replace(Class<T> oldHandlerType, String newName, ChannelHandler newHandler)
ChannelPipeline
ChannelHandler
of the specified type with a new
handler in this pipeline.replace
in interface ChannelPipeline
public ChannelHandler getFirst()
ChannelPipeline
ChannelHandler
in this pipeline.getFirst
in interface ChannelPipeline
null
if this pipeline is empty.public ChannelHandler getLast()
ChannelPipeline
ChannelHandler
in this pipeline.getLast
in interface ChannelPipeline
null
if this pipeline is empty.public ChannelHandler get(String name)
ChannelPipeline
ChannelHandler
with the specified name in this
pipeline.get
in interface ChannelPipeline
null
if there's no such handler in this pipeline.public <T extends ChannelHandler> T get(Class<T> handlerType)
ChannelPipeline
ChannelHandler
of the specified type in this
pipeline.get
in interface ChannelPipeline
null
if there's no such handler in this pipeline.public ChannelHandlerContext getContext(String name)
ChannelPipeline
ChannelHandler
with the
specified name in this pipeline.getContext
in interface ChannelPipeline
null
if there's no such handler in this pipeline.public ChannelHandlerContext getContext(ChannelHandler handler)
ChannelPipeline
ChannelHandler
in
this pipeline.getContext
in interface ChannelPipeline
null
if there's no such handler in this pipeline.public ChannelHandlerContext getContext(Class<? extends ChannelHandler> handlerType)
ChannelPipeline
ChannelHandler
of the
specified type in this pipeline.getContext
in interface ChannelPipeline
null
if there's no such handler in this pipeline.public List<String> getNames()
ChannelPipeline
List
of the handler names.getNames
in interface ChannelPipeline
public Map<String,ChannelHandler> toMap()
ChannelPipeline
Map
whose keys are
handler names and whose values are handlers.toMap
in interface ChannelPipeline
public void sendUpstream(ChannelEvent e)
ChannelPipeline
ChannelEvent
to the first
ChannelUpstreamHandler
in this pipeline.sendUpstream
in interface ChannelPipeline
public void sendDownstream(ChannelEvent e)
ChannelPipeline
ChannelEvent
to the last
ChannelDownstreamHandler
in this pipeline.sendDownstream
in interface ChannelPipeline
protected void notifyHandlerException(ChannelEvent e, Throwable t)
Copyright © 2008-2014 The Netty Project. All Rights Reserved.