Skip navigation links

Oracle TopLink Java API Reference
10g Release 3 (10.1.3.1)

B28219-01


oracle.toplink.tools.sessionmanagement
Class SessionManager

java.lang.Object
  extended byoracle.toplink.tools.sessionmanagement.SessionManager


public class SessionManager
extends java.lang.Object

Purpose: Global session location.

Description: This allows for a global session local which can be accessed globally from other classes. This is needed for EJB data stores as they must have a globally accessible place to access the session. This can be by EJB session beans, BMP beans and CMP beans as well as Servlets and other three-tier services.

Responsibilities:

Since:
TOPLink/Java 3.0

Constructor Summary
SessionManager()
          PUBLIC: The default constructor to create a new session manager.

 

Method Summary
 void addSession(java.lang.String sessionName, Session session)
          ADVANCED: add an named session to the hashtable.
 Session getDefaultSession()
          PUBLIC: Return the default session.
static SessionManager getManager()
          PUBLIC: Return the singleton session manager.
 Session getSession(java.lang.String sessionName)
          PUBLIC: Return the session by name.
 Session getSession(java.lang.String sessionName, boolean shouldLoginSession)
          PUBLIC: Return the session by name.
 Session getSession(java.lang.String sessionName, boolean shouldLoginSession, boolean shouldRefreshSession)
          PUBLIC: Return the session by name.
 Session getSession(java.lang.String sessionName, java.lang.ClassLoader objectClassLoader)
          PUBLIC: Return the session by name.
 Session getSession(java.lang.String sessionName, java.lang.Object objectBean)
          PUBLIC: Return the session by name, using the classloader of the Object specified.
 Session getSession(java.lang.String sessionName, java.lang.String filename)
          PUBLIC: Return the session by name, in the file specified.
 Session getSession(XMLLoader xmlLoader, java.lang.String sessionName, java.lang.ClassLoader objectClassLoader)
          Deprecated. since OracleAS TopLink 10g (10.1.3). Replaced by getSession(XMLSessionConfigLoader, String, ClassLoader)
 Session getSession(XMLLoader xmlLoader, java.lang.String sessionName, java.lang.ClassLoader objectClassLoader, boolean shouldLoginSession, boolean shouldRefreshSession)
          Deprecated. since OracleAS TopLink 10g (10.1.3). Replaced by getSession(XMLSessionConfigLoader, String, ClassLoader, boolean, boolean)
 Session getSession(XMLSessionConfigLoader loader, java.lang.String sessionName, java.lang.ClassLoader objectClassLoader)
          PUBLIC: Return the session by name, loading the configuration from the file specified in the XMLSessionConfigLoader.
 Session getSession(XMLSessionConfigLoader xmlSessionConfigLoader, java.lang.String sessionName, java.lang.ClassLoader objectClassLoader, boolean shouldLoginSession, boolean shouldRefreshSession)
          PUBLIC: Return the session by name, loading the configuration from the file specified in the xmlLoader.
 Session getSession(XMLSessionConfigLoader xmlSessionConfigLoader, java.lang.String sessionName, java.lang.ClassLoader objectClassLoader, boolean shouldLoginSession, boolean shouldRefreshSession, boolean shouldCheckClassLoader)
          PUBLIC: Return the session by name, loading the configuration from the file specified in the xmlLoader.
 void setDefaultSession(Session defaultSession)
          PUBLIC: Set the default session.
static void setShouldPerformDTDValidation(boolean shouldPerformDTDValidation0)
          Deprecated. since OracleAS TopLink 10g (10.1.3). Replaced by setShouldUseSchemaValidation(boolean)
static void setShouldUseSchemaValidation(boolean value)
          PUBLIC: Set if schema validation will be used when parsing the 10g (10.1.3) sessions XML.
static boolean shouldPerformDTDValidation()
          Deprecated. since OracleAS TopLink 10g (10.1.3). Replaced by shouldUseSchemaValidation()
static boolean shouldUseSchemaValidation()
          PUBLIC: Return if schema validation will be used when parsing the 10g (10.1.3) sessions XML.

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

SessionManager

public SessionManager()
PUBLIC: The default constructor to create a new session manager.

Method Detail

shouldUseSchemaValidation

public static boolean shouldUseSchemaValidation()
PUBLIC: Return if schema validation will be used when parsing the 10g (10.1.3) sessions XML.

setShouldUseSchemaValidation

public static void setShouldUseSchemaValidation(boolean value)
PUBLIC: Set if schema validation will be used when parsing the 10g (10.1.3) sessions XML. By default schema validation is on, but can be turned off if validation problems occur, or to improve parsing performance.

addSession

public void addSession(java.lang.String sessionName,
                       Session session)
ADVANCED: add an named session to the hashtable.

getDefaultSession

public Session getDefaultSession()
PUBLIC: Return the default session. The session configuration is stored in a sessions.xml file in a directory on your classpath. Other sessions are supported through the getSession by name API.

getManager

public static SessionManager getManager()
PUBLIC: Return the singleton session manager. This allow global access to a set of named sessions.

getSession

public Session getSession(java.lang.String sessionName)
PUBLIC: Return the session by name. Use the classLoader that loaded the SessionManager.

getSession

public Session getSession(java.lang.String sessionName,
                          boolean shouldLoginSession)
PUBLIC: Return the session by name. Use the classLoader that loaded the SessionManager. Log the session in only if the user specifies to.

getSession

public Session getSession(java.lang.String sessionName,
                          boolean shouldLoginSession,
                          boolean shouldRefreshSession)
PUBLIC: Return the session by name. Use the classLoader that loaded the SessionManager. Log the session in only if the user specifies to. Refresh the session only if the user specifies to.

getSession

public Session getSession(java.lang.String sessionName,
                          java.lang.Object objectBean)
PUBLIC: Return the session by name, using the classloader of the Object specified. This method is used in older versions of BMP support This method will cause the class loader of the provided object to be compared with the classloader used to load the original session of this name, with this classloader. If they are not the same then the session will be refreshed.

getSession

public Session getSession(java.lang.String sessionName,
                          java.lang.String filename)
PUBLIC: Return the session by name, in the file specified. Use the classLoader that loaded the SessionManager and log in the session

getSession

public Session getSession(java.lang.String sessionName,
                          java.lang.ClassLoader objectClassLoader)
PUBLIC: Return the session by name. Provide the class loader for loading the project, the configuration file and the deployed classes. E.g. SessionManager.getManager().getSession("mySession", MySessionBean.getClassLoader()); This method will cause the class loader to be compared with the classloader used to load the original session of this name, with this classloader. If they are not the same then the session will be refreshed.

getSession

public Session getSession(XMLLoader xmlLoader,
                          java.lang.String sessionName,
                          java.lang.ClassLoader objectClassLoader)
Deprecated. since OracleAS TopLink 10g (10.1.3). Replaced by getSession(XMLSessionConfigLoader, String, ClassLoader)
PUBLIC: Return the session by name, loading the configuration from the file specified in the xmlLoader. Provide the class loader for loading the project, the configuration file and the deployed classes. If the no sessions.xml file is found in the classpath then an attempt is made to load the TOPLink.properties.

getSession

public Session getSession(XMLSessionConfigLoader loader,
                          java.lang.String sessionName,
                          java.lang.ClassLoader objectClassLoader)
PUBLIC: Return the session by name, loading the configuration from the file specified in the XMLSessionConfigLoader. Provide the class loader for loading the project, the configuration file and the deployed classes. This method will cause the class loader to be compared with the classloader used to load the original session of this name, with this classloader. If they are not the same then the session will be refreshed.

getSession

public Session getSession(XMLLoader xmlLoader,
                          java.lang.String sessionName,
                          java.lang.ClassLoader objectClassLoader,
                          boolean shouldLoginSession,
                          boolean shouldRefreshSession)
Deprecated. since OracleAS TopLink 10g (10.1.3). Replaced by getSession(XMLSessionConfigLoader, String, ClassLoader, boolean, boolean)
PUBLIC: Return the session by name, loading the configuration from the file specified in the xmlLoader. Provide the class loader for loading the project, the configuration file and the deployed classes. Pass in true for shouldLoginSession if the session returned should be logged in before returned otherwise false. Pass in true for shouldRefreshSession if the xmlLoader should reparse the configuration file for new sessions. False, will cause the XMLLoader not to parse the file again.

getSession

public Session getSession(XMLSessionConfigLoader xmlSessionConfigLoader,
                          java.lang.String sessionName,
                          java.lang.ClassLoader objectClassLoader,
                          boolean shouldLoginSession,
                          boolean shouldRefreshSession)
PUBLIC: Return the session by name, loading the configuration from the file specified in the xmlLoader. Provide the class loader for loading the project, the configuration file and the deployed classes. Pass in true for shouldLoginSession if the session returned should be logged in before returned otherwise false. Pass in true for shouldRefreshSession if the XMLSessionConfigLoader should reparse the configuration file for new sessions. False, will cause the XMLSessionConfigLoader not to parse the file again.

getSession

public Session getSession(XMLSessionConfigLoader xmlSessionConfigLoader,
                          java.lang.String sessionName,
                          java.lang.ClassLoader objectClassLoader,
                          boolean shouldLoginSession,
                          boolean shouldRefreshSession,
                          boolean shouldCheckClassLoader)
PUBLIC: Return the session by name, loading the configuration from the file specified in the xmlLoader. Provide the class loader for loading the project, the configuration file and the deployed classes. Pass in true for shouldLoginSession if the session returned should be logged in before returned otherwise false. Pass in true for shouldRefreshSession if the XMLSessionConfigLoader should reparse the configuration file for new sessions. False, will cause the XMLSessionConfigLoader not to parse the file again. This method will cause the class loader to be compared with the classloader used to load the original session of this name, with this classloader. If they are not the same then the session will be refreshed.

setDefaultSession

public void setDefaultSession(Session defaultSession)
PUBLIC: Set the default session. If not set the session configuration is stored in a sessions.xml file in a TopLink directory on your classpath. Other sessions are supported through the getSession by name API.

shouldPerformDTDValidation

public static boolean shouldPerformDTDValidation()
Deprecated. since OracleAS TopLink 10g (10.1.3). Replaced by shouldUseSchemaValidation()
PUBLIC: Get the shouldPerformDTDValidation flag.

setShouldPerformDTDValidation

public static void setShouldPerformDTDValidation(boolean shouldPerformDTDValidation0)
Deprecated. since OracleAS TopLink 10g (10.1.3). Replaced by setShouldUseSchemaValidation(boolean)
PUBLIC: Set the shouldPerformDTDValidation flag.

Skip navigation links

Copyright © 1998, 2006, Oracle. All Rights Reserved.