webtester.packages.distributed
Class clientThread

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--webtester.packages.distributed.clientThread
All Implemented Interfaces:
java.lang.Runnable

public class clientThread
extends java.lang.Thread

Provides a thread that the client uses to ping the master server for test cases and other updates.

Author:
Aaron DeLong

Field Summary
private static boolean bTestCases
          Indicates if there are test cases to execute.
private static int iHostPort
          The port of the master server.
private static int iNodeNumber
          The node number assigned by the server.
private static int iSleepTime
          The default time to sleep in between pings to the server.
private static int iSleepTime2
          Default time to sleep when monitoring threads.
private  int iTextAreaLength
          Max number of characters allowed in textarea.
private static java.lang.String sHostAddr
          The address of the master server.
private static javax.swing.JTextArea text
          Text area used to update user.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
clientThread(java.lang.String sAddr, int iPort, javax.swing.JTextArea tarea)
          The constructor which takes the host address and port as arguments.
 
Method Summary
 void getTestCases(distClient client)
          Send a request to the server to retrieve test case data.
 void run()
           
 void runTests(java.lang.String sConfig)
          Execute the configuration returned from the server
 void setNodeNumber(int iNum)
          Set the node number previously retrieved from the server.
private  void updateTextArea(java.lang.String sText)
          Update the text area without erasing all existing data, if possible
 
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, 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

sHostAddr

private static java.lang.String sHostAddr
The address of the master server.


iHostPort

private static int iHostPort
The port of the master server.


text

private static javax.swing.JTextArea text
Text area used to update user.


iNodeNumber

private static int iNodeNumber
The node number assigned by the server.


iSleepTime

private static final int iSleepTime
The default time to sleep in between pings to the server.

See Also:
Constant Field Values

iSleepTime2

private static final int iSleepTime2
Default time to sleep when monitoring threads.

See Also:
Constant Field Values

iTextAreaLength

private final int iTextAreaLength
Max number of characters allowed in textarea.

See Also:
Constant Field Values

bTestCases

private static boolean bTestCases
Indicates if there are test cases to execute.

Constructor Detail

clientThread

public clientThread(java.lang.String sAddr,
                    int iPort,
                    javax.swing.JTextArea tarea)
The constructor which takes the host address and port as arguments.

Parameters:
sAddr - the address of the master server
iPort - the port of the master server
tarea - text area used to update user on current client status
Method Detail

updateTextArea

private void updateTextArea(java.lang.String sText)
Update the text area without erasing all existing data, if possible

Parameters:
sText - the text to add to the text area

setNodeNumber

public void setNodeNumber(int iNum)
Set the node number previously retrieved from the server.

Parameters:
iNum - the node number assigned by the server

runTests

public void runTests(java.lang.String sConfig)
Execute the configuration returned from the server

Parameters:
sConfig - the config file returned from the server

getTestCases

public void getTestCases(distClient client)
Send a request to the server to retrieve test case data.

Parameters:
client - the client library used to communicate with the server

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread