Class NioDatagramWorker
java.lang.Object
org.jboss.netty.channel.socket.nio.AbstractNioSelector
org.jboss.netty.channel.socket.nio.AbstractNioWorker
org.jboss.netty.channel.socket.nio.NioDatagramWorker
- All Implemented Interfaces:
Runnable, NioSelector, Worker
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate final classRegisterTask is a task responsible for registering a channel with a selector. -
Field Summary
FieldsFields inherited from class AbstractNioWorker
sendBufferPoolFields inherited from class AbstractNioSelector
logger, selector, startupLatch, thread, wakenUp -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected RunnablecreateRegisterTask(Channel channel, ChannelFuture future) (package private) static voiddisconnect(NioDatagramChannel channel, ChannelFuture future) protected booleanread(SelectionKey key) Read is called when a Selector has been notified that the underlying channel was something to be read.voidrun()protected booleanscheduleWriteIfNecessary(AbstractNioChannel<?> channel) protected voidwrite0(AbstractNioChannel<?> channel) voidwriteFromUserCode(AbstractNioChannel<?> channel) Methods inherited from class AbstractNioWorker
cleanUpWriteBuffer, clearOpWrite, close, close, executeInIoThread, executeInIoThread, isIoThread, newThreadRenamingRunnable, process, setInterestOps, setOpWrite, writeFromSelectorLoop, writeFromTaskLoopMethods inherited from class AbstractNioSelector
cleanUpCancelledKeys, increaseCancelledKeys, isIoThread, rebuildSelector, register, registerTask, select, shutdown
-
Field Details
-
bufferAllocator
-
-
Constructor Details
-
NioDatagramWorker
NioDatagramWorker(Executor executor) Sole constructor.- Parameters:
executor- theExecutorused to executeRunnables such asNioDatagramWorker.ChannelRegistionTask
-
-
Method Details
-
read
Description copied from class:AbstractNioWorkerRead 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:
readin classAbstractNioWorker- Parameters:
key- The selection key which contains the Selector registration information.
-
scheduleWriteIfNecessary
- Specified by:
scheduleWriteIfNecessaryin classAbstractNioWorker
-
disconnect
-
createRegisterTask
- Specified by:
createRegisterTaskin classAbstractNioSelector
-
writeFromUserCode
- Overrides:
writeFromUserCodein classAbstractNioWorker
-
write0
- Overrides:
write0in classAbstractNioWorker
-
run
public void run()- Specified by:
runin interfaceRunnable- Overrides:
runin classAbstractNioWorker
-