| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Destroy the
IoHandler and free all its resources. |
boolean |
isCompatible(Class<? extends IoHandle> handleType)
Returns
true if the given type is compatible with this IoHandler and so can be registered,
false otherwise. |
static IoHandlerFactory |
newFactory()
Returns a new
IoHandlerFactory that creates NioIoHandler instances |
static IoHandlerFactory |
newFactory(SelectorProvider selectorProvider)
Returns a new
IoHandlerFactory that creates NioIoHandler instances. |
static IoHandlerFactory |
newFactory(SelectorProvider selectorProvider,
SelectStrategyFactory selectStrategyFactory)
Returns a new
IoHandlerFactory that creates NioIoHandler instances. |
void |
prepareToDestroy()
Prepare to destroy this
IoHandler. |
NioIoRegistration |
register(IoEventLoop eventLoop,
IoHandle handle)
Register a
IoHandle for IO. |
int |
run(IoExecutionContext runner)
Run the IO handled by this
IoHandler. |
SelectorProvider |
selectorProvider()
|
void |
wakeup(IoEventLoop eventLoop)
Wakeup the
IoHandler, which means if any operation blocks it should be unblocked and
return as soon as possible. |
public SelectorProvider selectorProvider()
public NioIoRegistration register(IoEventLoop eventLoop, IoHandle handle) throws Exception
IoHandlerIoHandle for IO.register in interface IoHandlereventLoop - the IoEventLoop that did issue the registration.handle - the IoHandle to register.Exception - thrown if an error happens during registration.public int run(IoExecutionContext runner)
IoHandlerIoHandler. The IoExecutionContext should be used
to ensure we not execute too long and so block the processing of other task that are
scheduled on the EventLoop. This is done by taking IoExecutionContext.delayNanos(long) or
IoExecutionContext.deadlineNanos() into account.public void destroy()
IoHandlerpublic void prepareToDestroy()
IoHandlerIoHandler. This method will be called before IoHandler.destroy() and may be
called multiple times.prepareToDestroy in interface IoHandlerpublic void wakeup(IoEventLoop eventLoop)
IoHandlerIoHandler, which means if any operation blocks it should be unblocked and
return as soon as possible.public boolean isCompatible(Class<? extends IoHandle> handleType)
IoHandlertrue if the given type is compatible with this IoHandler and so can be registered,
false otherwise.isCompatible in interface IoHandlerhandleType - the type of the IoHandle.public static IoHandlerFactory newFactory()
IoHandlerFactory that creates NioIoHandler instancesIoHandlerFactory.public static IoHandlerFactory newFactory(SelectorProvider selectorProvider)
IoHandlerFactory that creates NioIoHandler instances.selectorProvider - the SelectorProvider to use.IoHandlerFactory.public static IoHandlerFactory newFactory(SelectorProvider selectorProvider, SelectStrategyFactory selectStrategyFactory)
IoHandlerFactory that creates NioIoHandler instances.selectorProvider - the SelectorProvider to use.selectStrategyFactory - the SelectStrategyFactory to use.IoHandlerFactory.Copyright © 2008–2025 The Netty Project. All rights reserved.