|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opt4j.core.config.ExecutionEnvironment
public class ExecutionEnvironment
The ExecutionEnvironment for Tasks. The environment starts
and monitors optimization tasks. Tasks are not submitted directly, instead a
collection of Modules is submitted and a Task is created. The
ExecutionEnvironment is processing the Tasks sequentially.
Task| Field Summary | |
|---|---|
protected java.util.concurrent.ExecutorService |
executor
|
protected java.util.Set<TaskListener> |
listeners
|
protected com.google.inject.Provider<Task> |
taskProvider
|
protected java.util.List<Task> |
tasks
|
| Constructor Summary | |
|---|---|
ExecutionEnvironment(com.google.inject.Provider<Task> taskProvider)
Constructs a ExecutionEnvironment. |
|
| Method Summary | |
|---|---|
void |
addListener(TaskListener listener)
Adds a TaskListener. |
protected void |
addTask(Task task)
Adds a Task and calls the listeners. |
void |
execute(java.util.Collection<com.google.inject.Module> modules)
Executes the specified modules: A Task is created and submitted. |
java.util.List<Task> |
getTasks()
Returns the list of all Tasks. |
void |
removeListener(TaskListener listener)
Removes a TaskListener. |
void |
stateChanged(Task task)
Invoked if a Task changes its state. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final com.google.inject.Provider<Task> taskProvider
protected final java.util.concurrent.ExecutorService executor
protected final java.util.List<Task> tasks
protected final java.util.Set<TaskListener> listeners
| Constructor Detail |
|---|
@Inject public ExecutionEnvironment(com.google.inject.Provider<Task> taskProvider)
ExecutionEnvironment.
taskProvider - the task provider| Method Detail |
|---|
public void execute(java.util.Collection<com.google.inject.Module> modules)
Task is created and submitted.
modules - the collection of modules for a Taskprotected void addTask(Task task)
Task and calls the listeners.
task - the task to addpublic void addListener(TaskListener listener)
TaskListener.
listener - the listener to be addedpublic void removeListener(TaskListener listener)
TaskListener.
listener - the listener to be removedaddListener(org.opt4j.core.config.TaskListener)public java.util.List<Task> getTasks()
Tasks.
public void stateChanged(Task task)
TaskStateListenerTask changes its state.
stateChanged in interface TaskStateListenertask - the task that changed its state
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||