|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.grizzly.strategies.SimpleDynamicNIOStrategy
public final class SimpleDynamicNIOStrategy
Simple dynamic strategy, which switches I/O processing strategies, basing
on statistics. This implementation takes in consideration number of
SelectionKeys, which were selected last time by
Selector.
SimpleDynamicIOStrategy is able to use 2 strategies underneath:
SameThreadIOStrategy, WorkerThreadIOStrategy.
And is able to switch between them basing on corresponding threshold
(threshold represents the number of selected
SelectionKeys).
So the strategy is getting applied following way:
SameThreadIOStrategy --(worker-thread threshold)--> WorkerThreadIOStrategy.
| Method Summary | |
|---|---|
ThreadPoolConfig |
createDefaultWorkerPoolConfig(Transport transport)
|
boolean |
executeIoEvent(Connection connection,
IOEvent ioEvent)
The SelectorRunner will invoke this
method to allow the strategy implementation to decide how the
IOEvent will be handled. |
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 SimpleDynamicNIOStrategy |
getInstance()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static SimpleDynamicNIOStrategy getInstance()
public boolean executeIoEvent(Connection connection,
IOEvent ioEvent)
throws java.io.IOException
IOStrategySelectorRunner will invoke this
method to allow the strategy implementation to decide how the
IOEvent will be handled.
executeIoEvent in interface IOStrategyconnection - the Connection upon which the provided
IOEvent occurred.ioEvent - the IOEvent that triggered execution of this
strategy
java.io.IOException - if an error occurs processing the IOEvent.
public boolean executeIoEvent(Connection connection,
IOEvent ioEvent,
boolean isIoEventEnabled)
throws java.io.IOException
IOStrategySelectorRunner will invoke this
method to allow the strategy implementation to decide how the
IOEvent will be handled.
executeIoEvent in interface IOStrategyconnection - 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.
java.io.IOException - if an error occurs processing the IOEvent.public ThreadPoolConfig createDefaultWorkerPoolConfig(Transport transport)
createDefaultWorkerPoolConfig in interface WorkerThreadPoolConfigProducer
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||