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 anIoHandle
for aSelectableChannel
, not necessarily created by Netty. ThisIoHandle
can be used together withNioIoHandler
and 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 void
close()
protected void
deregister(S channel)
void
handle(IoRegistration registration, IoEvent ioEvent)
Be called once there is something to handle.protected abstract void
handle(S channel, java.nio.channels.SelectionKey key)
java.nio.channels.SelectableChannel
selectableChannel()
The underlyingSelectableChannel
.
-
-
-
Constructor Detail
-
NioSelectableChannelIoHandle
public NioSelectableChannelIoHandle(S channel)
-
-
Method Detail
-
handle
public void handle(IoRegistration registration, IoEvent ioEvent)
Description copied from interface:IoHandle
Be called once there is something to handle.
-
close
public void close() throws java.lang.Exception
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Throws:
java.lang.Exception
-
selectableChannel
public java.nio.channels.SelectableChannel selectableChannel()
Description copied from interface:NioIoHandle
The underlyingSelectableChannel
.- Specified by:
selectableChannel
in interfaceNioIoHandle
- Returns:
- the channel
-
handle
protected abstract void handle(S channel, java.nio.channels.SelectionKey key)
-
deregister
protected void deregister(S channel)
-
-