- java.lang.Object
-
- io.netty5.channel.nio.NioHandler
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deregister(IoHandle handle)
Deregister aIoHandle
for IO.void
destroy()
Destroy theIoHandler
and free all its resources.boolean
isCompatible(Class<? extends IoHandle> handleType)
Returnstrue
if the given type is compatible with thisIoHandler
and so can be registered,false
otherwise.static IoHandlerFactory
newFactory()
Returns a newIoHandlerFactory
that createsNioHandler
instances.static IoHandlerFactory
newFactory(SelectorProvider selectorProvider, SelectStrategyFactory selectStrategyFactory)
Returns a newIoHandlerFactory
that createsNioHandler
instances.void
prepareToDestroy()
Prepare to destroy thisIoHandler
.void
register(IoHandle handle)
Register aChannel
for IO.int
run(IoExecutionContext runner)
Run the IO handled by thisIoHandler
.SelectorProvider
selectorProvider()
void
wakeup(boolean inEventLoop)
Wakeup theIoHandler
, which means if any operation blocks it should be unblocked and return as soon as possible.
-
-
-
Method Detail
-
newFactory
public static IoHandlerFactory newFactory()
Returns a newIoHandlerFactory
that createsNioHandler
instances.
-
newFactory
public static IoHandlerFactory newFactory(SelectorProvider selectorProvider, SelectStrategyFactory selectStrategyFactory)
Returns a newIoHandlerFactory
that createsNioHandler
instances.
-
selectorProvider
public SelectorProvider selectorProvider()
-
register
public void register(IoHandle handle) throws Exception
Description copied from interface:IoHandler
Register aChannel
for IO.
-
deregister
public void deregister(IoHandle handle)
Description copied from interface:IoHandler
Deregister aIoHandle
for IO.- Specified by:
deregister
in interfaceIoHandler
- Parameters:
handle
- theIoHandle
to deregister..
-
run
public int run(IoExecutionContext runner)
Description copied from interface:IoHandler
Run the IO handled by thisIoHandler
. TheIoExecutionContext
should be used to ensure we not execute too long and so block the processing of other task that are scheduled on theEventLoop
. This is done by takingIoExecutionContext.delayNanos(long)
orIoExecutionContext.deadlineNanos()
into account.
-
destroy
public void destroy()
Description copied from interface:IoHandler
Destroy theIoHandler
and free all its resources.
-
prepareToDestroy
public void prepareToDestroy()
Description copied from interface:IoHandler
Prepare to destroy thisIoHandler
. This method will be called beforeIoHandler.destroy()
and may be called multiple times.- Specified by:
prepareToDestroy
in interfaceIoHandler
-
wakeup
public void wakeup(boolean inEventLoop)
Description copied from interface:IoHandler
Wakeup theIoHandler
, which means if any operation blocks it should be unblocked and return as soon as possible.
-
isCompatible
public boolean isCompatible(Class<? extends IoHandle> handleType)
Description copied from interface:IoHandler
Returnstrue
if the given type is compatible with thisIoHandler
and so can be registered,false
otherwise.- Specified by:
isCompatible
in interfaceIoHandler
- Parameters:
handleType
- the type of theIoHandle
.- Returns:
- if compatible of not.
-
-