grinda.common
Class Semaphore

java.lang.Object
  extended by grinda.common.Semaphore

public class Semaphore
extends java.lang.Object

Thi class is used to block an application on blocking operation like take. It can store the value that the application was wating for.


Constructor Summary
Semaphore()
           
 
Method Summary
 void block()
          Blocks the application
 java.lang.Object getValue()
          Gets the expected value
 void setValue(java.lang.Object value)
          Sets the expected value
 void unBlock()
          Restarts the application
 void unBlockAll()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Semaphore

public Semaphore()
Method Detail

block

public void block()
Blocks the application


unBlock

public void unBlock()
Restarts the application


unBlockAll

public void unBlockAll()

setValue

public void setValue(java.lang.Object value)
Sets the expected value

Parameters:
value -

getValue

public java.lang.Object getValue()
Gets the expected value

Returns:
the value


Copyright © 2006 Sirio Capizzi. All Rights Reserved.