Package org.opt4j.config
Class ExecutionEnvironment
java.lang.Object
org.opt4j.config.ExecutionEnvironment
- All Implemented Interfaces:
TaskStateListener
The
ExecutionEnvironment
for Task
s. The environment starts
and monitors optimization tasks. Tasks are not submitted directly, instead a
collection of Module
s is submitted and a Task
is created. The
ExecutionEnvironment
is processing the Task
s sequentially.- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected final ExecutorService
protected final Set<TaskListener>
protected final com.google.inject.Provider<Task>
-
Constructor Summary
ConstructorDescriptionExecutionEnvironment
(com.google.inject.Provider<Task> taskProvider) Constructs aExecutionEnvironment
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(TaskListener listener) Adds aTaskListener
.protected void
Adds aTask
and calls the listeners.void
execute
(Collection<com.google.inject.Module> modules) Executes the specified modules: ATask
is created and submitted.getTasks()
Returns the list of allTask
s.void
removeListener
(TaskListener listener) Removes aTaskListener
.void
stateChanged
(Task task) Invoked if aTask
changes its state.
-
Field Details
-
taskProvider
-
executor
-
tasks
-
listeners
-
-
Constructor Details
-
ExecutionEnvironment
Constructs aExecutionEnvironment
.- Parameters:
taskProvider
- the task provider
-
-
Method Details
-
execute
Executes the specified modules: ATask
is created and submitted.- Parameters:
modules
- the collection of modules for aTask
-
addTask
Adds aTask
and calls the listeners.- Parameters:
task
- the task to add
-
addListener
Adds aTaskListener
.- Parameters:
listener
- the listener to be added
-
removeListener
Removes aTaskListener
.- Parameters:
listener
- the listener to be removed- See Also:
-
getTasks
Returns the list of allTask
s.- Returns:
- the list of all tasks
-
stateChanged
Description copied from interface:TaskStateListener
Invoked if aTask
changes its state.- Specified by:
stateChanged
in interfaceTaskStateListener
- Parameters:
task
- the task that changed its state
-