Class ChannelEventRunnable
- java.lang.Object
-
- org.jboss.netty.handler.execution.ChannelEventRunnable
-
- All Implemented Interfaces:
java.lang.Runnable
,EstimatableObjectWrapper
- Direct Known Subclasses:
ChannelDownstreamEventRunnable
,ChannelUpstreamEventRunnable
public abstract class ChannelEventRunnable extends java.lang.Object implements java.lang.Runnable, EstimatableObjectWrapper
-
-
Field Summary
Fields Modifier and Type Field Description protected ChannelHandlerContext
ctx
protected ChannelEvent
e
(package private) int
estimatedSize
private java.util.concurrent.Executor
executor
protected static java.lang.ThreadLocal<java.util.concurrent.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, java.util.concurrent.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()
java.lang.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 java.lang.ThreadLocal<java.util.concurrent.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
-
estimatedSize
int estimatedSize
-
executor
private final java.util.concurrent.Executor executor
-
-
Constructor Detail
-
ChannelEventRunnable
protected ChannelEventRunnable(ChannelHandlerContext ctx, ChannelEvent e, java.util.concurrent.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 java.lang.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
-
run
public final void run()
- Specified by:
run
in interfacejava.lang.Runnable
-
doRun
protected abstract void doRun()
-
-