Package org.jboss.netty.channel
Class DefaultChannelPipeline.DefaultChannelHandlerContext
java.lang.Object
org.jboss.netty.channel.DefaultChannelPipeline.DefaultChannelHandlerContext
- All Implemented Interfaces:
ChannelHandlerContext
- Enclosing class:
DefaultChannelPipeline
private final class DefaultChannelPipeline.DefaultChannelHandlerContext
extends Object
implements ChannelHandlerContext
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Object
private final boolean
private final boolean
private final ChannelHandler
private final String
(package private) DefaultChannelPipeline.DefaultChannelHandlerContext
(package private) DefaultChannelPipeline.DefaultChannelHandlerContext
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultChannelHandlerContext
(DefaultChannelPipeline.DefaultChannelHandlerContext prev, DefaultChannelPipeline.DefaultChannelHandlerContext next, String name, ChannelHandler handler) -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
Retrieves an object which isattached
to this context.Returns theChannel
that theChannelPipeline
belongs to.Returns theChannelHandler
that this context object is serving.getName()
Returns the name of theChannelHandler
in theChannelPipeline
.Returns theChannelPipeline
that theChannelHandler
belongs to.void
Sends the specifiedChannelEvent
to theChannelDownstreamHandler
which is placed in the closest downstream from the handler associated with this context.void
Sends the specifiedChannelEvent
to theChannelUpstreamHandler
which is placed in the closest upstream from the handler associated with this context.void
setAttachment
(Object attachment) Attaches an object to this context to store a stateful information specific to theChannelHandler
which is associated with this context.
-
Field Details
-
next
-
prev
-
name
-
handler
-
canHandleUpstream
private final boolean canHandleUpstream -
canHandleDownstream
private final boolean canHandleDownstream -
attachment
-
-
Constructor Details
-
DefaultChannelHandlerContext
DefaultChannelHandlerContext(DefaultChannelPipeline.DefaultChannelHandlerContext prev, DefaultChannelPipeline.DefaultChannelHandlerContext next, String name, ChannelHandler handler)
-
-
Method Details
-
getChannel
Description copied from interface:ChannelHandlerContext
Returns theChannel
that theChannelPipeline
belongs to. This method is a shortcut to getPipeline().getChannel().- Specified by:
getChannel
in interfaceChannelHandlerContext
-
getPipeline
Description copied from interface:ChannelHandlerContext
Returns theChannelPipeline
that theChannelHandler
belongs to.- Specified by:
getPipeline
in interfaceChannelHandlerContext
-
canHandleDownstream
public boolean canHandleDownstream()Description copied from interface:ChannelHandlerContext
- Specified by:
canHandleDownstream
in interfaceChannelHandlerContext
-
canHandleUpstream
public boolean canHandleUpstream()Description copied from interface:ChannelHandlerContext
- Specified by:
canHandleUpstream
in interfaceChannelHandlerContext
-
getHandler
Description copied from interface:ChannelHandlerContext
Returns theChannelHandler
that this context object is serving.- Specified by:
getHandler
in interfaceChannelHandlerContext
-
getName
Description copied from interface:ChannelHandlerContext
Returns the name of theChannelHandler
in theChannelPipeline
.- Specified by:
getName
in interfaceChannelHandlerContext
-
getAttachment
Description copied from interface:ChannelHandlerContext
Retrieves an object which isattached
to this context.- Specified by:
getAttachment
in interfaceChannelHandlerContext
- Returns:
null
if no object was attached ornull
was attached
-
setAttachment
Description copied from interface:ChannelHandlerContext
Attaches an object to this context to store a stateful information specific to theChannelHandler
which is associated with this context.- Specified by:
setAttachment
in interfaceChannelHandlerContext
-
sendDownstream
Description copied from interface:ChannelHandlerContext
Sends the specifiedChannelEvent
to theChannelDownstreamHandler
which is placed in the closest downstream from the handler associated with this context. It is recommended to use the shortcut methods inChannels
rather than calling this method directly.- Specified by:
sendDownstream
in interfaceChannelHandlerContext
-
sendUpstream
Description copied from interface:ChannelHandlerContext
Sends the specifiedChannelEvent
to theChannelUpstreamHandler
which is placed in the closest upstream from the handler associated with this context. It is recommended to use the shortcut methods inChannels
rather than calling this method directly.- Specified by:
sendUpstream
in interfaceChannelHandlerContext
-