|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--tppt.util.RunExperiment
RunExperiment
is the class to activate the experiment progress.
Create the RunExperiment and call RunExperiment.go() to start the experiment.
The go method utilizes SwingWorker
class to handle the time-comsuming
experiment running that is controlled by the inner class execExperiment
so the GUI could remain responsive.
SwingWorker
,
RunExperiment.execExperiment
Inner Class Summary | |
(package private) class |
RunExperiment.execExperiment
This class runs the experiment progress in the background thread created by SwingWorker class. |
Field Summary | |
(package private) int |
currentTime
keep track of number of seconds passed by |
static boolean |
expDone
true - if experiment is done |
static boolean |
expError
true - if transaction encounters error |
(package private) int |
expLength
total number of seconds the experiment need to run |
(package private) GlobalData |
global
|
(package private) int |
i
|
(package private) int |
num
number of terminals user requests. |
(package private) static int |
numOfDeadlocks
The total number of deadlocks happened in all terminals. |
(package private) int |
ONE_SECOND
|
(package private) long |
showEndTime
The duration of experiment in seconds. |
(package private) long |
showStartTime
The start time of experiment in milliseconds. |
(package private) long |
showTime
The duration of experiment has run in seconds so far. |
(package private) Terminal |
term
|
(package private) java.util.Vector |
terminals
A Vector of Terminal instance. |
(package private) javax.swing.Timer |
timer
|
(package private) SwingWorker |
worker
|
Constructor Summary | |
RunExperiment()
Constructs the RunExperiment. |
Method Summary | |
void |
abort()
abort the experiemnt. |
int |
getCurrent()
get the number of seconds the experiment have been executed so far. |
int |
getLengthOfExp()
Return how many seconds the experiemnt should be run. |
int |
getNumOfDeadlocks()
Get the total number of deadlocks happened in all terminals. |
void |
go()
This method creates a SwingWorker to run the experiment. |
private void |
showError(java.lang.String errorMsg)
|
void |
stopExperiment()
Terminate the terminals and timer before the experiemnt stops. |
Methods inherited from class java.lang.Object |
|
Field Detail |
final int ONE_SECOND
java.util.Vector terminals
GlobalData global
static int numOfDeadlocks
int i
int num
Terminal term
javax.swing.Timer timer
int expLength
int currentTime
public static boolean expDone
public static boolean expError
long showTime
long showStartTime
long showEndTime
SwingWorker worker
Constructor Detail |
public RunExperiment()
Method Detail |
public void go()
SwingWorker
,
RunExperiment.execExperiment
public void abort()
public int getLengthOfExp()
public int getCurrent()
public int getNumOfDeadlocks()
public void stopExperiment()
Terminal.stopTerm()
private void showError(java.lang.String errorMsg)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |