context.arch.comm.protocol
Class BusyFlag

java.lang.Object
  extended bycontext.arch.comm.protocol.BusyFlag

public class BusyFlag
extends java.lang.Object

This object is a lock on a shared object

Author:
Agathe

Constructor Summary
BusyFlag()
           
 
Method Summary
 void freeBusyFlag()
          Release the lock.
 void getBusyFlag()
          To get the lock.
 java.lang.Thread getBusyFlagOwner()
          Returns the Thread owning the lock
 boolean tryGetBusyFlag()
          Try to get the lock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BusyFlag

public BusyFlag()
Method Detail

getBusyFlag

public void getBusyFlag()
To get the lock. If the lock is busy, we wait.


tryGetBusyFlag

public boolean tryGetBusyFlag()
Try to get the lock

Returns:
boolean True if the lock is not busy. Otherwise false

freeBusyFlag

public void freeBusyFlag()
Release the lock.


getBusyFlagOwner

public java.lang.Thread getBusyFlagOwner()
Returns the Thread owning the lock

Returns:
Thread The lock's current owner