Class NioSelectableChannelIoHandle<S extends SelectableChannel>
java.lang.Object
io.netty.channel.nio.NioSelectableChannelIoHandle<S>
- All Implemented Interfaces:
IoHandle, NioIoHandle, AutoCloseable
public abstract class NioSelectableChannelIoHandle<S extends SelectableChannel>
extends Object
implements IoHandle, NioIoHandle
Allows to create an
IoHandle for a SelectableChannel, not necessarily created by Netty. This
IoHandle can be used together with NioIoHandler and so have events dispatched for
the SelectableChannel.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Called once theIoHandleshould be closed.protected voidderegister(S channel) voidhandle(IoRegistration registration, IoEvent ioEvent) Be called once there is something to handle.protected abstract voidhandle(S channel, SelectionKey key) The underlyingSelectableChannel.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IoHandle
registered, unregistered
-
Constructor Details
-
NioSelectableChannelIoHandle
-
-
Method Details
-
handle
Description copied from interface:IoHandleBe called once there is something to handle. -
close
Description copied from interface:IoHandleCalled once theIoHandleshould be closed. Even once this method is called this handle might still receive events viaIoHandle.handle(IoRegistration, IoEvent)(if it was previous be registered and so itsIoHandle.registered()method was called) until theIoHandle.unregistered()method is called.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceIoHandle- Throws:
Exception
-
selectableChannel
Description copied from interface:NioIoHandleThe underlyingSelectableChannel.- Specified by:
selectableChannelin interfaceNioIoHandle- Returns:
- the channel
-
handle
-
deregister
-