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 voidcleanUpWriteBuffer(AbstractNioChannel<?> channel) protected voidclearOpWrite(AbstractNioChannel<?> channel) protected voidprotected voidclose(AbstractNioChannel<?> channel, ChannelFuture future) voidexecuteInIoThread(Runnable task) Execute the givenRunnablein the IO-Thread.voidexecuteInIoThread(Runnable task, boolean alwaysAsync) Execute theRunnablein a IO-Thread(package private) static booleanisIoThread(AbstractNioChannel<?> channel) protected ThreadRenamingRunnablenewThreadRenamingRunnable(int id, ThreadNameDeterminer determiner) protected voidprotected abstract booleanread(SelectionKey k) Read is called when a Selector has been notified that the underlying channel was something to be read.voidrun()protected abstract booleanscheduleWriteIfNecessary(AbstractNioChannel<?> channel) (package private) voidsetInterestOps(AbstractNioChannel<?> channel, ChannelFuture future, int interestOps) protected voidsetOpWrite(AbstractNioChannel<?> channel) protected voidwrite0(AbstractNioChannel<?> channel) (package private) void(package private) void(package private) voidwriteFromUserCode(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:WorkerExecute the givenRunnablein the IO-Thread. This may be now or later once the IO-Thread do some other work.- Specified by:
executeInIoThreadin interfaceWorker- Parameters:
task- theRunnableto execute
-
executeInIoThread
Execute theRunnablein a IO-Thread -
close
- Specified by:
closein classAbstractNioSelector
-
newThreadRenamingRunnable
- Specified by:
newThreadRenamingRunnablein classAbstractNioSelector
-
run
public void run()- Specified by:
runin interfaceRunnable- Overrides:
runin classAbstractNioSelector
-
process
- Specified by:
processin 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.
-