View Javadoc

1   package cz.cuni.amis.utils.flag;
2   
3   import java.io.Serializable;
4   
5   /**
6    * Allows you to pass reasons of flag change along with new value of the flag.
7    * <p><p>
8    * Note that implementation must be {@link Serializable}
9    * 
10   * @author ik
11   */
12  public interface IReasonFlag<TYPE, REASON> extends IFlag<TYPE>, Serializable {
13  
14      /**
15       * Changes the flag and informs all listeners.
16       * <p><p>
17       * Should not produce any dead-locks even though it is synchronized method.
18       *
19       * @param newValue
20       * @throws InterruptedRuntimeException if interrupted during the await on the freeze latch
21       */
22      public void setFlag(TYPE newValue, REASON reasonForChange);
23  }