All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ncsa.habanero.ParticipantManager

java.lang.Object
   |
   +----java.util.Observable
           |
           +----ncsa.habanero.ParticipantManager

public class ParticipantManager
extends Observable
implements Marshallable
The ParticipantManager keeps a list of all of the participants in a particular session. When one is added or removed it notifies all of the session's routers, which can choose to keep their own routing lists or to query this object each time they route. Each client is identified by its own unique string, which serves as the key into the Hashtable where the clients are kept.


Constructor Index

 o ParticipantManager(Session, SessionParticipant)

Method Index

 o addParticipant(SessionParticipant)
 o clear()
 o contains(SessionParticipant)
 o countParticipants()
 o getParticipant(String)
 o notifyObservers(Object)
For some reason the default implementation requires that a flag be set before observers get notified.
 o participants()
 o removeParticipant(SessionParticipant)

Constructors

 o ParticipantManager
 public ParticipantManager(Session session,
                           SessionParticipant client)
Returns:
Initialize the ParticipantManager with the Session of the participants.

Methods

 o addParticipant
 public void addParticipant(SessionParticipant client)
Parameters:
client - participant to add
Returns:
Add a participant to the list, and notify any observers
 o removeParticipant
 public void removeParticipant(SessionParticipant client)
Parameters:
client - participant to remove
Returns:
Remove a participant from the list, and notify any observers
 o participants
 public Enumeration participants()
Returns:
an Enumeration representing the participants
 o contains
 public boolean contains(SessionParticipant client)
Parameters:
client - participant to check
Returns:
true if our list contains the given participant
 o countParticipants
 public int countParticipants()
Returns:
Return the number of participants.
 o getParticipant
 public SessionParticipant getParticipant(String id)
Parameters:
id - the identification of the participant
Returns:
Given an id, return a SessionParticipant.
 o notifyObservers
 public synchronized void notifyObservers(Object arg)
For some reason the default implementation requires that a flag be set before observers get notified. I couldn't figure out why, so this sets the flag and then calls the default implementation.

Overrides:
notifyObservers in class Observable
 o clear
 public void clear()
Returns:
clears the participants, nulls the session

All Packages  Class Hierarchy  This Package  Previous  Next  Index