org.ourgrid.test.threadServices
Class RunnerWaiterRunnable

java.lang.Object
  extended by org.ourgrid.test.threadServices.RunnerWaiterRunnable
All Implemented Interfaces:
java.lang.Runnable

public class RunnerWaiterRunnable
extends java.lang.Object
implements java.lang.Runnable

Class used for tests only. This is a thread that will always run, unless blocked or stopped manually.

Author:
Flavio Vinicius Diniz de Figueiredo - flaviov@lsd.ufcg.edu.br

Nested Class Summary
static class RunnerWaiterRunnable.Status
          Avalaible the statuses fot a RunnerWaiterRunnable.
 
Constructor Summary
RunnerWaiterRunnable()
          Builda a new RunnerWaiterRunnable
 
Method Summary
 java.lang.Thread getActualRunnerThread()
          Get's the tread that is actually running.
 RunnerWaiterRunnable.Status getStatus()
          Gets the current status of the SleeperWaker.
 void run()
           
 void setMustStop()
          Informs that this runnable must stop.
 void setWaiting()
          Tells this RunnerWaiterRunnable to wait until told otherwise.
 void startRunning()
          Tells this RunnerWaiterRunnable to start running.
 void unsetWaiting()
          Tells this RunnerWaiterRunnable to stop waiting.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RunnerWaiterRunnable

public RunnerWaiterRunnable()
Builda a new RunnerWaiterRunnable

Method Detail

startRunning

public void startRunning()
Tells this RunnerWaiterRunnable to start running.


setWaiting

public void setWaiting()
Tells this RunnerWaiterRunnable to wait until told otherwise.


unsetWaiting

public void unsetWaiting()
Tells this RunnerWaiterRunnable to stop waiting.


setMustStop

public void setMustStop()
Informs that this runnable must stop. This method implies on waking the runnable if it is waiting.


getStatus

public RunnerWaiterRunnable.Status getStatus()
Gets the current status of the SleeperWaker.

Returns:
The status.

getActualRunnerThread

public java.lang.Thread getActualRunnerThread()
Get's the tread that is actually running.

Returns:
Thread

run

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