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 ChannelHandlerContextctxprotected ChannelEvente(package private) intestimatedSizeprivate java.util.concurrent.Executorexecutorprotected static java.lang.ThreadLocal<java.util.concurrent.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, java.util.concurrent.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()java.lang.Objectunwrap()Returns the underlying object that needs to be taken into account byObjectSizeEstimatorfor 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 theExecutorthat 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 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 java.lang.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
-
run
public final void run()
- Specified by:
runin interfacejava.lang.Runnable
-
doRun
protected abstract void doRun()
-
-