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.
-
bSessionInSingleStream
-
-
commMgr
-
-
infoS
-
-
keyGenerator
-
-
owner
-
-
pm
-
-
recordingInProgress
-
-
sessionID
-
-
startTime
-
-
stopped
-
-
Session()
- This a default constructor for marshalling
-
Session(String, Arbitrator, SessionParticipant, SessionInfo)
- First initialize my superclass.
-
addCommunicator(Communicator)
-
-
addCommunicator(Sharable, Communicator)
-
-
addParticipant(SessionParticipant)
- Adding a participant requires telling the ParticipantManager
to add it.
-
AddSubModel(ModelObject, Object)
- Adds the given object as a child.
-
addTool(Collobject)
-
-
askServer(Answerable)
-
-
canAskServer()
-
-
changeSessionInfo(SessionInfo)
-
-
collobjectQuitting(Collobject)
-
-
containsParticipant(SessionParticipant)
-
-
countParticipants()
-
-
dumpSelf(MarshallOutput, String)
-
-
finishCapture(String)
-
-
flagStopped()
-
-
freezeInput(Sharable)
-
-
getHostName()
-
-
getInfoAsString()
- Returns a string with info about this session
-
getKeyGenerator()
-
-
GetListTool()
-
-
getParticipant(String)
- Get the participant with the given id.
-
getParticipantList()
-
-
getReplayController()
-
-
getReplayMonitor()
-
-
getReplaySocketGenerator()
-
-
getSessionInfo()
-
-
handleNewConnection(MarshallInput, MarshallOutput)
-
-
id()
- Return my identifier.
-
invite(SessionParticipant)
-
-
isRecording()
-
-
isShared()
-
-
isStopped()
-
-
key()
- My identifier is my key in my parent's table of children.
-
leave(boolean)
-
-
makeLocal()
-
-
makeMark(String)
-
-
newConnection(String, MarshallOutput)
- This is called when a participant's arbitrator makes a new connection
to any of my children's arbitrators.
-
notifyCollobjectsRecording(boolean)
-
-
owner()
- Return the participant who owns me.
-
postMessage(ServerMessage, Arbitrator)
-
-
postMessage(ServerMessage, Arbitrator, String)
-
-
queryObserverFactory(Object)
-
-
queryToolCount()
-
-
readInfo(MarshallInput)
- this is the inverse of writeInfo :)
returns the session port number
-
readSession(ObjectInput, boolean)
-
-
readTools(Vector)
-
-
receiveMulticastInformation(MarshallInput)
- this function receives information regarding whether this session can multicast
and if so how/where to receive the multicast information
-
recordActionGranted(ActionGranted)
-
-
register(Observer)
- Register an observer with the ParticipantManager.
-
removeAllParticipants()
- Really only remove other participants but myself
-
removeCommunicator(Communicator)
-
-
removeParticipant(SessionParticipant)
- Removing a participant requires telling the ParticipantManager
to remove it.
-
RemoveSubModel(ModelObject)
- Removes the given object from the list of children.
-
resetVariablesForReplay()
-
-
sendMulticastInformation(MarshallOutput)
- this function sends enough information so that the sender knows how/where
to talk for multicast communication
-
setKeyGenerator(KeyGen)
-
-
setObserverFactory(Object, ObserverFactory)
-
-
setOwner(SessionParticipant)
-
-
setPort(int, int)
-
-
setSingleStreamForCollobjects(boolean)
-
-
shutDown()
-
-
singleStreamForCollobjects()
-
-
startCapture(String, boolean)
-
-
startRecording(String)
-
-
startReplayArbitrators()
-
-
stealCollobject(Session, Collobject)
-
-
stop()
-
-
stopRecording(SessionParticipant, boolean)
-
-
subModels()
-
-
thawInput(Sharable)
-
-
toolList()
-
-
unregister(Observer)
- Unregister an observer with the ParticipantManager.
-
writeInfo(MarshallOutput)
- write relevant connection information to the output object.
-
writeTools(MarshallOutput)
-
infoS
protected SessionInfo infoS
pm
protected ParticipantManager pm
sessionID
protected String sessionID
owner
protected SessionParticipant owner
recordingInProgress
protected transient Hashtable recordingInProgress
commMgr
protected CommManager commMgr
keyGenerator
protected KeyGen keyGenerator
bSessionInSingleStream
protected boolean bSessionInSingleStream
startTime
protected Date startTime
stopped
protected transient boolean stopped
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.
Session
public Session()
- This a default constructor for marshalling
addCommunicator
protected boolean addCommunicator(Communicator c)
addCommunicator
protected boolean addCommunicator(Sharable key,
Communicator c)
removeCommunicator
protected void removeCommunicator(Communicator c)
collobjectQuitting
public void collobjectQuitting(Collobject co)
getHostName
public String getHostName()
handleNewConnection
public void handleNewConnection(MarshallInput in,
MarshallOutput out) throws IOException
postMessage
public void postMessage(ServerMessage message,
Arbitrator from)
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
askServer
public boolean askServer(Answerable a)
canAskServer
public boolean canAskServer()
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
finishCapture
public void finishCapture(String key)
resetVariablesForReplay
protected void resetVariablesForReplay()
- Returns:
- resets the variables of some arbitrators so that everything can
run properly
readTools
protected void readTools(Vector toolNames) throws IOException, ClassNotFoundException
startReplayArbitrators
public void startReplayArbitrators()
- Returns:
- starts the replay arbitrators
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
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
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
addParticipant
public synchronized boolean addParticipant(SessionParticipant client)
- Adding a participant requires telling the ParticipantManager
to add it.
getParticipant
public synchronized SessionParticipant getParticipant(String id)
- Get the participant with the given id.
countParticipants
public int countParticipants()
- Returns:
- Return the number of participants.
removeParticipant
public synchronized boolean removeParticipant(SessionParticipant client)
- Removing a participant requires telling the ParticipantManager
to remove it.
containsParticipant
public synchronized boolean containsParticipant(SessionParticipant p)
id
public String id()
- Return my identifier.
key
public Object key()
- My identifier is my key in my parent's table of children.
- Overrides:
- key in class ModelObject
subModels
protected SubModels subModels()
- Overrides:
- subModels in class ModelObject
owner
public SessionParticipant owner()
- Return the participant who owns me.
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
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
writeInfo
public void writeInfo(MarshallOutput out) throws IOException
- write relevant connection information to the output object.
readInfo
public int readInfo(MarshallInput in) throws IOException
- this is the inverse of writeInfo :)
returns the session port number
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.
flagStopped
public synchronized void flagStopped()
shutDown
public synchronized void shutDown()
- Returns:
- shuts down the session
- Overrides:
- shutDown in class Sharable
isStopped
public boolean isStopped()
- Overrides:
- isStopped in class Sharable
setOwner
public void setOwner(SessionParticipant p)
RemoveSubModel
public synchronized void RemoveSubModel(ModelObject inObject)
- Removes the given object from the list of children.
- Overrides:
- RemoveSubModel in class ModelObject
AddSubModel
protected synchronized void AddSubModel(ModelObject inObject,
Object key)
- Adds the given object as a child.
- Overrides:
- AddSubModel in class ModelObject
queryToolCount
public int queryToolCount()
addTool
public void addTool(Collobject c)
- Parameters:
- c - the new tool's collobject
- Returns:
- adds the tool
getSessionInfo
public SessionInfo getSessionInfo()
getParticipantList
public Enumeration getParticipantList()
GetListTool
public Enumeration GetListTool()
toolList
public Vector toolList()
writeTools
protected void writeTools(MarshallOutput out) throws IOException
changeSessionInfo
public void changeSessionInfo(SessionInfo is)
leave
public void leave(boolean quitSession)
- Returns:
- stops the session
stop
public void stop()
- Returns:
- stops the session
isShared
public boolean isShared()
invite
public boolean invite(SessionParticipant p)
removeAllParticipants
protected void removeAllParticipants()
- Really only remove other participants but myself
makeLocal
public void makeLocal()
startRecording
public void startRecording(String participantId)
stopRecording
public void stopRecording(SessionParticipant participant,
boolean doSend)
recordActionGranted
public synchronized void recordActionGranted(ActionGranted a)
isRecording
public boolean isRecording()
freezeInput
public void freezeInput(Sharable toFreeze)
thawInput
public void thawInput(Sharable toThaw)
dumpSelf
public synchronized void dumpSelf(MarshallOutput out,
String toWho) throws IOException
- Overrides:
- dumpSelf in class Sharable
register
public void register(Observer toRegister)
- Register an observer with the ParticipantManager.
unregister
public void unregister(Observer toRegister)
- Unregister an observer with the ParticipantManager.
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
queryObserverFactory
public ObserverFactory queryObserverFactory(Object key)
- Parameters:
- key - the key to look up the factory
- Returns:
- the factory that is doing the recording
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
notifyCollobjectsRecording
public void notifyCollobjectsRecording(boolean bWay)
- Parameters:
- bWay - are we recording or not
- Returns:
- notifies all collobjects that someone is recording
getReplayMonitor
public ReplayMonitor getReplayMonitor()
- Returns:
- the factory that is doing the recording
getReplaySocketGenerator
public ReplaySocketGenerator getReplaySocketGenerator()
- Returns:
- the factory that is doing the recording
getReplayController
public ReplayController getReplayController()
- Returns:
- the replay controller
getKeyGenerator
public KeyGen getKeyGenerator()
- Returns:
- the key generator for this session
setKeyGenerator
public void setKeyGenerator(KeyGen newKeyGen)
- Parameters:
- newKeyGen - the new key generator
- Returns:
- sets the key generator
singleStreamForCollobjects
public boolean singleStreamForCollobjects()
- Returns:
- whether we are working with a single stream or not
getInfoAsString
protected synchronized String getInfoAsString()
- Returns a string with info about this session
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