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

All Superinterfaces:
Disposable
All Known Implementing Classes:
DefaultSessionAdapter

public interface Session
extends Disposable

Represents a session.

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 dispose()
          Disposes the session including all dialogs and frees all allocated resources.
 Service getService(java.lang.Class service)
          Returns the implementation of a desired service registered at the session.
 SessionId getSessionId()
          Returns the id of this session within a session management managed by a SessionManager
 boolean hasService(java.lang.Class service)
          Tests whether this session offers a service.
 

Method Detail

getSessionId

public SessionId getSessionId()
Returns the id of this session within a session management managed by a SessionManager

Returns:
the id of this session within a session management

hasService

public boolean hasService(java.lang.Class service)
Tests whether this session offers a service.

Parameters:
service - the class of the service interface that is searched for
Returns:
true iff the service is available.
Throws:
java.lang.IllegalArgumentException - if the service class is not an interface that extends Service.

getService

public Service getService(java.lang.Class service)
Returns the implementation of a desired service registered at the session. The returned Object will implement the service interface.

Parameters:
service - the class of the service interface that is requested
Returns:
the object implementing the service that is registered at the specified node
Throws:
java.lang.IllegalArgumentException - iif the service class is not an interface that extends Service, or if the service is not available at the session

dispose

public void dispose()
             throws DisposeException
Disposes the session including all dialogs and frees all allocated resources.

Important:
This method is called by the SessionManager and must never be called directly. If you want to dispose the session, then call SessionManager.disposeSession(SessionId).

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 SessionManager.disposeSession(SessionId).

Specified by:
dispose in interface Disposable
Throws:
DisposeException - if there was one or more errors while disposing the session.
See Also:
Disposable.dispose()