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 ChannelHandlerContext
ctx
protected ChannelEvent
e
protected static ThreadLocal<Executor>
PARENT
An internal use only thread-local variable that tells theExecutor
that this worker acquired a worker thread from.
-
Constructor Summary
Constructors Modifier Constructor Description protected
ChannelEventRunnable(ChannelHandlerContext ctx, ChannelEvent e, Executor executor)
Creates aRunnable
which sends the specifiedChannelEvent
upstream via the specifiedChannelHandlerContext
.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
doRun()
ChannelHandlerContext
getContext()
Returns theChannelHandlerContext
which will be used to send theChannelEvent
upstream.ChannelEvent
getEvent()
Returns theChannelEvent
which will be sent upstream.void
run()
Object
unwrap()
Returns the underlying object that needs to be taken into account byObjectSizeEstimator
for more accurate object size estimation.
-
-
-
Field Detail
-
PARENT
protected static final ThreadLocal<Executor> PARENT
An internal use only thread-local variable that tells theExecutor
that 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 aRunnable
which sends the specifiedChannelEvent
upstream via the specifiedChannelHandlerContext
.
-
-
Method Detail
-
getContext
public ChannelHandlerContext getContext()
Returns theChannelHandlerContext
which will be used to send theChannelEvent
upstream.
-
getEvent
public ChannelEvent getEvent()
Returns theChannelEvent
which will be sent upstream.
-
unwrap
public Object unwrap()
Description copied from interface:EstimatableObjectWrapper
Returns the underlying object that needs to be taken into account byObjectSizeEstimator
for more accurate object size estimation.- Specified by:
unwrap
in interfaceEstimatableObjectWrapper
-
doRun
protected abstract void doRun()
-
-