All Packages  This Package  Class Hierarchy  Class Search  Index

Class edu.utah.janos.tests.WatchDog
java.lang.Object
   |
   +----java.lang.Thread
           |
           +----edu.utah.janos.tests.WatchDog

  Summary

public class  WatchDog
     extends java.lang.Thread
{
          // Fields 2
     private Thread thread;
     private long time;

          // Constructors 1
     public WatchDog(long, Thread);

          // Methods 1
     public void run();
}

A simple watch dog thread. It waits for a given length of time and then interrupts the target thread, unless it gets interrupted beforehand.




  Fields

· time

Summary  |  Top

   private long time

The amount of time to sleep before interrupting thread


· thread

Summary  |  Top
   private Thread thread

The thread to watch, and interrupt if time expires before we're interrupted


  Constructors

· WatchDog

Summary  |  Top

   public WatchDog(long ti, 
                   Thread th) 

Construct a watch dog thread that watches a thread for ti time

Parameter Description
ti The length of time to sleep before interrupting the thread
th The thread to watch



  Methods

· run

Summary  |  Top
   public void run() 

Sleep for time milliseconds and then call interrupt on thread if we aren't interrupted before hand. An interrupt called on our thread will cause make the thread quit quietly.

Overrides:
run in class Thread
Implements:
run in interface Runnable


All Packages  This Package  Class Hierarchy  Class Search  Index
Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7