Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.yaftp.utils
Class RunnerWaiter  view RunnerWaiter download RunnerWaiter.java

java.lang.Object
  extended bycom.yaftp.utils.RunnerWaiter
All Implemented Interfaces:
java.io.Serializable

public class RunnerWaiter
extends java.lang.Object
implements java.io.Serializable

Copyright Jean-Yves MENGANT 1998,1999,2000 the RunnerWaiter class is a scheduling class using the basic TokenSemaphore system. it can be used every time a Thread (The RUNNER) needs to Synchronize another thread(The WAITER) using the following rules : THREAD 1 (starts and synchonizes THREAD 2 + waits until THREAD 2) startRUNNER() ; DoWhatYouWant ; stopRUNNER() ; // ==> BLOCK AND START WAITER THREAD 2 (waits upon THREAD 1 initial completion and start processing BLOCKING THREAD 1) startWAITER() ; // BLOCK until RUNNER reschedules DoWhatYouWant() ; stopWAITER() ; FOR A FULL EXAMPLE SEE The main static class of TokenSemaphore which implements a full test of that guy.


Field Summary
(package private) static long serialVersionUID
           
private  TokenSemaphore theRunnerFlag
           
private  TokenSemaphore theWaiterFlag
           
 
Constructor Summary
RunnerWaiter()
           
 
Method Summary
 void startRUNNER()
          Start the Runner
 void startWAITER()
           
 void stopRUNNER()
           
 void stopWAITER()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

static final long serialVersionUID

theRunnerFlag

private transient TokenSemaphore theRunnerFlag

theWaiterFlag

private transient TokenSemaphore theWaiterFlag
Constructor Detail

RunnerWaiter

public RunnerWaiter()
Method Detail

startRUNNER

public void startRUNNER()
Start the Runner


stopRUNNER

public void stopRUNNER()

startWAITER

public void startWAITER()

stopWAITER

public void stopWAITER()