Class NioWorker
- java.lang.Object
-
- org.jboss.netty.channel.socket.nio.AbstractNioSelector
-
- org.jboss.netty.channel.socket.nio.AbstractNioWorker
-
- org.jboss.netty.channel.socket.nio.NioWorker
-
- All Implemented Interfaces:
java.lang.Runnable
,NioSelector
,Worker
public class NioWorker extends AbstractNioWorker
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
NioWorker.RegisterTask
-
Field Summary
Fields Modifier and Type Field Description private SocketReceiveBufferAllocator
recvBufferPool
-
Fields inherited from class org.jboss.netty.channel.socket.nio.AbstractNioWorker
sendBufferPool
-
Fields inherited from class org.jboss.netty.channel.socket.nio.AbstractNioSelector
logger, selector, startupLatch, thread, wakenUp
-
-
Constructor Summary
Constructors Constructor Description NioWorker(java.util.concurrent.Executor executor)
NioWorker(java.util.concurrent.Executor executor, ThreadNameDeterminer determiner)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.Runnable
createRegisterTask(Channel channel, ChannelFuture future)
protected boolean
read(java.nio.channels.SelectionKey k)
Read is called when a Selector has been notified that the underlying channel was something to be read.void
run()
protected boolean
scheduleWriteIfNecessary(AbstractNioChannel<?> channel)
-
Methods inherited from class org.jboss.netty.channel.socket.nio.AbstractNioWorker
cleanUpWriteBuffer, clearOpWrite, close, close, executeInIoThread, executeInIoThread, isIoThread, newThreadRenamingRunnable, process, setInterestOps, setOpWrite, write0, writeFromSelectorLoop, writeFromTaskLoop, writeFromUserCode
-
Methods inherited from class org.jboss.netty.channel.socket.nio.AbstractNioSelector
cleanUpCancelledKeys, increaseCancelledKeys, isIoThread, rebuildSelector, register, registerTask, select, shutdown
-
-
-
-
Field Detail
-
recvBufferPool
private final SocketReceiveBufferAllocator recvBufferPool
-
-
Constructor Detail
-
NioWorker
public NioWorker(java.util.concurrent.Executor executor)
-
NioWorker
public NioWorker(java.util.concurrent.Executor executor, ThreadNameDeterminer determiner)
-
-
Method Detail
-
read
protected boolean read(java.nio.channels.SelectionKey k)
Description copied from class:AbstractNioWorker
Read is called when a Selector has been notified that the underlying channel was something to be read. The channel would previously have registered its interest in read operations.- Specified by:
read
in classAbstractNioWorker
- Parameters:
k
- The selection key which contains the Selector registration information.
-
scheduleWriteIfNecessary
protected boolean scheduleWriteIfNecessary(AbstractNioChannel<?> channel)
- Specified by:
scheduleWriteIfNecessary
in classAbstractNioWorker
-
createRegisterTask
protected java.lang.Runnable createRegisterTask(Channel channel, ChannelFuture future)
- Specified by:
createRegisterTask
in classAbstractNioSelector
-
run
public void run()
- Specified by:
run
in interfacejava.lang.Runnable
- Overrides:
run
in classAbstractNioWorker
-
-