- java.lang.Object
-
- io.netty5.channel.epoll.EpollHandler
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidderegister(IoHandle handle)Deregister aIoHandlefor IO.voiddestroy()Destroy theIoHandlerand free all its resources.booleanisCompatible(Class<? extends IoHandle> handleType)Returnstrueif the given type is compatible with thisIoHandlerand so can be registered,falseotherwise.static IoHandlerFactorynewFactory()Returns a newIoHandlerFactorythat createsEpollHandlerinstances.static IoHandlerFactorynewFactory(int maxEvents, SelectStrategyFactory selectStrategyFactory)Returns a newIoHandlerFactorythat createsEpollHandlerinstances.voidprepareToDestroy()Prepare to destroy thisIoHandler.voidregister(IoHandle handle)Register aChannelfor IO.intrun(IoExecutionContext context)Run the IO handled by thisIoHandler.voidwakeup(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 newIoHandlerFactorythat createsEpollHandlerinstances.
-
newFactory
public static IoHandlerFactory newFactory(int maxEvents, SelectStrategyFactory selectStrategyFactory)
Returns a newIoHandlerFactorythat createsEpollHandlerinstances.
-
register
public final void register(IoHandle handle) throws Exception
Description copied from interface:IoHandlerRegister aChannelfor IO.
-
deregister
public final void deregister(IoHandle handle) throws Exception
Description copied from interface:IoHandlerDeregister aIoHandlefor IO.- Specified by:
deregisterin interfaceIoHandler- Parameters:
handle- theIoHandleto deregister..- Throws:
Exception- thrown if an error happens during deregistration.
-
wakeup
public final void wakeup(boolean inEventLoop)
Description copied from interface:IoHandlerWakeup theIoHandler, which means if any operation blocks it should be unblocked and return as soon as possible.
-
run
public final int run(IoExecutionContext context)
Description copied from interface:IoHandlerRun the IO handled by thisIoHandler. TheIoExecutionContextshould 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.
-
prepareToDestroy
public void prepareToDestroy()
Description copied from interface:IoHandlerPrepare to destroy thisIoHandler. This method will be called beforeIoHandler.destroy()and may be called multiple times.- Specified by:
prepareToDestroyin interfaceIoHandler
-
destroy
public final void destroy()
Description copied from interface:IoHandlerDestroy theIoHandlerand free all its resources.
-
isCompatible
public boolean isCompatible(Class<? extends IoHandle> handleType)
Description copied from interface:IoHandlerReturnstrueif the given type is compatible with thisIoHandlerand so can be registered,falseotherwise.- Specified by:
isCompatiblein interfaceIoHandler- Parameters:
handleType- the type of theIoHandle.- Returns:
- if compatible of not.
-
-