|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcz.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 LinkedList<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 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)
New event was generated from the world. |
void |
notifyAfterPropagation(IWorldChangeEvent event)
Raise another event after current one finishes its propagation. |
void |
notifyImmediately(IWorldChangeEvent event)
Calls notify without waiting for batches, locks or anything else. |
protected void |
objectCreated(ILocalWorldObject obj,
long time)
Must be called whenever an object was created, raises correct events. |
protected void |
objectDestroyed(ILocalWorldObject obj,
long time)
Must be called whenever an object was destroyed - raises correct events. |
protected void |
objectUpdated(ILocalWorldObject obj,
long time)
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, 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 String WORLDVIEW_DEPENDENCY
protected boolean receiveEventProcessing
It is managed only by notify() method - DO NOT MODIFY OUTSIDE IT!
protected LinkedList<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
IWorldChangeEventInput
ComponentNotRunningException
ComponentPausedException
public void notifyAfterPropagation(IWorldChangeEvent event) throws ComponentNotRunningException, ComponentPausedException
IWorldChangeEventInput
Won't propagate the event if the world view is locked!.
ComponentNotRunningException
ComponentPausedException
public void notifyImmediately(IWorldChangeEvent event) throws ComponentNotRunningException, ComponentPausedException
ILocalWorldView
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, long time)
Might be overridden to provide different behavior.
obj
- protected void objectUpdated(ILocalWorldObject obj, long time)
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, long time)
Might be overriden to provide different behavior.
obj
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |