com.sdm.quasar.client.core.application
Class DefaultSessionManager

java.lang.Object
  extended bycom.sdm.quasar.client.core.application.AbstractSessionManager
      extended bycom.sdm.quasar.client.core.application.DefaultSessionManager
All Implemented Interfaces:
Disposable, SessionManager, SystemInfoProvider

public class DefaultSessionManager
extends AbstractSessionManager
implements SystemInfoProvider

The default implementation of a SessionManager for a swing client. This implementation is designed to create only one session.

Version:
1.0
Author:
Bernd Olleck, sd&m AG

Field Summary
protected static SessionId SESSION_ID
          The session id used for the one existing session.
 
Fields inherited from class com.sdm.quasar.client.core.application.AbstractSessionManager
listeners
 
Constructor Summary
DefaultSessionManager(Application application, SessionCreator sessionCreator)
          Constructor.
 
Method Summary
 void collectSystemInfo(SystemInfoNode root, SystemInfoOptions options)
          Builds the system information tree upon local information of the implementor.
 Session createSession()
          If the session is already created, it is returned.
 void disposeSession(SessionId sessionId)
          Disposes a session.
 boolean isStopApplicationAfterLastSession()
          Returns true iff the application will be disposed after the last session has been disposed.
 void setStopApplicationAfterLastSession(boolean stopApplicationAfterLastSession)
          Sets whether the application will be disposed after the last session has been disposed.
 
Methods inherited from class com.sdm.quasar.client.core.application.AbstractSessionManager
addSessionListener, createSessionInstance, dispose, fireSessionCreated, fireSessionWillBeDisposed, getApplication, getRegisteredSession, getRegisteredSessionCount, hasRegisteredSession, registerSession, removeSessionListener, unregisterSession
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SESSION_ID

protected static final SessionId SESSION_ID
The session id used for the one existing session.

Constructor Detail

DefaultSessionManager

public DefaultSessionManager(Application application,
                             SessionCreator sessionCreator)
Constructor.

See Also:
AbstractSessionManager.AbstractSessionManager(Application, SessionCreator)
Method Detail

createSession

public Session createSession()
If the session is already created, it is returned. Otherwise the session is created.

Specified by:
createSession in interface SessionManager
Specified by:
createSession in class AbstractSessionManager
Returns:
the one session that is managed by this session manager
See Also:
SessionManager.createSession(), AbstractSessionManager

disposeSession

public void disposeSession(SessionId sessionId)
                    throws DisposeException
Description copied from interface: SessionManager
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.

Specified by:
disposeSession in interface SessionManager
Specified by:
disposeSession in class AbstractSessionManager
Throws:
DisposeException
See Also:
SessionManager.disposeSession(com.sdm.quasar.client.core.application.SessionId)

isStopApplicationAfterLastSession

public boolean isStopApplicationAfterLastSession()
Returns true iff the application will be disposed after the last session has been disposed.

Returns:
true iff the application will be disposed after the last session has been disposed.

setStopApplicationAfterLastSession

public void setStopApplicationAfterLastSession(boolean stopApplicationAfterLastSession)
Sets whether the application will be disposed after the last session has been disposed.

Parameters:
stopApplicationAfterLastSession - if true, the application will be disposed after the last session has been disposed.

collectSystemInfo

public void collectSystemInfo(SystemInfoNode root,
                              SystemInfoOptions options)
Description copied from interface: SystemInfoProvider
Builds the system information tree upon local information of the implementor. The system information tree can be used within development by inspecting the system; so implementors should append their internal state (depending on the details settings within SystemInfoOptions). The information can be appended to the tree by adding new child SystemInformationNodes to the root node given using the SystemInfoNode.createChild(String) method and by setting information attributes the these nodes or the given root node.

Specified by:
collectSystemInfo in interface SystemInfoProvider
Parameters:
root - the SystemInfoNode to add information to (guaranteed to be not null)
options - contains additional options, that might influence the amount of information added to the tree (guaranteed to be not null)
See Also:
SystemInfoProvider.collectSystemInfo(com.sdm.quasar.client.core.common.sysinfo.SystemInfoNode, com.sdm.quasar.client.core.common.sysinfo.SystemInfoOptions)