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 java.lang.Object implements ChannelHandlerContext
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Objectattachmentprivate booleancanHandleDownstreamprivate booleancanHandleUpstreamprivate ChannelHandlerhandlerprivate java.lang.Stringname(package private) DefaultChannelPipeline.DefaultChannelHandlerContextnext(package private) DefaultChannelPipeline.DefaultChannelHandlerContextprev
-
Constructor Summary
Constructors Constructor Description DefaultChannelHandlerContext(DefaultChannelPipeline.DefaultChannelHandlerContext prev, DefaultChannelPipeline.DefaultChannelHandlerContext next, java.lang.String name, ChannelHandler handler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanHandleDownstream()booleancanHandleUpstream()java.lang.ObjectgetAttachment()Retrieves an object which isattachedto this context.ChannelgetChannel()Returns theChannelthat theChannelPipelinebelongs to.ChannelHandlergetHandler()Returns theChannelHandlerthat this context object is serving.java.lang.StringgetName()Returns the name of theChannelHandlerin theChannelPipeline.ChannelPipelinegetPipeline()Returns theChannelPipelinethat theChannelHandlerbelongs to.voidsendDownstream(ChannelEvent e)Sends the specifiedChannelEventto theChannelDownstreamHandlerwhich is placed in the closest downstream from the handler associated with this context.voidsendUpstream(ChannelEvent e)Sends the specifiedChannelEventto theChannelUpstreamHandlerwhich is placed in the closest upstream from the handler associated with this context.voidsetAttachment(java.lang.Object attachment)Attaches an object to this context to store a stateful information specific to theChannelHandlerwhich is associated with this context.
-
-
-
Field Detail
-
next
volatile DefaultChannelPipeline.DefaultChannelHandlerContext next
-
prev
volatile DefaultChannelPipeline.DefaultChannelHandlerContext prev
-
name
private final java.lang.String name
-
handler
private final ChannelHandler handler
-
canHandleUpstream
private final boolean canHandleUpstream
-
canHandleDownstream
private final boolean canHandleDownstream
-
attachment
private volatile java.lang.Object attachment
-
-
Constructor Detail
-
DefaultChannelHandlerContext
DefaultChannelHandlerContext(DefaultChannelPipeline.DefaultChannelHandlerContext prev, DefaultChannelPipeline.DefaultChannelHandlerContext next, java.lang.String name, ChannelHandler handler)
-
-
Method Detail
-
getChannel
public Channel getChannel()
Description copied from interface:ChannelHandlerContextReturns theChannelthat theChannelPipelinebelongs to. This method is a shortcut to getPipeline().getChannel().- Specified by:
getChannelin interfaceChannelHandlerContext
-
getPipeline
public ChannelPipeline getPipeline()
Description copied from interface:ChannelHandlerContextReturns theChannelPipelinethat theChannelHandlerbelongs to.- Specified by:
getPipelinein interfaceChannelHandlerContext
-
canHandleDownstream
public boolean canHandleDownstream()
Description copied from interface:ChannelHandlerContext- Specified by:
canHandleDownstreamin interfaceChannelHandlerContext
-
canHandleUpstream
public boolean canHandleUpstream()
Description copied from interface:ChannelHandlerContext- Specified by:
canHandleUpstreamin interfaceChannelHandlerContext
-
getHandler
public ChannelHandler getHandler()
Description copied from interface:ChannelHandlerContextReturns theChannelHandlerthat this context object is serving.- Specified by:
getHandlerin interfaceChannelHandlerContext
-
getName
public java.lang.String getName()
Description copied from interface:ChannelHandlerContextReturns the name of theChannelHandlerin theChannelPipeline.- Specified by:
getNamein interfaceChannelHandlerContext
-
getAttachment
public java.lang.Object getAttachment()
Description copied from interface:ChannelHandlerContextRetrieves an object which isattachedto this context.- Specified by:
getAttachmentin interfaceChannelHandlerContext- Returns:
nullif no object was attached ornullwas attached
-
setAttachment
public void setAttachment(java.lang.Object attachment)
Description copied from interface:ChannelHandlerContextAttaches an object to this context to store a stateful information specific to theChannelHandlerwhich is associated with this context.- Specified by:
setAttachmentin interfaceChannelHandlerContext
-
sendDownstream
public void sendDownstream(ChannelEvent e)
Description copied from interface:ChannelHandlerContextSends the specifiedChannelEventto theChannelDownstreamHandlerwhich is placed in the closest downstream from the handler associated with this context. It is recommended to use the shortcut methods inChannelsrather than calling this method directly.- Specified by:
sendDownstreamin interfaceChannelHandlerContext
-
sendUpstream
public void sendUpstream(ChannelEvent e)
Description copied from interface:ChannelHandlerContextSends the specifiedChannelEventto theChannelUpstreamHandlerwhich is placed in the closest upstream from the handler associated with this context. It is recommended to use the shortcut methods inChannelsrather than calling this method directly.- Specified by:
sendUpstreamin interfaceChannelHandlerContext
-
-