livespace.services
Class EntityClients

java.lang.Object
  extended by livespace.services.EntityClients
All Implemented Interfaces:
Disposable

public class EntityClients
extends Object
implements Disposable

Helper class to hold a set of entity clients. The class also provides a set of convenience methods to work with the contained entities. This class was refactored from livespace.services.room_presentation.EntityClients


Constructor Summary
EntityClients(Elvin elvin, RoomEntity room, String[] entityTypes)
           
 
Method Summary
 void addEntityClient(String type)
           
 void addPropertyListener(PropertyListener listener)
          This method should be called only after all entity clients have been added, otherwise new entities will not have had the listener added.
 void dispose()
          Dispose of the object (unregister listeners, close open resources etc).
 Entity find(String id)
          Finds an entity with a matching id within the set of entity clients
 Map<String,EntityClient> getClients()
           
 EntityClient getEntityClient(String type)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntityClients

public EntityClients(Elvin elvin,
                     RoomEntity room,
                     String[] entityTypes)
Method Detail

dispose

public void dispose()
Description copied from interface: Disposable
Dispose of the object (unregister listeners, close open resources etc). It should be safe to call this method more than once. Note for beans that support client event listeners: if there are listeners registered when this is called, this method should do nothing.

Specified by:
dispose in interface Disposable

addPropertyListener

public void addPropertyListener(PropertyListener listener)
This method should be called only after all entity clients have been added, otherwise new entities will not have had the listener added.

Parameters:
listener -
To do:
Consider removing restriction

getEntityClient

public EntityClient getEntityClient(String type)

addEntityClient

public void addEntityClient(String type)
                     throws IOException
Throws:
IOException

getClients

public Map<String,EntityClient> getClients()

find

public Entity find(String id)
Finds an entity with a matching id within the set of entity clients

Returns:
The found entity. Returns null if not found


Copyright © 2008 Commonwealth of Australia