com.sdm.quasar.client.core.application.dialog.impl
Class DefaultSessionAdapter

java.lang.Object
  extended bycom.sdm.quasar.client.core.application.dialog.impl.DefaultSessionAdapter
All Implemented Interfaces:
Disposable, Session

public class DefaultSessionAdapter
extends java.lang.Object
implements Session

Version:
1.0
Author:
Thomas Wolf

Constructor Summary
DefaultSessionAdapter(SessionId sessionId, DialogInstanceId dialogInstanceId, DialogServiceManager dialogServiceManager, DisposeCallback disposeCallback)
          Creates a new DefaultSessionAdapter.
 
Method Summary
 void dispose()
          Disposes the session including all dialogs and frees all allocated resources.
protected  ID getId()
           
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultSessionAdapter

public DefaultSessionAdapter(SessionId sessionId,
                             DialogInstanceId dialogInstanceId,
                             DialogServiceManager dialogServiceManager,
                             DisposeCallback disposeCallback)
Creates a new DefaultSessionAdapter.

Parameters:
dialogInstanceId - the dialog instance id for the session
dialogServiceManager - to access services
disposeCallback - a DisposeCallback called when session is disposed
Method Detail

getSessionId

public SessionId getSessionId()
Description copied from interface: Session
Returns the id of this session within a session management managed by a SessionManager

Specified by:
getSessionId in interface Session
Returns:
the id of this session within a session management
See Also:
Session.getSessionId()

hasService

public boolean hasService(java.lang.Class service)
Description copied from interface: Session
Tests whether this session offers a service.

Specified by:
hasService in interface Session
Parameters:
service - the class of the service interface that is searched for
Returns:
true iff the service is available.

getService

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

Specified by:
getService in interface Session
Parameters:
service - the class of the service interface that is requested
Returns:
the object implementing the service that is registered at the specified node

getId

protected ID getId()

dispose

public void dispose()
             throws DisposeException
Description copied from interface: Session
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 Session
Throws:
DisposeException - if there was one or more errors while disposing the session.
See Also:
Session.dispose()