|
Ontimize 5.2072EN | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
com.ontimize.gui.OperationThread
Basic Thread implementation that performs an operation and stores the result
into an EntityResult class.
The operation must be performed in the Thread.run() method, and the result
must be stored in an OperationThread variable called res.
The run method must set the right operation status, such as
hasFinished, hasStarted, cancelled , etc. An
implementation example could be
public void run() {
hasStarted=true;
// Perform operation. The finish check is done with isAlive()
hasFinished=true;
}
| Field Summary | |
protected boolean |
cancelled
|
java.lang.String |
description
|
protected boolean |
hasFinished
|
protected boolean |
hasStarted
|
static java.lang.String |
OPERATION_CANCELLED
|
protected java.lang.Object |
res
|
protected java.lang.String |
status
|
protected java.lang.Thread |
t
|
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
OperationThread()
Constructor. |
|
OperationThread(java.lang.String description)
Sets a description to the thread |
|
| Method Summary | |
void |
cancel()
Sets the thread status as canceled. |
java.lang.String |
getDescription()
Returns the thread description |
java.lang.Object |
getResult()
Returns the thread result. |
java.lang.String |
getStatus()
Returns the thread status, which is a message referent to the thread situation. |
boolean |
hasFinished()
Checks whether the thread has finished. |
boolean |
hasStarted()
Checks whether the thread has started. |
boolean |
isCancelled()
Checks whether the thread has been canceled or not |
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected java.lang.Object res
protected boolean cancelled
protected java.lang.Thread t
protected boolean hasFinished
protected boolean hasStarted
protected java.lang.String status
public static java.lang.String OPERATION_CANCELLED
public java.lang.String description
| Constructor Detail |
public OperationThread()
public OperationThread(java.lang.String description)
description - the thread description| Method Detail |
public java.lang.String getDescription()
public boolean isCancelled()
public void cancel()
EntityResult configured
for this thread is set as a new EntityResult with operation wrong
and the message OPERATION_CANCELLED.
public boolean hasFinished()
public boolean hasStarted()
public java.lang.Object getResult()
public java.lang.String getStatus()
|
Ontimize | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||