private final class DefaultChannelPipeline.DefaultChannelHandlerContext extends java.lang.Object implements ChannelHandlerContext
| Modifier and Type | Field and Description |
|---|---|
private java.lang.Object |
attachment |
private boolean |
canHandleDownstream |
private boolean |
canHandleUpstream |
private ChannelHandler |
handler |
private java.lang.String |
name |
(package private) DefaultChannelPipeline.DefaultChannelHandlerContext |
next |
(package private) DefaultChannelPipeline.DefaultChannelHandlerContext |
prev |
| Constructor and Description |
|---|
DefaultChannelHandlerContext(DefaultChannelPipeline.DefaultChannelHandlerContext prev,
DefaultChannelPipeline.DefaultChannelHandlerContext next,
java.lang.String name,
ChannelHandler handler) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canHandleDownstream()
|
boolean |
canHandleUpstream()
|
java.lang.Object |
getAttachment()
Retrieves an object which is
attached to
this context. |
Channel |
getChannel()
Returns the
Channel that the ChannelPipeline belongs to. |
ChannelHandler |
getHandler()
Returns the
ChannelHandler that this context object is
serving. |
java.lang.String |
getName()
Returns the name of the
ChannelHandler in the
ChannelPipeline. |
ChannelPipeline |
getPipeline()
Returns the
ChannelPipeline that the ChannelHandler
belongs to. |
void |
sendDownstream(ChannelEvent e)
Sends the specified
ChannelEvent to the
ChannelDownstreamHandler which is placed in the closest
downstream from the handler associated with this context. |
void |
sendUpstream(ChannelEvent e)
Sends the specified
ChannelEvent to the
ChannelUpstreamHandler which is placed in the closest upstream
from the handler associated with this context. |
void |
setAttachment(java.lang.Object attachment)
Attaches an object to this context to store a stateful information
specific to the
ChannelHandler which is associated with this
context. |
volatile DefaultChannelPipeline.DefaultChannelHandlerContext next
volatile DefaultChannelPipeline.DefaultChannelHandlerContext prev
private final java.lang.String name
private final ChannelHandler handler
private final boolean canHandleUpstream
private final boolean canHandleDownstream
private volatile java.lang.Object attachment
DefaultChannelHandlerContext(DefaultChannelPipeline.DefaultChannelHandlerContext prev, DefaultChannelPipeline.DefaultChannelHandlerContext next, java.lang.String name, ChannelHandler handler)
public Channel getChannel()
ChannelHandlerContextChannel that the ChannelPipeline belongs to.
This method is a shortcut to getPipeline().getChannel().getChannel in interface ChannelHandlerContextpublic ChannelPipeline getPipeline()
ChannelHandlerContextChannelPipeline that the ChannelHandler
belongs to.getPipeline in interface ChannelHandlerContextpublic boolean canHandleDownstream()
ChannelHandlerContextcanHandleDownstream in interface ChannelHandlerContextpublic boolean canHandleUpstream()
ChannelHandlerContextcanHandleUpstream in interface ChannelHandlerContextpublic ChannelHandler getHandler()
ChannelHandlerContextChannelHandler that this context object is
serving.getHandler in interface ChannelHandlerContextpublic java.lang.String getName()
ChannelHandlerContextChannelHandler in the
ChannelPipeline.getName in interface ChannelHandlerContextpublic java.lang.Object getAttachment()
ChannelHandlerContextattached to
this context.getAttachment in interface ChannelHandlerContextnull if no object was attached or
null was attachedpublic void setAttachment(java.lang.Object attachment)
ChannelHandlerContextChannelHandler which is associated with this
context.setAttachment in interface ChannelHandlerContextpublic void sendDownstream(ChannelEvent e)
ChannelHandlerContextChannelEvent to the
ChannelDownstreamHandler which is placed in the closest
downstream from the handler associated with this context. It is
recommended to use the shortcut methods in Channels rather than
calling this method directly.sendDownstream in interface ChannelHandlerContextpublic void sendUpstream(ChannelEvent e)
ChannelHandlerContextChannelEvent to the
ChannelUpstreamHandler which is placed in the closest upstream
from the handler associated with this context. It is recommended to use
the shortcut methods in Channels rather than calling this method
directly.sendUpstream in interface ChannelHandlerContext