com.sdm.quasar.client.core.application
Interface SessionManager

All Known Implementing Classes:
AbstractSessionManager, DefaultJSFSessionManager

public interface SessionManager

Manages the Sessions within an Application.

Implementations of this interface should be threadsafe.

Version:
1.0
Author:
Martin Haft, sd&m AG, Carsten Lucke, sd&m AG, Bernd Olleck, sd&m AG

Method Summary
 void addSessionListener(SessionListener listener)
          Registers an observer that is notified when sessions are created and disposed.
 Session createSession()
          Creates and initializes a session object.
 void disposeSession(SessionId sessionId)
          Disposes a session.
 void removeSessionListener(SessionListener listener)
          Unregisters an observer.
 

Method Detail

createSession

public Session createSession()
Creates and initializes a session object. If the session identity depends on other circumstances (e.g. a web-based session), the session manager may return an existing session object.

Returns:
the session object.

disposeSession

public void disposeSession(SessionId sessionId)
                    throws DisposeException
Disposes a session.

The implementation should call Session.dispose().

The call to this method is irrevokable. If you want to allow for user interaction or server calls before the session or its dialogs are disposed, you should do so before calling.

Note: The implementation must not return before the session is disposed. Any threads or asynchronous calls started must be completed before this method returns.

Parameters:
sessionId - the id of the session to be disposed
Throws:
DisposeException - if there is an error while disposing the session
java.lang.IllegalArgumentException - if the session id is unknown

addSessionListener

public void addSessionListener(SessionListener listener)
Registers an observer that is notified when sessions are created and disposed.

Parameters:
listener - the listener to be added

removeSessionListener

public void removeSessionListener(SessionListener listener)
Unregisters an observer.

Parameters:
listener - the listener to be removed