|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.grizzly.strategies.LeaderFollowerStrategy
public class LeaderFollowerStrategy
Strategy, which executes Processors in a current threads, and
resumes selector thread logic in separate thread.
| Constructor Summary | |
|---|---|
LeaderFollowerStrategy(Executor sameThreadProcessorExecutor,
Executor workerThreadProcessorExecutor)
|
|
LeaderFollowerStrategy(NIOTransport transport)
|
|
| Method Summary | |
|---|---|
void |
executeProcessor(Boolean strategyContext,
ProcessorRunnable processorRunnable)
Execute ProcessorRunnable task. |
Executor |
getProcessorExecutor(Boolean strategyContext)
|
boolean |
isTerminateThread(Boolean strategyContext)
This method may be called by runner Thread after task will be
executed. |
Boolean |
prepare(Connection connection,
IOEvent ioEvent)
Prepare Strategy for processing IOEvent, occured on the
Connection. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LeaderFollowerStrategy(NIOTransport transport)
public LeaderFollowerStrategy(Executor sameThreadProcessorExecutor,
Executor workerThreadProcessorExecutor)
| Method Detail |
|---|
public Boolean prepare(Connection connection,
IOEvent ioEvent)
Strategy for processing IOEvent, occured on the
Connection.
At this phase Strategy may initialize and return context data,
which will be passed further into executeProcessor and isTerminateThread
methods.
prepare in interface Strategy<Boolean>connection - Connection, on which IOEvent occured.ioEvent - IOEvent.
IOEvent processing.
public void executeProcessor(Boolean strategyContext,
ProcessorRunnable processorRunnable)
throws IOException
ProcessorRunnable task.
executeProcessor in interface Strategy<Boolean>strategyContext - context object, initialized on "prepare" phase.processorRunnable - the ProcessorRunnable task to be executed.
IOExceptionpublic boolean isTerminateThread(Boolean strategyContext)
Thread after task will be
executed. Strategy may instruct the caller to release current
thread, after task execution will be completed.
isTerminateThread in interface Strategy<Boolean>strategyContext - Strategy context, initialized on "prepare"
phase.
Thread, or false otherwise.LeaderFollowerStrategypublic Executor getProcessorExecutor(Boolean strategyContext)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||