public class NioWorker extends Object
Modifier and Type | Field and Description |
---|---|
protected org.jboss.netty.channel.socket.nio.SocketSendBufferPool |
sendBufferPool |
protected Thread |
thread
If this worker has been started thread will be a reference to the thread
used when starting. i.e. the current thread when the run method is executed.
|
protected AtomicBoolean |
wakenUp
Boolean that controls determines if a blocked Selector.select should
break out of its selection process.
|
protected Queue<Runnable> |
writeTaskQueue
Queue of WriteTasks
|
Modifier and Type | Method and Description |
---|---|
protected static void |
cleanUpWriteBuffer(org.jboss.netty.channel.socket.nio.AbstractNioChannel<?> channel) |
protected void |
clearOpWrite(org.jboss.netty.channel.socket.nio.AbstractNioChannel<?> channel) |
protected Runnable |
createRegisterTask(org.jboss.netty.channel.socket.nio.AbstractNioChannel<?> channel,
ChannelFuture future)
|
void |
executeInIoThread(Runnable task)
Execute the given
Runnable in the IO-Thread. |
void |
executeInIoThread(Runnable task,
boolean alwaysAsync)
Execute the
Runnable in a IO-Thread |
protected boolean |
read(SelectionKey k)
Read is called when a Selector has been notified that the underlying channel
was something to be read.
|
void |
releaseExternalResources()
Releases the external resources that this object depends on.
|
void |
run() |
protected boolean |
scheduleWriteIfNecessary(org.jboss.netty.channel.socket.nio.AbstractNioChannel<?> channel) |
protected void |
setOpWrite(org.jboss.netty.channel.socket.nio.AbstractNioChannel<?> channel) |
protected void |
write0(org.jboss.netty.channel.socket.nio.AbstractNioChannel<?> channel) |
protected volatile Thread thread
protected final AtomicBoolean wakenUp
protected final org.jboss.netty.channel.socket.nio.SocketSendBufferPool sendBufferPool
public NioWorker(Executor executor)
protected boolean read(SelectionKey k)
k
- The selection key which contains the Selector registration information.protected boolean scheduleWriteIfNecessary(org.jboss.netty.channel.socket.nio.AbstractNioChannel<?> channel)
public void releaseExternalResources()
ExternalResourceReleasable
releaseExternalResources
in interface ExternalResourceReleasable
protected Runnable createRegisterTask(org.jboss.netty.channel.socket.nio.AbstractNioChannel<?> channel, ChannelFuture future)
public void executeInIoThread(Runnable task)
Worker
Runnable
in the IO-Thread. This may be now or
later once the IO-Thread do some other work.executeInIoThread
in interface Worker
task
- the Runnable
to executepublic void executeInIoThread(Runnable task, boolean alwaysAsync)
Runnable
in a IO-Threadprotected void write0(org.jboss.netty.channel.socket.nio.AbstractNioChannel<?> channel)
protected void setOpWrite(org.jboss.netty.channel.socket.nio.AbstractNioChannel<?> channel)
protected void clearOpWrite(org.jboss.netty.channel.socket.nio.AbstractNioChannel<?> channel)
protected static void cleanUpWriteBuffer(org.jboss.netty.channel.socket.nio.AbstractNioChannel<?> channel)
Copyright © 2008-2013 The Netty Project. All Rights Reserved.