java.lang.Object
org.glassfish.grizzly.strategies.AbstractIOStrategy
- All Implemented Interfaces:
IOStrategy,WorkerThreadPoolConfigProducer
- Direct Known Subclasses:
LeaderFollowerNIOStrategy,SameThreadIOStrategy,WorkerThreadIOStrategy
- Author:
- oleksiys
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateDefaultWorkerPoolConfig(Transport transport) final booleanexecuteIoEvent(Connection connection, IOEvent ioEvent) TheSelectorRunnerwill invoke this method to allow the strategy implementation to decide how theIOEventwill be handled.protected static voidfireIOEvent(Connection connection, IOEvent ioEvent, IOEventLifeCycleListener listener, Logger logger) getThreadPoolFor(Connection connection, IOEvent ioEvent) Returns anExecutorto be used to run given ioEvent processing for the given connection.protected static booleanisReadWrite(IOEvent ioEvent) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.glassfish.grizzly.IOStrategy
executeIoEvent
-
Field Details
-
ENABLE_INTEREST_LIFECYCLE_LISTENER
-
-
Constructor Details
-
AbstractIOStrategy
public AbstractIOStrategy()
-
-
Method Details
-
createDefaultWorkerPoolConfig
- Specified by:
createDefaultWorkerPoolConfigin interfaceWorkerThreadPoolConfigProducer
-
executeIoEvent
Description copied from interface:IOStrategyTheSelectorRunnerwill invoke this method to allow the strategy implementation to decide how theIOEventwill be handled.- Specified by:
executeIoEventin interfaceIOStrategy- Parameters:
connection- theConnectionupon which the providedIOEventoccurred.ioEvent- theIOEventthat triggered execution of thisstrategy- 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.
-
getThreadPoolFor
Description copied from interface:IOStrategyReturns anExecutorto 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.- Specified by:
getThreadPoolForin interfaceIOStrategy- Parameters:
connection-ConnectionioEvent- the event to get the Executor for- Returns:
- an
Executorto be used to run given ioEvent processing for the given connection
-
isReadWrite
-
fireIOEvent
protected static void fireIOEvent(Connection connection, IOEvent ioEvent, IOEventLifeCycleListener listener, Logger logger)
-