Package io.netty.channel
Interface IoHandle
-
- All Superinterfaces:
java.lang.AutoCloseable
- All Known Subinterfaces:
EpollIoHandle,IoUringIoHandle,KQueueIoHandle,NioIoHandle
- All Known Implementing Classes:
AbstractNioByteChannel.NioByteUnsafe,AbstractNioChannel.AbstractNioUnsafe,NioSelectableChannelIoHandle
public interface IoHandle extends java.lang.AutoCloseableA handle that can be registered to anIoHandler. All methods must be called from theThreadAwareExecutorthread (which meansThreadAwareExecutor.isExecutorThread(Thread)must returntrue).All the methods are expected to be called from the
IoHandleron which thisIoHandlewas registered viaIoHandler.register(IoHandle).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidclose()Called once theIoHandleshould be closed.voidhandle(IoRegistration registration, IoEvent ioEvent)Be called once there is something to handle.default voidregistered()Called once thisIoHandlewas registered and so will start to receive events viahandle(IoRegistration, IoEvent).default voidunregistered()Called once thisIoHandlewas unregistered and so will not receive any more events viahandle(IoRegistration, IoEvent).
-
-
-
Method Detail
-
handle
void handle(IoRegistration registration, IoEvent ioEvent)
Be called once there is something to handle.- Parameters:
registration- theIoRegistrationfor thisIoHandle.ioEvent- theIoEventthat must be handled. TheIoEventis only valid while this method is executed and so must not escape it.
-
registered
default void registered()
Called once thisIoHandlewas registered and so will start to receive events viahandle(IoRegistration, IoEvent).
-
unregistered
default void unregistered()
Called once thisIoHandlewas unregistered and so will not receive any more events viahandle(IoRegistration, IoEvent).
-
close
void close() throws java.lang.ExceptionCalled once theIoHandleshould be closed. Even once this method is called this handle might still receive events viahandle(IoRegistration, IoEvent)(if it was previous be registered and so itsregistered()method was called) until theunregistered()method is called.- Specified by:
closein interfacejava.lang.AutoCloseable- Throws:
java.lang.Exception
-
-