Class NioIoHandler.DefaultNioRegistration
java.lang.Object
io.netty.channel.nio.NioIoHandler.DefaultNioRegistration
- All Implemented Interfaces:
IoRegistration
- Enclosing class:
NioIoHandler
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final java.util.concurrent.atomic.AtomicBooleanprivate final NioIoHandleprivate java.nio.channels.SelectionKey -
Constructor Summary
ConstructorsConstructorDescriptionDefaultNioRegistration(ThreadAwareExecutor executor, NioIoHandle handle, NioIoOps initialOps, java.nio.channels.Selector selector) -
Method Summary
Modifier and TypeMethodDescription<T> TImplementation specific attachment, which might benull.booleancancel()Cancel the registration.(package private) voidclose()(package private) NioIoHandlehandle()(package private) voidhandle(int ready) booleanisValid()Returnstrueif the registration is still valid.(package private) voidregister(java.nio.channels.Selector selector) longSubmit theIoOpsto the registration.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
canceled
private final java.util.concurrent.atomic.AtomicBoolean canceled -
handle
-
key
private volatile java.nio.channels.SelectionKey key
-
-
Constructor Details
-
DefaultNioRegistration
DefaultNioRegistration(ThreadAwareExecutor executor, NioIoHandle handle, NioIoOps initialOps, java.nio.channels.Selector selector) throws java.io.IOException - Throws:
java.io.IOException
-
-
Method Details
-
handle
NioIoHandle handle() -
register
void register(java.nio.channels.Selector selector) throws java.io.IOException - Throws:
java.io.IOException
-
attachment
public <T> T attachment()Description copied from interface:IoRegistrationImplementation specific attachment, which might benull.- Specified by:
attachmentin interfaceIoRegistration- Returns:
- attachment.
-
isValid
public boolean isValid()Description copied from interface:IoRegistrationReturnstrueif the registration is still valid. OnceIoRegistration.cancel()is called this will returnfalse.- Specified by:
isValidin interfaceIoRegistration- Returns:
- valid.
-
submit
Description copied from interface:IoRegistrationSubmit theIoOpsto the registration.- Specified by:
submitin interfaceIoRegistration- Parameters:
ops- ops.- Returns:
- an identifier for the operation, which might be unique or not (depending on the implementation).
-
cancel
public boolean cancel()Description copied from interface:IoRegistrationCancel the registration.- Specified by:
cancelin interfaceIoRegistration- Returns:
trueif cancellation was successful,falseotherwise.
-
close
void close() -
handle
void handle(int ready)
-