|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cz.cuni.amis.pogamut.multi.communication.worldview.impl.AbstractLocalWorldView cz.cuni.amis.pogamut.multi.communication.worldview.impl.EventDrivenLocalWorldView
public abstract class EventDrivenLocalWorldView
Nested Class Summary |
---|
Nested classes/interfaces inherited from class cz.cuni.amis.pogamut.multi.communication.worldview.impl.AbstractLocalWorldView |
---|
AbstractLocalWorldView.LazyCompositeObjectMap<T extends ICompositeWorldObject> |
Field Summary | |
---|---|
protected java.util.Queue<IWorldChangeEvent> |
notifyEventsList
List of events we have to process. |
protected boolean |
receiveEventProcessing
Flag that is telling us whether there is an event being processed or not. |
static java.lang.String |
WORLDVIEW_DEPENDENCY
|
Fields inherited from class cz.cuni.amis.pogamut.multi.communication.worldview.impl.AbstractLocalWorldView |
---|
actLocalWorldObjects, agentId, classMap, COMPONENT_ID, control, controller, eventBus, log, sharedWorldView, syncClassMap |
Constructor Summary | |
---|---|
EventDrivenLocalWorldView(ComponentDependencies dependencies,
ILifecycleBus bus,
IAgentLogger logger,
ISharedWorldView sharedWV,
ITeamedAgentId agentId)
|
Method Summary | |
---|---|
protected void |
innerNotify(IWorldChangeEvent event)
Used to process IWorldChangeEvent - it has to be either IWorldChangeEvent or IWorldObjectUpdateEvent. |
void |
notify(IWorldChangeEvent event)
|
protected void |
objectCreated(ILocalWorldObject obj)
Must be called whenever an object was created, raises correct events. |
protected void |
objectDestroyed(ILocalWorldObject obj)
Must be called whenever an object was destroyed - raises correct events. |
protected void |
objectUpdated(ILocalWorldObject obj)
Must be called whenever an object was updated - raises correct event. |
protected void |
objectUpdatedEvent(ILocalWorldObjectUpdatedEvent updateEvent)
Called from EventDrivenWorldView.innerNotify(IWorldChangeEvent) if the event is IWorldObjectUpdatedEvent
to process it. |
protected void |
raiseEvent(IWorldEvent event)
Catches exceptions. |
Methods inherited from class cz.cuni.amis.pogamut.multi.communication.worldview.impl.AbstractLocalWorldView |
---|
addEventListener, addLocalWorldObject, addObjectListener, addObjectListener, addObjectListener, addObjectListener, addOldLocalWorldObject, cleanUp, createCompositeObject, get, get, get, get, getAgentId, getAll, getAll, getAll, getAll, getComponentId, getCurrentTimeKey, getEventBus, getLocal, getLocal, getMostRecentLocalWorldObject, getSingle, getSingle, isListening, isListening, isListening, isListening, isListening, isListening, isPaused, isRunning, kill, lockTime, pause, prePause, preStop, removeEventListener, removeListener, removeLocalWorldObject, removeObjectListener, removeObjectListener, removeObjectListener, removeObjectListener, reset, resume, setCurrentTime, setInitialTime, start, stop, unlockTime |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String WORLDVIEW_DEPENDENCY
protected boolean receiveEventProcessing
It is managed only by notify() method - DO NOT MODIFY OUTSIDE IT!
protected java.util.Queue<IWorldChangeEvent> notifyEventsList
It is managed only by notify() method - DO NOT MODIFY OUTSIDE IT!
Constructor Detail |
---|
public EventDrivenLocalWorldView(ComponentDependencies dependencies, ILifecycleBus bus, IAgentLogger logger, ISharedWorldView sharedWV, ITeamedAgentId agentId)
Method Detail |
---|
public void notify(IWorldChangeEvent event) throws ComponentNotRunningException, ComponentPausedException
ComponentNotRunningException
ComponentPausedException
protected void raiseEvent(IWorldEvent event)
ComponentController
.fatalError() and this.kill().
raiseEvent
in class AbstractLocalWorldView
protected void innerNotify(IWorldChangeEvent event)
DO NOT CALL SEPARATELY - should be called only from notifyEvent().
You may override it to provide event-specific processing behavior.
event
- protected void objectUpdatedEvent(ILocalWorldObjectUpdatedEvent updateEvent)
EventDrivenWorldView.innerNotify(IWorldChangeEvent)
if the event is IWorldObjectUpdatedEvent
to process it.
updateEvent
- protected void objectCreated(ILocalWorldObject obj)
Might be overridden to provide different behavior.
obj
- protected void objectUpdated(ILocalWorldObject obj)
Might be overridden to provide a mechanism that will forbid update of certain objects (like items that can't move).
obj
- protected void objectDestroyed(ILocalWorldObject obj)
Might be overriden to provide different behavior.
obj
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |