|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnl.uva.vlet.tasks.ActionTask
public abstract class ActionTask
Simple Task class which extends the Runnable class. This class creates it's own thread and monitors it. The main purpose is to manage all the 'Task' threads in the Multi Threaded Gui. Tasks (+their threads) are linked to a BrowserController which implements the ITaskSource interface. Update: This class is now part of nl.uva.vlet.Main to provide a single thread+task class for easier multithreaded programming.
TODO: better thread management. Now each task creates it's own thread.
Constructor Summary | |
---|---|
ActionTask(ITaskSource source,
java.lang.String taskName)
Construct a new ActionTask origination from the taskSource source with the human readable name taskName |
Method Summary | |
---|---|
static void |
debugPrintTasks()
print out the task list to the debugStream |
static void |
disposeClass()
|
protected abstract void |
doTask()
Start task. |
java.lang.Exception |
getException()
Returns stored exception |
float |
getProgress()
Provide progress information. |
java.lang.Throwable |
getThrowable()
Returns stored throwable |
VlException |
getVlException()
Returns stored VlException only is the exception was of type VlException |
boolean |
hasException()
Checks whether the thread has 'stored' an exception for later use |
boolean |
hasStarted()
|
static boolean |
hasTasksRunning(ITaskSource bc)
Returns true if the ITaskSource has tasks running |
boolean |
hasVlException()
|
void |
interrupt()
Sends the running thread an interupt signal. |
boolean |
isAlive()
Checks whether the worker thread is alive |
void |
join()
use the Thread.join() method to join with the running task thread. |
void |
messagePrintln(java.lang.String str)
Print a message in the ActionTasks message window |
void |
run()
This method is called by thread.start() to start the runnable. |
protected void |
setException(java.lang.Throwable e)
Store exception for later use |
protected void |
setTaskSource(ITaskSource newSource)
Set TaskSource/Task Watcher to (new) watcher. |
void |
startTask()
Starts this task. |
static void |
stopActionsFor(ITaskSource source,
boolean all)
Send a stop signal to all tasks originating from the ITaskSource |
abstract void |
stopTask()
Default stop method: PLEASE implement this if your ActionTask can be stopped! This is to improve pre-emptive multithreaded tasks ! |
java.lang.String |
toString()
|
void |
waitFor()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ActionTask(ITaskSource source, java.lang.String taskName)
Method Detail |
---|
public static final void debugPrintTasks()
public static final boolean hasTasksRunning(ITaskSource bc)
public static void stopActionsFor(ITaskSource source, boolean all)
public final void startTask()
protected final void setTaskSource(ITaskSource newSource)
newWatcher
- public final void run()
run
in interface java.lang.Runnable
protected void setException(java.lang.Throwable e)
public final void messagePrintln(java.lang.String str)
public final boolean isAlive()
public final java.lang.String toString()
toString
in class java.lang.Object
public final void interrupt()
Thread.interrupt()
public final void join() throws java.lang.InterruptedException
java.lang.InterruptedException
public final boolean hasException()
#setException(VlException)
,
getException()
public final java.lang.Exception getException()
public final java.lang.Throwable getThrowable()
public final VlException getVlException()
public final boolean hasVlException()
public float getProgress()
protected abstract void doTask() throws VlException
VlException
public abstract void stopTask()
public static void disposeClass()
public boolean hasStarted()
public void waitFor() throws java.lang.InterruptedException
java.lang.InterruptedException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |