Class AbstractNioWorker
java.lang.Object
org.jboss.netty.channel.socket.nio.AbstractNioSelector
org.jboss.netty.channel.socket.nio.AbstractNioWorker
- All Implemented Interfaces:
Runnable
,NioSelector
,Worker
- Direct Known Subclasses:
NioDatagramWorker
,NioWorker
-
Field Summary
FieldsFields inherited from class org.jboss.netty.channel.socket.nio.AbstractNioSelector
logger, selector, startupLatch, thread, wakenUp
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractNioWorker
(Executor executor) AbstractNioWorker
(Executor executor, ThreadNameDeterminer determiner) -
Method Summary
Modifier and TypeMethodDescriptionprotected static void
cleanUpWriteBuffer
(AbstractNioChannel<?> channel) protected void
clearOpWrite
(AbstractNioChannel<?> channel) protected void
protected void
close
(AbstractNioChannel<?> channel, ChannelFuture future) void
executeInIoThread
(Runnable task) Execute the givenRunnable
in the IO-Thread.void
executeInIoThread
(Runnable task, boolean alwaysAsync) Execute theRunnable
in a IO-Thread(package private) static boolean
isIoThread
(AbstractNioChannel<?> channel) protected ThreadRenamingRunnable
newThreadRenamingRunnable
(int id, ThreadNameDeterminer determiner) protected void
protected abstract boolean
read
(SelectionKey k) Read is called when a Selector has been notified that the underlying channel was something to be read.void
run()
protected abstract boolean
scheduleWriteIfNecessary
(AbstractNioChannel<?> channel) (package private) void
setInterestOps
(AbstractNioChannel<?> channel, ChannelFuture future, int interestOps) protected void
setOpWrite
(AbstractNioChannel<?> channel) protected void
write0
(AbstractNioChannel<?> channel) (package private) void
(package private) void
(package private) void
writeFromUserCode
(AbstractNioChannel<?> channel) Methods inherited from class org.jboss.netty.channel.socket.nio.AbstractNioSelector
cleanUpCancelledKeys, createRegisterTask, increaseCancelledKeys, isIoThread, rebuildSelector, register, registerTask, select, shutdown
-
Field Details
-
sendBufferPool
-
-
Constructor Details
-
AbstractNioWorker
AbstractNioWorker(Executor executor) -
AbstractNioWorker
AbstractNioWorker(Executor executor, ThreadNameDeterminer determiner)
-
-
Method Details
-
executeInIoThread
Description copied from interface:Worker
Execute the givenRunnable
in the IO-Thread. This may be now or later once the IO-Thread do some other work.- Specified by:
executeInIoThread
in interfaceWorker
- Parameters:
task
- theRunnable
to execute
-
executeInIoThread
Execute theRunnable
in a IO-Thread -
close
- Specified by:
close
in classAbstractNioSelector
-
newThreadRenamingRunnable
- Specified by:
newThreadRenamingRunnable
in classAbstractNioSelector
-
run
public void run()- Specified by:
run
in interfaceRunnable
- Overrides:
run
in classAbstractNioSelector
-
process
- Specified by:
process
in classAbstractNioSelector
- Throws:
IOException
-
writeFromUserCode
-
writeFromTaskLoop
-
writeFromSelectorLoop
-
scheduleWriteIfNecessary
-
write0
-
isIoThread
-
setOpWrite
-
clearOpWrite
-
close
-
cleanUpWriteBuffer
-
setInterestOps
-
read
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.- Parameters:
k
- The selection key which contains the Selector registration information.
-