cz.cuni.amis.pogamut.base3d.worldview.impl
Class SyncLockableBatchAwareWorldView

java.lang.Object
  extended by cz.cuni.amis.pogamut.base.communication.worldview.impl.AbstractWorldView
      extended by cz.cuni.amis.pogamut.base.communication.worldview.impl.EventDrivenWorldView
          extended by cz.cuni.amis.pogamut.base3d.worldview.impl.VisionWorldView
              extended by cz.cuni.amis.pogamut.base3d.worldview.impl.BatchAwareWorldView
                  extended by cz.cuni.amis.pogamut.base3d.worldview.impl.SyncLockableBatchAwareWorldView
All Implemented Interfaces:
ILockableWorldView, IWorldChangeEventInput, IWorldView, IComponent, IVisionWorldView

public abstract class SyncLockableBatchAwareWorldView
extends BatchAwareWorldView
implements ILockableWorldView


Field Summary
static java.lang.String WORLDVIEW_DEPENDENCY
           
 
Fields inherited from class cz.cuni.amis.pogamut.base.communication.worldview.impl.EventDrivenWorldView
notifyEventsList, receiveEventProcessing
 
Fields inherited from class cz.cuni.amis.pogamut.base.communication.worldview.impl.AbstractWorldView
COMPONENT_ID, control, controller, eventBus, log
 
Constructor Summary
SyncLockableBatchAwareWorldView(ComponentDependencies dependencies, IComponentBus bus, IAgentLogger log)
           
 
Method Summary
 boolean isInLock()
           
 boolean isLocked()
          Whether the worldview is locked.
 void lock()
          When the world view is locked - no batches are processes until unlocked.
 void notify(IWorldChangeEvent event)
          Implements locking logic.
 void stop()
          Stops the world view.
 void unlock()
          Unlocks the world view - triggers processing of all events till the last EndMessage that came between lock() / unlock() calls.
 
Methods inherited from class cz.cuni.amis.pogamut.base3d.worldview.impl.BatchAwareWorldView
batchAwareWorldViewNotify, hasObjectsToProcess, isBatchBeginEvent, isBatchEndEvent, notifyImmediately, objectAppeared, objectDisappeared, setDisappearedFlag
 
Methods inherited from class cz.cuni.amis.pogamut.base3d.worldview.impl.VisionWorldView
addVisibleObject, cleanUp, getAllVisible, getAllVisible, getVisible, getVisible, objectCreated, objectDestroyed, objectUpdatedEvent, removeVisibleObject
 
Methods inherited from class cz.cuni.amis.pogamut.base.communication.worldview.impl.EventDrivenWorldView
innerNotify, objectUpdated, raiseEvent
 
Methods inherited from class cz.cuni.amis.pogamut.base.communication.worldview.impl.AbstractWorldView
addEventListener, addObjectListener, addObjectListener, addObjectListener, addObjectListener, addWorldObject, get, get, getAll, getAll, getComponentId, getEventBus, getLog, getSingle, isListening, isListening, isListening, isListening, isListening, isListening, isPaused, isRunning, kill, pause, prePause, preStop, removeEventListener, removeListener, removeObjectListener, removeObjectListener, removeObjectListener, removeObjectListener, removeWorldObject, reset, resume, start, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface cz.cuni.amis.pogamut.base.communication.worldview.IWorldView
addEventListener, addObjectListener, addObjectListener, addObjectListener, addObjectListener, get, get, getAll, getAll, getEventBus, getSingle, isListening, isListening, isListening, isListening, isListening, isListening, removeEventListener, removeListener, removeObjectListener, removeObjectListener, removeObjectListener, removeObjectListener
 
Methods inherited from interface cz.cuni.amis.pogamut.base.communication.worldview.IWorldChangeEventInput
notifyImmediately
 
Methods inherited from interface cz.cuni.amis.pogamut.base.component.IComponent
getComponentId
 

Field Detail

WORLDVIEW_DEPENDENCY

public static final java.lang.String WORLDVIEW_DEPENDENCY
See Also:
Constant Field Values
Constructor Detail

SyncLockableBatchAwareWorldView

@Inject
public SyncLockableBatchAwareWorldView(ComponentDependencies dependencies,
                                              IComponentBus bus,
                                              IAgentLogger log)
Method Detail

lock

public void lock()
          throws PogamutInterruptedException
When the world view is locked - no batches are processes until unlocked.

Specified by:
lock in interface ILockableWorldView
Throws:
java.lang.InterruptedException
PogamutInterruptedException

unlock

public void unlock()
Unlocks the world view - triggers processing of all events till the last EndMessage that came between lock() / unlock() calls.

Specified by:
unlock in interface ILockableWorldView

isLocked

public boolean isLocked()
Description copied from interface: ILockableWorldView
Whether the worldview is locked.

Specified by:
isLocked in interface ILockableWorldView
Returns:

isInLock

public boolean isInLock()

notify

public void notify(IWorldChangeEvent event)
Implements locking logic.

Specified by:
notify in interface IWorldChangeEventInput
Overrides:
notify in class BatchAwareWorldView

stop

public void stop()
Description copied from class: AbstractWorldView
Stops the world view.

If you override this method, do not forget to call super.stop().

Overrides:
stop in class AbstractWorldView