Class ChannelEventRunnable
- java.lang.Object
-
- org.jboss.netty.handler.execution.ChannelEventRunnable
-
- All Implemented Interfaces:
Runnable,EstimatableObjectWrapper
- Direct Known Subclasses:
ChannelDownstreamEventRunnable,ChannelUpstreamEventRunnable
public abstract class ChannelEventRunnable extends Object implements Runnable, EstimatableObjectWrapper
-
-
Field Summary
Fields Modifier and Type Field Description protected ChannelHandlerContextctxprotected ChannelEventeprotected static ThreadLocal<Executor>PARENTAn internal use only thread-local variable that tells theExecutorthat this worker acquired a worker thread from.
-
Constructor Summary
Constructors Modifier Constructor Description protectedChannelEventRunnable(ChannelHandlerContext ctx, ChannelEvent e, Executor executor)Creates aRunnablewhich sends the specifiedChannelEventupstream via the specifiedChannelHandlerContext.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voiddoRun()ChannelHandlerContextgetContext()Returns theChannelHandlerContextwhich will be used to send theChannelEventupstream.ChannelEventgetEvent()Returns theChannelEventwhich will be sent upstream.voidrun()Objectunwrap()Returns the underlying object that needs to be taken into account byObjectSizeEstimatorfor more accurate object size estimation.
-
-
-
Field Detail
-
PARENT
protected static final ThreadLocal<Executor> PARENT
An internal use only thread-local variable that tells theExecutorthat this worker acquired a worker thread from.
-
ctx
protected final ChannelHandlerContext ctx
-
e
protected final ChannelEvent e
-
-
Constructor Detail
-
ChannelEventRunnable
protected ChannelEventRunnable(ChannelHandlerContext ctx, ChannelEvent e, Executor executor)
Creates aRunnablewhich sends the specifiedChannelEventupstream via the specifiedChannelHandlerContext.
-
-
Method Detail
-
getContext
public ChannelHandlerContext getContext()
Returns theChannelHandlerContextwhich will be used to send theChannelEventupstream.
-
getEvent
public ChannelEvent getEvent()
Returns theChannelEventwhich will be sent upstream.
-
unwrap
public Object unwrap()
Description copied from interface:EstimatableObjectWrapperReturns the underlying object that needs to be taken into account byObjectSizeEstimatorfor more accurate object size estimation.- Specified by:
unwrapin interfaceEstimatableObjectWrapper
-
doRun
protected abstract void doRun()
-
-