View Javadoc

1   package cz.cuni.amis.pogamut.base.communication.worldview;
2   
3   import cz.cuni.amis.pogamut.base.component.bus.exception.ComponentNotRunningException;
4   import cz.cuni.amis.pogamut.base.component.bus.exception.ComponentPausedException;
5   import cz.cuni.amis.utils.exception.PogamutInterruptedException;
6   
7   public interface ILockableWorldView extends IWorldView {
8   	
9   	/**
10  	 * Lock the worldview, preventing it from raising any new events.
11  	 * <p><p>
12  	 * When locked - the worldview must store all incoming events and
13  	 * process them during unlock.
14  	 * <p><p>
15  	 * Note that it is implementation-dependent whether this method is blocking or not.
16  	 */
17  	public void lock() throws PogamutInterruptedException, ComponentNotRunningException, ComponentPausedException;
18  	
19  	/**
20  	 * Unlock the worldview, processing all events that came between lock() / unlock() calls.
21  	 */
22  	public void unlock() throws ComponentNotRunningException, ComponentPausedException;
23  	
24  	/**
25  	 * Whether the worldview is locked.
26  	 * @return
27  	 */
28  	public boolean isLocked();
29  	
30  }