Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Extending Eclipse monitoring, profiling, and testing functions
Previous Page Home Next Page

Using Common Services APIs with Multiple Sessions

In environments such as web environments there may exist multiple sessions. The following are issues that should be considered in a multiple session environment.

Creation of EMF Resources

In a multiple session environment the resources used by the Common Services should not be shared across sessions. For this reason the org.eclipse.hyades.models.hierarchy.util.ISessionManager interface is provided that manages the resource set creation based on a session id. This interface provides the following API:

/**
* Creates a resource based on a unique identifier.
* @param sessionID a string that identifies a session
* @return a resource set based on a unique identifier
*/
public ResourceSet getResourceSet(String sessionID);

The getResourceSet API should be implemented and return a resource set based on a specific session id. Note the resource set that is returned should have the ability to create the various TPTP EMF resources such as TRCAgents, TRCNodes, TRCMonitors, TRCProcesses, Symptom Catalogs, and Correlations.

An instance of this manager should be passed to the common service via the context object as follows:

context.setProperty(ISessionManager.CONTEXT_SESSION_MANAGER, MySessionManager.getInstance());
context.setProperty(ISessionManager.CONTEXT_SESSION_ID, "MySessionID");

Notice that a singleton of an implementation of the ISessionManager is passed in. The function of this singleton is to manage the creation of the resource sets across multiple sessions. Also notice that a session id is passed in to the context object to identify the session that is currently being processed.

Locale

Each session may contain define a different locale. For example one session may process information in French while another session may process information in Chinese. The Locale for a specific session can be passed in via the context object. This is showed as follows:

context.setProperty(IImportHandler.CONTEXT_LOCALE, Locale.FRENCH);

Note that each service provides a property name that signifies the Locale. For example the import service defines the IImportHandler.CONTEXT_LOCALE property name, while the export service defines the IExportHandler.CONTEXT_LOCALE.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire