Package io.netty.channel.nio
Class NioSelectableChannelIoHandle<S extends java.nio.channels.SelectableChannel>
- java.lang.Object
-
- io.netty.channel.nio.NioSelectableChannelIoHandle<S>
-
- All Implemented Interfaces:
IoHandle,NioIoHandle,java.lang.AutoCloseable
public abstract class NioSelectableChannelIoHandle<S extends java.nio.channels.SelectableChannel> extends java.lang.Object implements IoHandle, NioIoHandle
Allows to create anIoHandlefor aSelectableChannel, not necessarily created by Netty. ThisIoHandlecan be used together withNioIoHandlerand so have events dispatched for theSelectableChannel.
-
-
Constructor Summary
Constructors Constructor Description NioSelectableChannelIoHandle(S channel)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclose()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, java.nio.channels.SelectionKey key)java.nio.channels.SelectableChannelselectableChannel()The underlyingSelectableChannel.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.netty.channel.IoHandle
registered, unregistered
-
-
-
-
Constructor Detail
-
NioSelectableChannelIoHandle
public NioSelectableChannelIoHandle(S channel)
-
-
Method Detail
-
handle
public void handle(IoRegistration registration, IoEvent ioEvent)
Description copied from interface:IoHandleBe called once there is something to handle.
-
close
public void close() throws java.lang.ExceptionDescription 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.
-
selectableChannel
public java.nio.channels.SelectableChannel selectableChannel()
Description copied from interface:NioIoHandleThe underlyingSelectableChannel.- Specified by:
selectableChannelin interfaceNioIoHandle- Returns:
- the channel
-
handle
protected abstract void handle(S channel, java.nio.channels.SelectionKey key)
-
deregister
protected void deregister(S channel)
-
-