Package org.glassfish.grizzly.strategies
Class LeaderFollowerNIOStrategy
- java.lang.Object
-
- org.glassfish.grizzly.strategies.AbstractIOStrategy
-
- org.glassfish.grizzly.strategies.LeaderFollowerNIOStrategy
-
- All Implemented Interfaces:
IOStrategy,WorkerThreadPoolConfigProducer
public final class LeaderFollowerNIOStrategy extends AbstractIOStrategy
IOStrategy, which executesProcessors in a current threads, and resumes selector thread logic in separate thread.- Author:
- Alexey Stashok
-
-
Field Summary
-
Fields inherited from class org.glassfish.grizzly.strategies.AbstractIOStrategy
ENABLE_INTEREST_LIFECYCLE_LISTENER
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanexecuteIoEvent(Connection connection, IOEvent ioEvent, boolean isIoEventEnabled)TheSelectorRunnerwill invoke this method to allow the strategy implementation to decide how theIOEventwill be handled.static LeaderFollowerNIOStrategygetInstance()-
Methods inherited from class org.glassfish.grizzly.strategies.AbstractIOStrategy
createDefaultWorkerPoolConfig, executeIoEvent, fireIOEvent, getThreadPoolFor, isReadWrite
-
-
-
-
Method Detail
-
getInstance
public static LeaderFollowerNIOStrategy getInstance()
-
executeIoEvent
public boolean executeIoEvent(Connection connection, IOEvent ioEvent, boolean isIoEventEnabled) throws IOException
Description copied from interface:IOStrategyTheSelectorRunnerwill invoke this method to allow the strategy implementation to decide how theIOEventwill be handled.- Parameters:
connection- theConnectionupon which the providedIOEventoccurred.ioEvent- theIOEventthat triggered execution of thisstrategyisIoEventEnabled- true if IOEvent is still enabled on theConnection, or false if IOEvent was preliminary disabled or IOEvent is being simulated.- Returns:
- true, if this thread should keep processing IOEvents on the current and other Connections, or false if this thread should hand-off the farther IOEvent processing on any Connections, which means IOStrategy is becoming responsible for continuing IOEvent processing (possibly starting new thread, which will handle IOEvents).
- Throws:
IOException- if an error occurs processing theIOEvent.
-
-