cz.cuni.amis.utils.flag
Interface IReasonFlag<TYPE,REASON>

All Superinterfaces:
IFlag<TYPE>, java.io.Serializable
All Known Implementing Classes:
ImmutableReasonFlag, ReasonFlag

public interface IReasonFlag<TYPE,REASON>
extends IFlag<TYPE>, java.io.Serializable

Allows you to pass reasons of flag change along with new value of the flag.

Note that implementation must be Serializable


Method Summary
 void setFlag(TYPE newValue, REASON reasonForChange)
          Changes the flag and informs all listeners.
 
Methods inherited from interface cz.cuni.amis.utils.flag.IFlag
addListener, addStrongListener, clearListeners, defreeze, freeze, getFlag, getImmutable, inSync, isFrozen, isListenning, removeAllListeners, removeListener, setFlag
 

Method Detail

setFlag

void setFlag(TYPE newValue,
             REASON reasonForChange)
Changes the flag and informs all listeners.

Should not produce any dead-locks even though it is synchronized method.

Parameters:
newValue -
Throws:
InterruptedRuntimeException - if interrupted during the await on the freeze latch