cz.cuni.amis.pogamut.multi.communication.worldview.impl
Class AbstractLocalWorldView

java.lang.Object
  extended by cz.cuni.amis.pogamut.multi.communication.worldview.impl.AbstractLocalWorldView
All Implemented Interfaces:
IComponent, ILocalWorldView, ITimedWorldChangeEventInput
Direct Known Subclasses:
EventDrivenLocalWorldView

public abstract class AbstractLocalWorldView
extends java.lang.Object
implements ILocalWorldView

WorldView responsible for single agent. The LocalWorldView always knows which timeKey is considered actual to its agent and makes sure, that the objects stay consistent for that timeKey and that newer objects are stored for further use. Abstract worldView handles data management and listener handling.


Nested Class Summary
protected  class AbstractLocalWorldView.LazyCompositeObjectMap<T extends ICompositeWorldObject>
          This is a class for lazy maps holding CompositeWorldObjects .
 
Field Summary
protected  java.util.Map<WorldObjectId,ILocalWorldObject> actLocalWorldObjects
           
protected  ITeamedAgentId agentId
           
protected  HashMapSet<java.lang.Class,WorldObjectId> classMap
           
static Token COMPONENT_ID
           
protected  IComponentControlHelper control
           
protected  ComponentController<IComponent> controller
           
protected  ILifecycleBus eventBus
           
protected  LogCategory log
           
protected  ISharedWorldView sharedWorldView
           
protected  java.util.Map<java.lang.Class,java.util.Set<WorldObjectId>> syncClassMap
           
 
Constructor Summary
AbstractLocalWorldView(ComponentDependencies dependencies, ILifecycleBus bus, IAgentLogger logger, ISharedWorldView sharedWV, ITeamedAgentId agentId)
           
 
Method Summary
 void addEventListener(java.lang.Class<?> event, IWorldEventListener<?> listener)
          Adds listener to a specific event (Level A listeners).
protected  void addLocalWorldObject(ILocalWorldObject obj)
          Helper method for adding a new object into all object maps.
 void addObjectListener(java.lang.Class<?> objectClass, java.lang.Class<?> eventClass, IWorldObjectEventListener<?,?> listener)
          Adds listener to a specified 'event' that occurs on the specific 'objectClass' (Level C listeners).
 void addObjectListener(java.lang.Class<?> objectClass, IWorldObjectEventListener<?,?> listener)
          Adds listener to all events that happens on any object of the 'objectClass' (Level B listeners).
 void addObjectListener(WorldObjectId objectId, java.lang.Class<?> eventClass, IWorldObjectEventListener<?,?> listener)
          Adds listener to a specified 'event' that occurs on the specific object with 'objectId' (Level E listeners).
 void addObjectListener(WorldObjectId objectId, IWorldObjectEventListener<?,?> listener)
          Adds listener to all events that happens on object with specific 'objectId' (Level D listeners).
protected  void addOldLocalWorldObject(ILocalWorldObject obj, long eventTime)
          Adds this object as old for all heldTimeKeys that currently hold no old copy of this object.
protected  void cleanUp()
          Cleans up internal data structures, called from start/stop/kill/reset methods.
protected abstract  ICompositeWorldObject createCompositeObject(ILocalWorldObject localObject, ISharedWorldObject sharedObject, IStaticWorldObject staticObject)
          Method used for returning the appropriate CompositeObject type made from the three provided object parts.
 java.util.Map<WorldObjectId,ICompositeWorldObject> get()
          Returns a map of all CompositeWorldObjects in the world.
protected  java.util.Map<WorldObjectId,ICompositeWorldObject> get(TimeKey time)
          Returns a map of all CompositeWorldObjects in the world.
 ICompositeWorldObject get(WorldObjectId objectId)
           
protected  ICompositeWorldObject get(WorldObjectId objectId, TimeKey time)
          Returns the object actual to the specified TimeKey.
 ITeamedAgentId getAgentId()
          Returns agentId of the agent associated with this WorldView.
 java.util.Map<java.lang.Class<?>,java.util.Map<WorldObjectId,ICompositeWorldObject>> getAll()
          Returns all objects sorted according to class.
<T extends ICompositeWorldObject>
java.util.Map<WorldObjectId,T>
getAll(java.lang.Class<T> type)
           
protected
<T extends ICompositeWorldObject>
java.util.Map<WorldObjectId,T>
getAll(java.lang.Class<T> type, TimeKey time)
          Returns a lazy-implemented classMap containing CompositeWorldObjects current to the specified TimeKey.
protected  java.util.Map<java.lang.Class<?>,java.util.Map<WorldObjectId,ICompositeWorldObject>> getAll(TimeKey time)
          Returns all objects sorted according to class.
 Token getComponentId()
          Unique identification of the component.
 TimeKey getCurrentTimeKey()
           
 ILifecycleBus getEventBus()
           
 ILocalWorldObject getLocal(WorldObjectId objectId)
          Returns the most current LocalObject.
protected  ILocalWorldObject getLocal(WorldObjectId objectId, TimeKey time)
          Returns the LocalObject associated with the provided TimeKey.
protected  ILocalWorldObject getMostRecentLocalWorldObject(WorldObjectId id)
          Returns the most recent instance of object with the specified id.
<T extends ICompositeWorldObject>
T
getSingle(java.lang.Class<T> cls)
           
protected
<T extends ICompositeWorldObject>
T
getSingle(java.lang.Class<T> cls, TimeKey time)
           
 boolean isListening(java.lang.Class<?> objectClass, java.lang.Class<?> eventClass, IWorldObjectEventListener<?,?> listener)
          Tests whether the 'listener' is listening at specified 'objectClass' for specified 'event' (Level C listeners).
 boolean isListening(java.lang.Class<?> eventClass, IWorldEventListener<?> listener)
          Tests whether the 'listener' is listening to a specific event (Level A listeners).
 boolean isListening(java.lang.Class<?> objectClass, IWorldObjectEventListener<?,?> listener)
          Tests whether the 'listener' is listening at specified 'objectClass' (Level B listeners).
 boolean isListening(IWorldEventListener<?> listener)
          Checks whether this listener is hooked to the world view (at any listener level).
 boolean isListening(WorldObjectId objectId, java.lang.Class<?> eventClass, IWorldObjectEventListener<?,?> listener)
          Tests whether the 'listener' is listening to a specified 'event' that occurs on the specific object with 'objectId' (Level E listeners).
 boolean isListening(WorldObjectId objectId, IWorldObjectEventListener<?,?> listener)
          Tests whether the 'listener' is listening at specified 'objectId' (Level D Listeners).
protected  boolean isPaused()
           
protected  boolean isRunning()
           
protected  void kill()
          Kills the world view.
 void lockTime(long time)
           
protected  void pause()
          Pauses the world view.
protected  void prePause()
          Pre-pauses the world view.
protected  void preStop()
          Pre-stops the world view.
protected  void raiseEvent(IWorldEvent event)
          Process new IWorldEvent - notify all the listeners about it.
 void removeEventListener(java.lang.Class<?> eventClass, IWorldEventListener<?> listener)
          Removes listener from a specific event (Level A listeners).
 void removeListener(IWorldEventListener<?> listener)
          Removes listener from every listeners category (from every listener level).
protected  void removeLocalWorldObject(ILocalWorldObject obj)
          Helper method to remove a localWorldObject from all corresponding object maps (used in DESTROYED events).
 void removeObjectListener(java.lang.Class<?> objectClass, java.lang.Class<?> eventClass, IWorldObjectEventListener<?,?> listener)
          Removes listener from specific 'objectClass' listening for specified 'event' (Level C listeners).
 void removeObjectListener(java.lang.Class<?> objectClass, IWorldObjectEventListener<?,?> listener)
          Removes listener from specific 'objectClass' listening for specified 'event' (Level B listeners).
 void removeObjectListener(WorldObjectId objectId, java.lang.Class<?> eventClass, IWorldObjectEventListener<?,?> listener)
          Removes listener to a specified 'event' that occurs on the specific object with 'objectId' (Level E listeners).
 void removeObjectListener(WorldObjectId objectId, IWorldObjectEventListener<?,?> listener)
          Removes listener from objects with specified 'objectId' (Level D Listeners).
protected  void reset()
          Resets the world view so it is start()able again.
protected  void resume()
          Resumes the world view.
 boolean setCurrentTime(TimeKey key)
           
 boolean setInitialTime(TimeKey key)
          Method for initializing the first timeKey, returns false if the TimeKey is already set.s
protected  void start()
          Starts the world view.
protected  void stop()
          Stops the world view.
 void unlockTime(long time)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface cz.cuni.amis.pogamut.multi.communication.worldview.ITimedWorldChangeEventInput
notify
 

Field Detail

COMPONENT_ID

public static final Token COMPONENT_ID

sharedWorldView

protected ISharedWorldView sharedWorldView

agentId

protected ITeamedAgentId agentId

actLocalWorldObjects

protected java.util.Map<WorldObjectId,ILocalWorldObject> actLocalWorldObjects

classMap

protected HashMapSet<java.lang.Class,WorldObjectId> classMap

syncClassMap

protected java.util.Map<java.lang.Class,java.util.Set<WorldObjectId>> syncClassMap

log

protected LogCategory log

eventBus

protected ILifecycleBus eventBus

controller

protected ComponentController<IComponent> controller

control

protected IComponentControlHelper control
Constructor Detail

AbstractLocalWorldView

public AbstractLocalWorldView(ComponentDependencies dependencies,
                              ILifecycleBus bus,
                              IAgentLogger logger,
                              ISharedWorldView sharedWV,
                              ITeamedAgentId agentId)
Method Detail

cleanUp

protected void cleanUp()
Cleans up internal data structures, called from start/stop/kill/reset methods.

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


start

protected void start()
Starts the world view.

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


prePause

protected void prePause()
Pre-pauses the world view.

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


pause

protected void pause()
Pauses the world view.

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


resume

protected void resume()
Resumes the world view.

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


preStop

protected void preStop()
Pre-stops the world view.

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


stop

protected void stop()
Stops the world view.

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


kill

protected void kill()
Kills the world view.

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


reset

protected void reset()
Resets the world view so it is start()able again.

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


isRunning

protected boolean isRunning()

isPaused

protected boolean isPaused()

getComponentId

public Token getComponentId()
Description copied from interface: IComponent
Unique identification of the component.

Specified by:
getComponentId in interface IComponent
Returns:

createCompositeObject

protected abstract ICompositeWorldObject createCompositeObject(ILocalWorldObject localObject,
                                                               ISharedWorldObject sharedObject,
                                                               IStaticWorldObject staticObject)

Method used for returning the appropriate CompositeObject type made from the three provided object parts. All parts must share the same WorldObjectId and must belong to the same CompositeObject class. Also, none of the parts may be null.

The method should return a proxy-type CompositeObject, meaning that the object will only wrap all objectParts and no data will actually be copied.

This method must be overriden by a object-awareWorldView which has information about all the object classes in the world and is able to call the correct constructors

Parameters:
localObject - local part of the object
sharedObject - shared part of the object
staticObject - static part of the object
Returns:
Proxy-type compositeObject.

getAgentId

public ITeamedAgentId getAgentId()
Returns agentId of the agent associated with this WorldView.

Specified by:
getAgentId in interface ILocalWorldView
Returns:
teamed AgentId

getLocal

public ILocalWorldObject getLocal(WorldObjectId objectId)
Description copied from interface: ILocalWorldView
Returns the most current LocalObject.
Returns the local part of requested WorldObject. A local part for every object contains properties subjective to only one agent. (like isVisible).

Specified by:
getLocal in interface ILocalWorldView
Returns:

getLocal

protected ILocalWorldObject getLocal(WorldObjectId objectId,
                                     TimeKey time)
Returns the LocalObject associated with the provided TimeKey. Returns the local part of requested WorldObject. A local part for every object contains properties subjective to only one agent. (like isVisible).

Parameters:
objectId -
time -
Returns:

get

protected ICompositeWorldObject get(WorldObjectId objectId,
                                    TimeKey time)
Returns the object actual to the specified TimeKey. Returns the CompositeWorldObject for the requested Id. Composite objects behave like old WorldObjects, they contain all object fields and the data is guaranteed to be consistent (meaning all fields are actual for the same timeKey). Any object returned by this method should be compatible with any non-multi method (ie. a method expecting just IWorldObject).

Parameters:
objectId -
time -
Returns:
Throws:

get

public ICompositeWorldObject get(WorldObjectId objectId)
Specified by:
get in interface ILocalWorldView
Returns:

getAll

protected java.util.Map<java.lang.Class<?>,java.util.Map<WorldObjectId,ICompositeWorldObject>> getAll(TimeKey time)
Returns all objects sorted according to class. All of the classMaps are lazy-implemented, so the CompositeObject will only be created on get method. If you need to iterate over the map, but you don't need the actual objects, iterate over the keySet. Do not hold reference to this map! Always use new getAll() call when you need this map again or you risk that some classMaps will get new timeKeys. By calling getAll(Class, time != thisTime).

Parameters:
time -
Returns:

getAll

public java.util.Map<java.lang.Class<?>,java.util.Map<WorldObjectId,ICompositeWorldObject>> getAll()
Description copied from interface: ILocalWorldView
Returns all objects sorted according to class. All of the classMaps are lazy-implemented, so the CompositeObject will only be created on get method. If you need to iterate over the map, but you don't need the actual objects, iterate over the keySet. Do not hold reference to this map! Always use new getAll() call when you need this map again or you risk that some classMaps will get new timeKeys. By calling getAll(Class, time != thisTime).

Specified by:
getAll in interface ILocalWorldView
Returns:

getAll

protected <T extends ICompositeWorldObject> java.util.Map<WorldObjectId,T> getAll(java.lang.Class<T> type,
                                                                                  TimeKey time)
Returns a lazy-implemented classMap containing CompositeWorldObjects current to the specified TimeKey.

WARNING : do not store this map, always use the getAll() method or copy the map if you really need it stored somewhere. The TimeKey can be overriden by calling another getAll( Class==Class, time!=time) .

Type Parameters:
T -
Parameters:
type -
time -
Returns:

getAll

public <T extends ICompositeWorldObject> java.util.Map<WorldObjectId,T> getAll(java.lang.Class<T> type)
Specified by:
getAll in interface ILocalWorldView
Returns:

get

public java.util.Map<WorldObjectId,ICompositeWorldObject> get()
Description copied from interface: ILocalWorldView
Returns a map of all CompositeWorldObjects in the world.
The map is lazy, the Composite objects are created only when a get() method is called. If you need to iterate over this map and you don't need all of the values iterate over the keySet.
The map will contain objects current to timeKey actual on calling of this method.

Specified by:
get in interface ILocalWorldView
Returns:

get

protected java.util.Map<WorldObjectId,ICompositeWorldObject> get(TimeKey time)
Returns a map of all CompositeWorldObjects in the world.
The map is lazy, the Composite objects are created only when a get() method is called. If you need to iterate over this map and you don't need all of the values iterate over the keySet.
The map will contain objects current to the provided TimeKey.

Parameters:
time -
Returns:

getSingle

public <T extends ICompositeWorldObject> T getSingle(java.lang.Class<T> cls)
Specified by:
getSingle in interface ILocalWorldView

getSingle

protected <T extends ICompositeWorldObject> T getSingle(java.lang.Class<T> cls,
                                                        TimeKey time)

getMostRecentLocalWorldObject

protected ILocalWorldObject getMostRecentLocalWorldObject(WorldObjectId id)
Returns the most recent instance of object with the specified id.

Parameters:
id - id of the object
Returns:
most recent object instance

addOldLocalWorldObject

protected void addOldLocalWorldObject(ILocalWorldObject obj,
                                      long eventTime)
Adds this object as old for all heldTimeKeys that currently hold no old copy of this object.


addLocalWorldObject

protected void addLocalWorldObject(ILocalWorldObject obj)
Helper method for adding a new object into all object maps. (used in CREATED events).

Parameters:
obj -

removeLocalWorldObject

protected void removeLocalWorldObject(ILocalWorldObject obj)
Helper method to remove a localWorldObject from all corresponding object maps (used in DESTROYED events).

Parameters:
obj -

setInitialTime

public boolean setInitialTime(TimeKey key)
Method for initializing the first timeKey, returns false if the TimeKey is already set.s

Specified by:
setInitialTime in interface ILocalWorldView
Parameters:
key -
Returns:

setCurrentTime

public boolean setCurrentTime(TimeKey key)
Specified by:
setCurrentTime in interface ILocalWorldView

getCurrentTimeKey

public TimeKey getCurrentTimeKey()
Specified by:
getCurrentTimeKey in interface ILocalWorldView

lockTime

public void lockTime(long time)
Specified by:
lockTime in interface ILocalWorldView

unlockTime

public void unlockTime(long time)
Specified by:
unlockTime in interface ILocalWorldView

addEventListener

public void addEventListener(java.lang.Class<?> event,
                             IWorldEventListener<?> listener)
Description copied from interface: ILocalWorldView
Adds listener to a specific event (Level A listeners). Note that the event listener must be able to handle events of the class 'event'.

It is the most general type of listener-registration allowing you to sniff any type of events.

Events passed to the listener are filtered only according to the 'event' class.

WARNING: even though the method does not require templated class and listener, you must be sure that 'listener' can accept 'eventClass'.

Specified by:
addEventListener in interface ILocalWorldView
Parameters:
event - which event types you want to receive
listener - where you want to handle these events

addObjectListener

public void addObjectListener(java.lang.Class<?> objectClass,
                              IWorldObjectEventListener<?,?> listener)
Description copied from interface: ILocalWorldView
Adds listener to all events that happens on any object of the 'objectClass' (Level B listeners).

Events passed to the listener are filtered according to the 'objectClass'.

WARNING: even though the method does not require templated classes and listener, you must be sure that 'listener' accepts all events (IWorldObjectEvent) for objects of 'objectClass'.

Specified by:
addObjectListener in interface ILocalWorldView
Parameters:
objectClass - which object class you want to listen at
listener - where you want to handle these events

addObjectListener

public void addObjectListener(java.lang.Class<?> objectClass,
                              java.lang.Class<?> eventClass,
                              IWorldObjectEventListener<?,?> listener)
Description copied from interface: ILocalWorldView
Adds listener to a specified 'event' that occurs on the specific 'objectClass' (Level C listeners).

Events passed to the listener are filtered according to the 'event' and 'objectClass' of the object the event happened upon.

WARNING: even though the method does not require templated classes and listener, you must be sure that 'listener' accepts 'eventClass' for objects of 'objectClass'.

eventClass can be any implementor of IWorldObjectEvent. E.g. WorldObjectAppearedEvent, WorldObjectDestroyedEvent, WorldObjectDisappearedEvent, WorldObjectFirstEncounteredEvent or WorldObjectUpdatedEvent.

Specified by:
addObjectListener in interface ILocalWorldView
Parameters:
objectClass - which object class you want to listen at
eventClass - which event class you want to receive
listener - where you want to handle these events

addObjectListener

public void addObjectListener(WorldObjectId objectId,
                              IWorldObjectEventListener<?,?> listener)
Description copied from interface: ILocalWorldView
Adds listener to all events that happens on object with specific 'objectId' (Level D listeners).

Events passed to the listener are filtered according to the 'objectId' of the object.

WARNING: you must ensure that 'listener' can accept the event raised on object of specified 'objectId'.

Specified by:
addObjectListener in interface ILocalWorldView
Parameters:
objectId - which object you want to listen at
listener - where you want to handle events

addObjectListener

public void addObjectListener(WorldObjectId objectId,
                              java.lang.Class<?> eventClass,
                              IWorldObjectEventListener<?,?> listener)
Description copied from interface: ILocalWorldView
Adds listener to a specified 'event' that occurs on the specific object with 'objectId' (Level E listeners).

Events passed to the listener are filtered according to the 'event' and 'objectId' of the object.

WARNING: even though the method does not require templated classes and listener, you must be sure that 'listener' accepts 'eventClass' for objects of specified 'objectId'.

Specified by:
addObjectListener in interface ILocalWorldView
Parameters:
objectId - which object you want to listen at
eventClass - which event classes you want to receive
listener - where you want to handle these events

isListening

public boolean isListening(java.lang.Class<?> eventClass,
                           IWorldEventListener<?> listener)
Description copied from interface: ILocalWorldView
Tests whether the 'listener' is listening to a specific event (Level A listeners).

Specified by:
isListening in interface ILocalWorldView
Parameters:
eventClass - which events you want to receive
listener - that is tested
Returns:
whether the listener is listening

isListening

public boolean isListening(java.lang.Class<?> objectClass,
                           IWorldObjectEventListener<?,?> listener)
Description copied from interface: ILocalWorldView
Tests whether the 'listener' is listening at specified 'objectClass' (Level B listeners).

Specified by:
isListening in interface ILocalWorldView
Parameters:
objectClass - where the listener is tested
listener - that is tested
Returns:
whether the listener is listening

isListening

public boolean isListening(java.lang.Class<?> objectClass,
                           java.lang.Class<?> eventClass,
                           IWorldObjectEventListener<?,?> listener)
Description copied from interface: ILocalWorldView
Tests whether the 'listener' is listening at specified 'objectClass' for specified 'event' (Level C listeners).

Specified by:
isListening in interface ILocalWorldView
Parameters:
objectClass - where the listener is tested
eventClass - where the listener is tested
listener - that is tested
Returns:
whether the listener is listening

isListening

public boolean isListening(WorldObjectId objectId,
                           IWorldObjectEventListener<?,?> listener)
Description copied from interface: ILocalWorldView
Tests whether the 'listener' is listening at specified 'objectId' (Level D Listeners).

Specified by:
isListening in interface ILocalWorldView
Parameters:
objectId - where the listener is tested
listener - that is tested
Returns:
whether the listener is listening

isListening

public boolean isListening(WorldObjectId objectId,
                           java.lang.Class<?> eventClass,
                           IWorldObjectEventListener<?,?> listener)
Description copied from interface: ILocalWorldView
Tests whether the 'listener' is listening to a specified 'event' that occurs on the specific object with 'objectId' (Level E listeners).

Specified by:
isListening in interface ILocalWorldView
Parameters:
objectId - where the listener is tested
eventClass - what class is tested
listener - that is tested
Returns:
whether the listener is listening

isListening

public boolean isListening(IWorldEventListener<?> listener)
Description copied from interface: ILocalWorldView
Checks whether this listener is hooked to the world view (at any listener level).

WARNING: Can be time consuming! (Iterating through all levels of listeners.)

Specified by:
isListening in interface ILocalWorldView
Returns:

removeEventListener

public void removeEventListener(java.lang.Class<?> eventClass,
                                IWorldEventListener<?> listener)
Description copied from interface: ILocalWorldView
Removes listener from a specific event (Level A listeners).

Specified by:
removeEventListener in interface ILocalWorldView
Parameters:
eventClass - which events class you want to remove the listener from
listener - you want to remove

removeObjectListener

public void removeObjectListener(java.lang.Class<?> objectClass,
                                 IWorldObjectEventListener<?,?> listener)
Description copied from interface: ILocalWorldView
Removes listener from specific 'objectClass' listening for specified 'event' (Level B listeners).

Specified by:
removeObjectListener in interface ILocalWorldView
Parameters:
objectClass - class of objects you want the listener to remove from
listener - you want to remove

removeObjectListener

public void removeObjectListener(java.lang.Class<?> objectClass,
                                 java.lang.Class<?> eventClass,
                                 IWorldObjectEventListener<?,?> listener)
Description copied from interface: ILocalWorldView
Removes listener from specific 'objectClass' listening for specified 'event' (Level C listeners).

Specified by:
removeObjectListener in interface ILocalWorldView
Parameters:
objectClass - class of objects you want the listener to remove from
eventClass - which events class you want to remove the listener from
listener - you want to remove

removeObjectListener

public void removeObjectListener(WorldObjectId objectId,
                                 IWorldObjectEventListener<?,?> listener)
Description copied from interface: ILocalWorldView
Removes listener from objects with specified 'objectId' (Level D Listeners).

Specified by:
removeObjectListener in interface ILocalWorldView
Parameters:
objectId - id of object you want the listener to remove from
listener - you want to remove

removeObjectListener

public void removeObjectListener(WorldObjectId objectId,
                                 java.lang.Class<?> eventClass,
                                 IWorldObjectEventListener<?,?> listener)
Description copied from interface: ILocalWorldView
Removes listener to a specified 'event' that occurs on the specific object with 'objectId' (Level E listeners).

Specified by:
removeObjectListener in interface ILocalWorldView
Parameters:
objectId - id of object you want the listener to remove from
eventClass - event class you want to stop receiving in the listener
listener - you want to remove

removeListener

public void removeListener(IWorldEventListener<?> listener)
Description copied from interface: ILocalWorldView
Removes listener from every listeners category (from every listener level).

WARNING: Can be time consuming! (Iterating through all levels of listeners.)

Specified by:
removeListener in interface ILocalWorldView
Parameters:
listener - you want to remove from all listener levels

raiseEvent

protected void raiseEvent(IWorldEvent event)
Process new IWorldEvent - notify all the listeners about it. Forbids recursion.

Use in the descendants to process new IWorldChangeEvent.

Does not catch any exceptions!

Synchronized!

Parameters:
event -

getEventBus

public ILifecycleBus getEventBus()
Specified by:
getEventBus in interface ILocalWorldView