All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ncsa.habanero.Session

java.lang.Object
   |
   +----ncsa.habanero.ModelObject
           |
           +----ncsa.habanero.Targetable
                   |
                   +----ncsa.habanero.Sharable
                           |
                           +----ncsa.habanero.Session

public class Session
extends Sharable
The Session class represents a set of Collobjects which are being used by (and thus available to) a set of participants. In particular, all participants see all of the Collobjects, and the Session is the ancestor (probably the parent in most cases) of all of the Collobjects. Since Sessions are Sharables, they have arbitrators. They are also required to have a serializer and a router, which are the defaults for all of its descendant Collobjects.


Variable Index

 o bSessionInSingleStream
 o commMgr
 o infoS
 o keyGenerator
 o owner
 o pm
 o recordingInProgress
 o sessionID
 o startTime
 o stopped

Constructor Index

 o Session()
This a default constructor for marshalling
 o Session(String, Arbitrator, SessionParticipant, SessionInfo)
First initialize my superclass.

Method Index

 o addCommunicator(Communicator)
 o addCommunicator(Sharable, Communicator)
 o addParticipant(SessionParticipant)
Adding a participant requires telling the ParticipantManager to add it.
 o AddSubModel(ModelObject, Object)
Adds the given object as a child.
 o addTool(Collobject)
 o askServer(Answerable)
 o canAskServer()
 o changeSessionInfo(SessionInfo)
 o collobjectQuitting(Collobject)
 o containsParticipant(SessionParticipant)
 o countParticipants()
 o dumpSelf(MarshallOutput, String)
 o finishCapture(String)
 o flagStopped()
 o freezeInput(Sharable)
 o getHostName()
 o getInfoAsString()
Returns a string with info about this session
 o getKeyGenerator()
 o GetListTool()
 o getParticipant(String)
Get the participant with the given id.
 o getParticipantList()
 o getReplayController()
 o getReplayMonitor()
 o getReplaySocketGenerator()
 o getSessionInfo()
 o handleNewConnection(MarshallInput, MarshallOutput)
 o id()
Return my identifier.
 o invite(SessionParticipant)
 o isRecording()
 o isShared()
 o isStopped()
 o key()
My identifier is my key in my parent's table of children.
 o leave(boolean)
 o makeLocal()
 o makeMark(String)
 o newConnection(String, MarshallOutput)
This is called when a participant's arbitrator makes a new connection to any of my children's arbitrators.
 o notifyCollobjectsRecording(boolean)
 o owner()
Return the participant who owns me.
 o postMessage(ServerMessage, Arbitrator)
 o postMessage(ServerMessage, Arbitrator, String)
 o queryObserverFactory(Object)
 o queryToolCount()
 o readInfo(MarshallInput)
this is the inverse of writeInfo :) returns the session port number
 o readSession(ObjectInput, boolean)
 o readTools(Vector)
 o receiveMulticastInformation(MarshallInput)
this function receives information regarding whether this session can multicast and if so how/where to receive the multicast information
 o recordActionGranted(ActionGranted)
 o register(Observer)
Register an observer with the ParticipantManager.
 o removeAllParticipants()
Really only remove other participants but myself
 o removeCommunicator(Communicator)
 o removeParticipant(SessionParticipant)
Removing a participant requires telling the ParticipantManager to remove it.
 o RemoveSubModel(ModelObject)
Removes the given object from the list of children.
 o resetVariablesForReplay()
 o sendMulticastInformation(MarshallOutput)
this function sends enough information so that the sender knows how/where to talk for multicast communication
 o setKeyGenerator(KeyGen)
 o setObserverFactory(Object, ObserverFactory)
 o setOwner(SessionParticipant)
 o setPort(int, int)
 o setSingleStreamForCollobjects(boolean)
 o shutDown()
 o singleStreamForCollobjects()
 o startCapture(String, boolean)
 o startRecording(String)
 o startReplayArbitrators()
 o stealCollobject(Session, Collobject)
 o stop()
 o stopRecording(SessionParticipant, boolean)
 o subModels()
 o thawInput(Sharable)
 o toolList()
 o unregister(Observer)
Unregister an observer with the ParticipantManager.
 o writeInfo(MarshallOutput)
write relevant connection information to the output object.
 o writeTools(MarshallOutput)

Variables

 o infoS
 protected SessionInfo infoS
 o pm
 protected ParticipantManager pm
 o sessionID
 protected String sessionID
 o owner
 protected SessionParticipant owner
 o recordingInProgress
 protected transient Hashtable recordingInProgress
 o commMgr
 protected CommManager commMgr
 o keyGenerator
 protected KeyGen keyGenerator
 o bSessionInSingleStream
 protected boolean bSessionInSingleStream
 o startTime
 protected Date startTime
 o stopped
 protected transient boolean stopped

Constructors

 o Session
 public Session(String id,
                Arbitrator inner,
                SessionParticipant who,
                SessionInfo i)
First initialize my superclass. Then create my arbitrator, which is required to be a special SessionArbitrator, and which wraps the Arbitrator I am passed as an argument. I also store my id and my owner.

 o Session
 public Session()
This a default constructor for marshalling

Methods

 o addCommunicator
 protected boolean addCommunicator(Communicator c)
 o addCommunicator
 protected boolean addCommunicator(Sharable key,
                                   Communicator c)
 o removeCommunicator
 protected void removeCommunicator(Communicator c)
 o collobjectQuitting
 public void collobjectQuitting(Collobject co)
 o getHostName
 public String getHostName()
 o handleNewConnection
 public void handleNewConnection(MarshallInput in,
                                 MarshallOutput out) throws IOException
 o postMessage
 public void postMessage(ServerMessage message,
                         Arbitrator from)
 o postMessage
 public void postMessage(ServerMessage message,
                         Arbitrator from,
                         String strWho)
Parameters:
message - the message we want to send
from - the arbitrator sending the message
strWho - the designated receiver
Returns:
sends a message to a specific individual
 o askServer
 public boolean askServer(Answerable a)
 o canAskServer
 public boolean canAskServer()
 o startCapture
 public void startCapture(String key,
                          boolean bArbitratorToo)
Parameters:
key - a description of which recorder should start recording
bArbitratorToo - should the arbitrator record too
Returns:
starts recording
 o finishCapture
 public void finishCapture(String key)
 o resetVariablesForReplay
 protected void resetVariablesForReplay()
Returns:
resets the variables of some arbitrators so that everything can run properly
 o readTools
 protected void readTools(Vector toolNames) throws IOException, ClassNotFoundException
 o startReplayArbitrators
 public void startReplayArbitrators()
Returns:
starts the replay arbitrators
 o setPort
 public void setPort(int nCollobjectNumber,
                     int nPortNumber)
Parameters:
nCollobjectNumber - the number of the collobject
nPortNumber - the number of the new port
Returns:
sets the port of the new arbitrator
 o readSession
 public void readSession(ObjectInput in,
                         boolean bCopyParticipants) throws IOException, ClassNotFoundException
Parameters:
in - the input stream
bCopyParticipants - should the participants be copied too?
Returns:
rereads the object
 o stealCollobject
 public void stealCollobject(Session oldSession,
                             Collobject tool)
Parameters:
oldSession - - the old session
tool - - the collobject we are stealing
Returns:
moves the tool from the old session to the current session
 o addParticipant
 public synchronized boolean addParticipant(SessionParticipant client)
Adding a participant requires telling the ParticipantManager to add it.

 o getParticipant
 public synchronized SessionParticipant getParticipant(String id)
Get the participant with the given id.

 o countParticipants
 public int countParticipants()
Returns:
Return the number of participants.
 o removeParticipant
 public synchronized boolean removeParticipant(SessionParticipant client)
Removing a participant requires telling the ParticipantManager to remove it.

 o containsParticipant
 public synchronized boolean containsParticipant(SessionParticipant p)
 o id
 public String id()
Return my identifier.

 o key
 public Object key()
My identifier is my key in my parent's table of children.

Overrides:
key in class ModelObject
 o subModels
 protected SubModels subModels()
Overrides:
subModels in class ModelObject
 o owner
 public SessionParticipant owner()
Return the participant who owns me.

 o sendMulticastInformation
 protected void sendMulticastInformation(MarshallOutput out) throws IOException
this function sends enough information so that the sender knows how/where to talk for multicast communication

 o receiveMulticastInformation
 protected void receiveMulticastInformation(MarshallInput in) throws IOException
this function receives information regarding whether this session can multicast and if so how/where to receive the multicast information

 o writeInfo
 public void writeInfo(MarshallOutput out) throws IOException
write relevant connection information to the output object.

 o readInfo
 public int readInfo(MarshallInput in) throws IOException
this is the inverse of writeInfo :) returns the session port number

 o newConnection
 public synchronized void newConnection(String participantId,
                                        MarshallOutput connection)
This is called when a participant's arbitrator makes a new connection to any of my children's arbitrators. It tries to find the SessionParticipant object representing that participant, and adds the connection information to it.

 o flagStopped
 public synchronized void flagStopped()
 o shutDown
 public synchronized void shutDown()
Returns:
shuts down the session
Overrides:
shutDown in class Sharable
 o isStopped
 public boolean isStopped()
Overrides:
isStopped in class Sharable
 o setOwner
 public void setOwner(SessionParticipant p)
 o RemoveSubModel
 public synchronized void RemoveSubModel(ModelObject inObject)
Removes the given object from the list of children.

Overrides:
RemoveSubModel in class ModelObject
 o AddSubModel
 protected synchronized void AddSubModel(ModelObject inObject,
                                         Object key)
Adds the given object as a child.

Overrides:
AddSubModel in class ModelObject
 o queryToolCount
 public int queryToolCount()
 o addTool
 public void addTool(Collobject c)
Parameters:
c - the new tool's collobject
Returns:
adds the tool
 o getSessionInfo
 public SessionInfo getSessionInfo()
 o getParticipantList
 public Enumeration getParticipantList()
 o GetListTool
 public Enumeration GetListTool()
 o toolList
 public Vector toolList()
 o writeTools
 protected void writeTools(MarshallOutput out) throws IOException
 o changeSessionInfo
 public void changeSessionInfo(SessionInfo is)
 o leave
 public void leave(boolean quitSession)
Returns:
stops the session
 o stop
 public void stop()
Returns:
stops the session
 o isShared
 public boolean isShared()
 o invite
 public boolean invite(SessionParticipant p)
 o removeAllParticipants
 protected void removeAllParticipants()
Really only remove other participants but myself

 o makeLocal
 public void makeLocal()
 o startRecording
 public void startRecording(String participantId)
 o stopRecording
 public void stopRecording(SessionParticipant participant,
                           boolean doSend)
 o recordActionGranted
 public synchronized void recordActionGranted(ActionGranted a)
 o isRecording
 public boolean isRecording()
 o freezeInput
 public void freezeInput(Sharable toFreeze)
 o thawInput
 public void thawInput(Sharable toThaw)
 o dumpSelf
 public synchronized void dumpSelf(MarshallOutput out,
                                   String toWho) throws IOException
Overrides:
dumpSelf in class Sharable
 o register
 public void register(Observer toRegister)
Register an observer with the ParticipantManager.

 o unregister
 public void unregister(Observer toRegister)
Unregister an observer with the ParticipantManager.

 o setObserverFactory
 public void setObserverFactory(Object key,
                                ObserverFactory newFactory)
Parameters:
key - the key to look up the factory
newFactory - the new recording factory for this session
Returns:
adds the factory to the vector of factories
 o queryObserverFactory
 public ObserverFactory queryObserverFactory(Object key)
Parameters:
key - the key to look up the factory
Returns:
the factory that is doing the recording
 o makeMark
 public void makeMark(String key)
Parameters:
key - the observer to make a mark in
Returns:
creates a mark in the appropriate observer's files
 o notifyCollobjectsRecording
 public void notifyCollobjectsRecording(boolean bWay)
Parameters:
bWay - are we recording or not
Returns:
notifies all collobjects that someone is recording
 o getReplayMonitor
 public ReplayMonitor getReplayMonitor()
Returns:
the factory that is doing the recording
 o getReplaySocketGenerator
 public ReplaySocketGenerator getReplaySocketGenerator()
Returns:
the factory that is doing the recording
 o getReplayController
 public ReplayController getReplayController()
Returns:
the replay controller
 o getKeyGenerator
 public KeyGen getKeyGenerator()
Returns:
the key generator for this session
 o setKeyGenerator
 public void setKeyGenerator(KeyGen newKeyGen)
Parameters:
newKeyGen - the new key generator
Returns:
sets the key generator
 o singleStreamForCollobjects
 public boolean singleStreamForCollobjects()
Returns:
whether we are working with a single stream or not
 o getInfoAsString
 protected synchronized String getInfoAsString()
Returns a string with info about this session

 o setSingleStreamForCollobjects
 public void setSingleStreamForCollobjects(boolean bWay)
Parameters:
bWay - the way we are setting the variable
Returns:
sets the variable for a single stream or not

All Packages  Class Hierarchy  This Package  Previous  Next  Index