public final class SameThreadIOStrategy extends AbstractIOStrategy
IOStrategy, which executes Processors in a current thread.ENABLE_INTEREST_LIFECYCLE_LISTENER| Modifier and Type | Method and Description |
|---|---|
ThreadPoolConfig |
createDefaultWorkerPoolConfig(Transport transport) |
boolean |
executeIoEvent(Connection connection,
IOEvent ioEvent,
boolean isIoEventEnabled)
The
SelectorRunner will invoke this
method to allow the strategy implementation to decide how the
IOEvent will be handled. |
static SameThreadIOStrategy |
getInstance() |
Executor |
getThreadPoolFor(Connection connection,
IOEvent ioEvent)
Returns an
Executor to be used to run given ioEvent
processing for the given connection. |
executeIoEvent, fireIOEvent, isReadWritepublic static SameThreadIOStrategy getInstance()
public boolean executeIoEvent(Connection connection, IOEvent ioEvent, boolean isIoEventEnabled) throws IOException
IOStrategySelectorRunner will invoke this
method to allow the strategy implementation to decide how the
IOEvent will be handled.connection - the Connection upon which the provided
IOEvent occurred.ioEvent - the IOEvent that triggered execution of this
strategyisIoEventEnabled - true if IOEvent is still enabled on the
Connection, or false if IOEvent was preliminary disabled
or IOEvent is being simulated.IOException - if an error occurs processing the IOEvent.public Executor getThreadPoolFor(Connection connection, IOEvent ioEvent)
IOStrategyExecutor to be used to run given ioEvent
processing for the given connection. A null value will
be returned if the ioEvent should be executed in the kernel thread.getThreadPoolFor in interface IOStrategygetThreadPoolFor in class AbstractIOStrategyExecutor to be used to run given ioEvent
processing for the given connectionpublic ThreadPoolConfig createDefaultWorkerPoolConfig(Transport transport)
createDefaultWorkerPoolConfig in interface WorkerThreadPoolConfigProducercreateDefaultWorkerPoolConfig in class AbstractIOStrategyCopyright © 2016 Oracle Corporation. All Rights Reserved.