IBM Rational Performance Tester SDK

com.ibm.rational.test.lt.kernel.util
Class WatchDog

java.lang.Object
  extended by java.lang.Thread
      extended by com.ibm.rational.test.lt.kernel.util.WatchDog
All Implemented Interfaces:
IWatchDog, Runnable

public abstract class WatchDog
extends Thread
implements IWatchDog


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
WatchDog()
           
WatchDog(String name)
           
 
Method Summary
 int getTimeoutCount()
          get the number of times a timeout condition has been encountered.
 void restartTimer()
          Stops the current timer and starts another.
 void run()
           
 void setTimeout(int timeout)
          Set the length of time a timer will wait before the timeout condition occurs
 void start()
          starts the watchdog thread
 boolean startTimer()
          Start a timer.
 boolean stopTimer()
          Stops the current timer.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.ibm.rational.test.lt.kernel.util.IWatchDog
handleTimeout, setName, stop
 

Constructor Detail

WatchDog

public WatchDog()

WatchDog

public WatchDog(String name)
Parameters:
name -
Method Detail

setTimeout

public void setTimeout(int timeout)
Description copied from interface: IWatchDog
Set the length of time a timer will wait before the timeout condition occurs

Specified by:
setTimeout in interface IWatchDog
Parameters:
timeout - milliseconds

startTimer

public boolean startTimer()
Description copied from interface: IWatchDog
Start a timer.

If the current value of the timeOut elapses before this timer is stopped the watchdog will increment the timeoutCount and call reportTimeout()

Specified by:
startTimer in interface IWatchDog
Returns:
true if a timer was successfully started, false if a timer is already active or if the thread is not started.

stopTimer

public boolean stopTimer()
Description copied from interface: IWatchDog
Stops the current timer.

Specified by:
stopTimer in interface IWatchDog
Returns:
true if the timer was successfully stopped, false if there is not an active timer.

restartTimer

public void restartTimer()
Description copied from interface: IWatchDog
Stops the current timer and starts another.

Specified by:
restartTimer in interface IWatchDog

getTimeoutCount

public int getTimeoutCount()
Description copied from interface: IWatchDog
get the number of times a timeout condition has been encountered.

Specified by:
getTimeoutCount in interface IWatchDog
Returns:
the count of timeous encountered.

start

public void start()
Description copied from interface: IWatchDog
starts the watchdog thread

Specified by:
start in interface IWatchDog
Overrides:
start in class Thread

run

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

IBM Rational Performance Tester SDK

© Copyright IBM Corp. 2012. All rights reserved.