uk.org.ogsadai.sessions
Interface InternalSession

All Superinterfaces:
Session
All Known Implementing Classes:
TransientInternalSession

public interface InternalSession
extends Session

The internal interface for all objects acting as sessions.

It extends the Session interface, which is the safe view given to session participants. A number of additional methods are defined for admitting and releasing session participants, managing the lifetime of the session, and registering session listeners.

Author:
The OGSA-DAI Project Team

Method Summary
 void addSessionListener(SessionListener listener)
          Registers a session listener with the session.
 void admit(SessionParticipant participant)
          Admits a new session participant to the session.
 void cleanUp()
          Cleans up the session before it is made eligible for garbage collection.
 int countParticants()
          Returns the number of session participants that are currently joined to the session.
 SessionSettings getSettings()
          Returns a SessionSettings object encapsulating the settings for this session.
 void release(SessionParticipant participant)
          Releases the specified session participant from the session.
 
Methods inherited from interface uk.org.ogsadai.sessions.Session
addExternalInput, addExternalOutput, containsAttribute, countAttributes, getAttribute, getAttributeNames, getAttributeValue, getExternalInput, getExternalOutput, getID, getProperties, getRequestStatus, hasExternalInput, hasExternalOutput, removeAttribute, removeExternalInput, removeExternalOutput, setAttribute
 

Method Detail

addSessionListener

public void addSessionListener(SessionListener listener)
Registers a session listener with the session. The listener will be notified each time a session event occurs.

Parameters:
listener - The SessionListener to register.

admit

public void admit(SessionParticipant participant)
           throws SessionJoinDeniedException,
                  SessionJoinException
Admits a new session participant to the session.

After this method has been invoked, the session participant is said to have joined the session.

Parameters:
participant - The SessionParticipant to join.
Throws:
SessionJoinDeniedException - if there is an application-specific reason why the participant is not allowed to join.
SessionJoinException - if there is an internal problem that occurs during the join.
java.lang.IllegalArgumentException - if participant is null

cleanUp

public void cleanUp()
Cleans up the session before it is made eligible for garbage collection.


countParticants

public int countParticants()
Returns the number of session participants that are currently joined to the session.

Returns:
number of participants.

getSettings

public SessionSettings getSettings()
Returns a SessionSettings object encapsulating the settings for this session.

Returns:
settings.

release

public void release(SessionParticipant participant)
             throws SessionReleaseException
Releases the specified session participant from the session.

After this method has been invoked, the session participant is said to have left the session. It must be responsible for no further interactions with the session. If the specified session participant is not currently a participant of this session then nothing happens.

Parameters:
participant - The SessionParticipant to release.
Throws:
SessionReleaseException - if there is an internal problem that occurs during the release.
java.lang.IllegalArgumentException - if participant is null