TPTP 4.1.0 Platform Project
Public API Specification

org.eclipse.hyades.execution.local
Class SessionContextToSessionMap

java.lang.Object
  extended byorg.eclipse.hyades.execution.local.SessionContextToSessionMap

public final class SessionContextToSessionMap
extends java.lang.Object

This singleton caches sessions keyed on on a session context object. There are operational static methods that are kept for compatability purposes only and are now deprecated to be removed in the future. One static method to retrieve the singleton instance will be maintained in future versions per the singleton design pattern. This singleton is thread-safe whether used via the singleton exposed session cache access methods or the deprecated class session cache access methods. The deprecated class session cache access methods simply forward the calls on to their synchronized singleton exposed session cache access methods.


Method Summary
static void addSession(SessionContext context, ISession session)
          Deprecated. use the public instance methods instead of the public class methods
 void addSessionEntry(SessionContext context, ISession session)
          Adds an entry in the map using the context as the key and the session as the value.
static SessionContextToSessionMap getInstance()
          Provides access to the singleton instance of this class
static ISession getSession(SessionContext context)
          Deprecated. use the public instance methods instead of the public class methods
 ISession getSessionEntry(SessionContext context)
          Gets a session entry given the session context, the session context is used as the key in finding the session object.
static boolean removeSession(ISession session)
          Deprecated. use the public instance methods instead of the public class methods
static void removeSession(SessionContext context)
          Deprecated. use the public instance methods instead of the public class methodsf
 boolean removeSessionEntry(ISession session)
          Remove the session from the map given the session object
 void removeSessionEntry(SessionContext context)
          Remove the session from the map given the specified context
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addSession

public static void addSession(SessionContext context,
                              ISession session)
Deprecated. use the public instance methods instead of the public class methods

Adds the given session using the specified context as the key

Parameters:
context - the key used for later retrieval of the session
session - the session to be associated with the provided session context

getInstance

public static SessionContextToSessionMap getInstance()
Provides access to the singleton instance of this class

Returns:
the singleton instance is returned

getSession

public static ISession getSession(SessionContext context)
Deprecated. use the public instance methods instead of the public class methods

Returns the session associated with the given context as stored in the internal cache

Parameters:
context - the context that is the key for the session
Returns:
the session mapped to the session context provided

removeSession

public static boolean removeSession(ISession session)
Deprecated. use the public instance methods instead of the public class methods

Removes the specified session from the internal cache

Parameters:
session - the session to remove
Returns:
true if it was successfully removed

removeSession

public static void removeSession(SessionContext context)
Deprecated. use the public instance methods instead of the public class methodsf

Remove the session associated with the specified session context

Parameters:
context - the context which is the key in identifying the session to remove

addSessionEntry

public void addSessionEntry(SessionContext context,
                            ISession session)
Adds an entry in the map using the context as the key and the session as the value.

Parameters:
context - the key in the map for this entry
session - the session in the map for this entry

getSessionEntry

public ISession getSessionEntry(SessionContext context)
Gets a session entry given the session context, the session context is used as the key in finding the session object.

Parameters:
context - the key to retrieve the session
Returns:
the session associated with the given context

removeSessionEntry

public boolean removeSessionEntry(ISession session)
Remove the session from the map given the session object

Parameters:
session - the session to remove from the cache
Returns:
indicates whether the session was removed

removeSessionEntry

public void removeSessionEntry(SessionContext context)
Remove the session from the map given the specified context

Parameters:
context - the key used to identify the session to remove

TPTP 4.1.0 Platform Project
Public API Specification