public abstract class AbstractGenericEngine
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected repicea.app.AbstractGenericEngine.EnsuringShutdownTask |
finalTask |
protected Logger |
logger |
protected java.util.concurrent.LinkedBlockingQueue<GenericTask> |
queue |
protected java.util.List<java.lang.String> |
tasksDone |
Modifier | Constructor and Description |
---|---|
protected |
AbstractGenericEngine()
Protected constructor for derived class.
|
Modifier and Type | Method and Description |
---|---|
void |
addTask(GenericTask task)
This method add a GenericTask instance in the queue of tasks.
|
void |
addTasks(java.util.List<GenericTask> tasks)
This method add a bunch of tasks in the queue of tasks.
|
void |
cancelRunningTask()
This method cancels the current task if the queue is not empty.
|
protected void |
decideWhatToDoInCaseOfFailure(GenericTask task)
This method is called whenever an exception is thrown while running a task.
|
protected abstract void |
firstTasksToDo()
This method sets the first tasks to execute when the engine starts.
|
SettingMemory |
getSettingMemory()
This method returns the settings of the application.
|
protected void |
lockEngine()
This method locks the engine while the interface can be doing something else.
|
protected void |
lockEngine(long millisec)
This method locks the engine while the interface can be doing something else.
|
void |
requestShutdown()
This method requests the Engine to shut down.
|
protected void |
setSettingMemory(SettingMemory settings)
This method sets the settings of the application.
|
protected void |
shutdown(int shutdownCode) |
void |
startApplication()
This method starts the client application.
|
protected void |
unlockEngine()
This method unlock the engine if locked.
|
protected Logger logger
protected java.util.concurrent.LinkedBlockingQueue<GenericTask> queue
protected java.util.List<java.lang.String> tasksDone
protected repicea.app.AbstractGenericEngine.EnsuringShutdownTask finalTask
protected AbstractGenericEngine()
protected void decideWhatToDoInCaseOfFailure(GenericTask task)
task
- a GenericTask instanceprotected abstract void firstTasksToDo()
protected void setSettingMemory(SettingMemory settings)
settings
- a SettingMemory instancepublic final SettingMemory getSettingMemory()
public final void startApplication()
protected void shutdown(int shutdownCode)
public void addTask(GenericTask task)
task
- a GenericTask instancepublic void addTasks(java.util.List<GenericTask> tasks)
tasks
- a List of GenericTask instancesprotected void lockEngine(long millisec) throws java.lang.InterruptedException
millisec
- the number of milliseconds to waitjava.lang.InterruptedException
protected void lockEngine() throws java.lang.InterruptedException
java.lang.InterruptedException
protected void unlockEngine()
public void cancelRunningTask()
public void requestShutdown()