Package org.eclipse.jetty.util.thread
Interface ExecutionStrategy
-
- All Known Implementing Classes:
ExecuteProduceConsume
,ExecutingExecutionStrategy
,ProduceConsume
,ProduceExecuteConsume
public interface ExecutionStrategy
An
ExecutionStrategy
executesRunnable
tasks produced by aExecutionStrategy.Producer
. The strategy to execute the task may vary depending on the implementation; the task may be run in the calling thread, or in a new thread, etc.The strategy delegates the production of tasks to a
ExecutionStrategy.Producer
, and continues to execute tasks until the producer continues to produce them.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ExecutionStrategy.DefaultExecutionStrategyFactory
static interface
ExecutionStrategy.Factory
A factory forExecutionStrategy
.static interface
ExecutionStrategy.Producer
A producer ofRunnable
tasks to run.static interface
ExecutionStrategy.Rejectable
A task that can handleRejectedExecutionException
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
dispatch()
Initiates (or resumes) the task production and execution.void
execute()
Initiates (or resumes) the task production and execution.
-
-
-
Method Detail
-
dispatch
void dispatch()
Initiates (or resumes) the task production and execution.
This method guarantees that the task is never run by the thread that called this method.
- See Also:
execute()
-
execute
void execute()
Initiates (or resumes) the task production and execution.
The produced task may be run by the same thread that called this method.
- See Also:
dispatch()
-
-