public abstract class LockableBatchAwareWorldView extends BatchAwareWorldView implements ILockableWorldView
Modifier and Type | Field and Description |
---|---|
static String |
WORLDVIEW_DEPENDENCY |
notifyEventsList, receiveEventProcessing
COMPONENT_ID, control, controller, eventBus, log
Constructor and Description |
---|
LockableBatchAwareWorldView(ComponentDependencies dependencies,
IComponentBus bus,
IAgentLogger log) |
Modifier and Type | Method and Description |
---|---|
protected abstract boolean |
isBatchBeginEvent(IWorldChangeEvent evt)
Is this event a batch begin event? It is needed for the locking to be working correctly.
|
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 |
unlock()
Unlocks the world view - triggers processing of all events till the last EndMessage that
came between lock() / unlock() calls.
|
batchAwareWorldViewNotify, hasObjectsToProcess, isBatchEndEvent, notifyImmediately, objectAppeared, objectDisappeared, setDisappearedFlag
addVisibleObject, cleanUp, getAllVisible, getAllVisible, getVisible, getVisible, objectCreated, objectDestroyed, objectUpdatedEvent, removeVisibleObject
innerNotify, notifyAfterPropagation, objectUpdated, raiseEvent
addEventListener, addObjectListener, addObjectListener, addObjectListener, addObjectListener, addWorldObject, get, 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, stop, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addEventListener, addObjectListener, addObjectListener, addObjectListener, addObjectListener, get, get, get, getAll, getAll, getEventBus, getSingle, isListening, isListening, isListening, isListening, isListening, isListening, removeEventListener, removeListener, removeObjectListener, removeObjectListener, removeObjectListener, removeObjectListener
notifyAfterPropagation, notifyImmediately
getComponentId
public static final String WORLDVIEW_DEPENDENCY
public LockableBatchAwareWorldView(ComponentDependencies dependencies, IComponentBus bus, IAgentLogger log)
protected abstract boolean isBatchBeginEvent(IWorldChangeEvent evt)
isBatchBeginEvent
in class BatchAwareWorldView
evt
- public void lock()
lock
in interface ILockableWorldView
public void unlock()
unlock
in interface ILockableWorldView
public boolean isLocked()
ILockableWorldView
isLocked
in interface ILockableWorldView
public void notify(IWorldChangeEvent event)
notify
in interface IWorldChangeEventInput
notify
in class BatchAwareWorldView
Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.