|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Strategy<E>
Strategy is responsible for making decision how
ProcessorRunnable task will be run: in current thread, worker thread.
Strategy can make any other processing decisions.
| Method Summary | |
|---|---|
void |
executeProcessor(E strategyContext,
ProcessorRunnable processorRunnable)
Execute ProcessorRunnable task. |
boolean |
isTerminateThread(E strategyContext)
This method may be called by runner Thread after task will be
executed. |
E |
prepare(Connection connection,
IOEvent ioEvent)
Prepare Strategy for processing IOEvent, occured on the
Connection. |
| Method Detail |
|---|
E 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.
connection - Connection, on which IOEvent occured.ioEvent - IOEvent.
IOEvent processing.
void executeProcessor(E strategyContext,
ProcessorRunnable processorRunnable)
throws IOException
ProcessorRunnable task.
strategyContext - context object, initialized on "prepare" phase.processorRunnable - the ProcessorRunnable task to be executed.
IOExceptionboolean isTerminateThread(E strategyContext)
Thread after task will be
executed. Strategy may instruct the caller to release current
thread, after task execution will be completed.
strategyContext - Strategy context, initialized on "prepare"
phase.
Thread, or false otherwise.LeaderFollowerStrategy
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||