com.funambol.email.transport
Class ImapSemaphore

java.lang.Object
  extended bycom.funambol.email.transport.ImapSemaphore

public final class ImapSemaphore
extends java.lang.Object

This class implemets Semaphore in order to permit to manager layer to retreive the UID of the added message.


Constructor Summary
ImapSemaphore(boolean _isGreen)
          Create a new condition variable in a known state.
 
Method Summary
 boolean isTrue()
          See if the condition variable is true (without releasing).
 void releaseAll()
          Release all waiting threads without setting the condition true
 void releaseOne()
          Release one waiting thread without setting the condition true
 void setFalse()
          Set the condition to false.
 void setTrue()
          Set the condition to true.
 void waitForTrue(long timeout)
          Wait for the condition to become true.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImapSemaphore

public ImapSemaphore(boolean _isGreen)
Create a new condition variable in a known state.

Parameters:
_isGreen - boolean
Method Detail

isTrue

public boolean isTrue()
See if the condition variable is true (without releasing).

Returns:
boolean

setFalse

public void setFalse()
Set the condition to false. Waiting threads are not affected.


setTrue

public void setTrue()
Set the condition to true. Waiting threads are not released.


releaseAll

public void releaseAll()
Release all waiting threads without setting the condition true


releaseOne

public void releaseOne()
Release one waiting thread without setting the condition true


waitForTrue

public void waitForTrue(long timeout)
Wait for the condition to become true.

Parameters:
timeout - Timeout in milliseconds


Copyright © 2003-2006 Funambol.