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:
| Modifier and Type | Field and Description |
|---|---|
| private String | |
| protected AbstractSession | |
| private static volatile ServerPlatform | |
| private static final Object[] | |
| private static SessionLog | |
| protected static volatile SessionManager | |
| private static volatile ConcurrentMap | |
| protected ConcurrentMap | |
| protected static boolean | |
| protected static boolean | shouldUseSchemaValidation
Allow for usage of schema validation to be configurable. |
| private static volatile boolean |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addSession(Session
session to be added to the session manager session)INTERNAL: Add an named session to the hashtable. |
| public void | addSession(String
session name sessionName, Session session to be added to the session manager session)ADVANCED: add an named session to the hashtable. |
| public void | |
| private void | |
| public void | |
| public void | destroySession(String
name of the session to be destroyed sessionName)INTERNAL: Destroy the session defined by sessionName on this manager. |
| public static Collection | |
| public Session | |
| public synchronized SessionConfigs | Returns: parsed session configurationresource to load resourceName, ClassLoader ClassLoader used to load the resource objectClassLoader)INTERNAL: This method is to be used to load config objects for the Mapping Workbench only. |
| public synchronized SessionConfigs | Returns: parsed session configurationresource to load resourceName, ClassLoader ClassLoader used to load the resource objectClassLoader, boolean whether to validate the resource passed in validate)INTERNAL: This method is to be used to load config objects for the Mapping Workbench only. |
| public static SessionManager | Returns: the session manager for current contextPUBLIC: Return the session manager for current context. |
| private static String | |
| public AbstractSession | Returns: session with given session namesession name sessionName)PUBLIC: Return the session by name. |
| public AbstractSession | Returns: session with given session namesession name sessionName, boolean whether the session should be logged in shouldLoginSession)PUBLIC: Return the session by name. |
| public AbstractSession | Returns: session with given session namesession name sessionName, boolean whether the session should be logged in shouldLoginSession, boolean whether the session should be refreshed shouldRefreshSession)PUBLIC: Return the session by name. |
| public AbstractSession | Returns: session with given session namesession name sessionName, Object object to get the ClassLoader from objectBean)PUBLIC: Return the session by name, using the classloader of the Object specified. |
| public AbstractSession | Returns: session with given session namesession name sessionName, String file name containing session definition filename)PUBLIC: Return the session by name, in the file specified. |
| public AbstractSession | Returns: session with given session namesession name sessionName, String file name containing session definition filename, ClassLoader ClassLoader used to load the original session classLoader)PUBLIC: Return the session by name, in the file specified, using the class loader to find the resource. |
| public AbstractSession | Returns: session with given session namesession name sessionName, ClassLoader ClassLoader used to load the original session objectClassLoader)PUBLIC: Return the session by name. |
| public AbstractSession | Returns: session with given session nameXMLSessionConfigLoader containing session configurationsession name sessionName, ClassLoader ClassLoader used to load the original session objectClassLoader)PUBLIC: Return the session by name, loading the configuration from the file specified in the XMLSessionConfigLoader. |
| public AbstractSession | Returns: session with given session nameXMLSessionConfigLoader containing session configurationsession name sessionName, ClassLoader ClassLoader used to load the original session objectClassLoader, boolean whether the session should be logged in shouldLoginSession, boolean whether the session should be refreshed shouldRefreshSession)PUBLIC: Return the session by name, loading the configuration from the file specified in the loader. |
| public AbstractSession | Returns: session with given session nameXMLSessionConfigLoader containing session configurationsession name sessionName, ClassLoader ClassLoader used to load the original session objectClassLoader, boolean whether the session should be logged in shouldLoginSession, boolean whether the session should be refreshed shouldRefreshSession, boolean whether to compare class loaders used to load given session shouldCheckClassLoader)PUBLIC: Return the session by name, loading the configuration from the file specified in the loader. |
| public AbstractSession | Returns: session with given session nameXMLSessionConfigLoader containing session configurationPUBLIC: Return the session by name, loading the configuration from the file specified in the loader, using the loading options provided on the loader. |
| public ConcurrentMap | Returns: all sessions known by this session managerINTERNAL: Return a hashtable on all sessions. |
| private static void | |
| protected static SessionManager | Returns: initialized session managerINTERNAL: Initialize the singleton session manager. |
| private void | logAndThrowException(int level, RuntimeException exception)
INTERNAL: Log exceptions to the default log then throw them. |
| public void | |
| public static void | setManager(SessionManager
session manager for current context theManager)INTERNAL: Set the singleton session manager. |
| public void | setSessions(ConcurrentMap<String, Session>
sessions for this session manager sessions)INTERNAL: Set a hashtable of all sessions |
| public static void | setShouldUseSchemaValidation(boolean
true if schema validation should be used when parsing
the 10g (10.1.3) sessions XML, false otherwisePUBLIC: Set if schema validation will be used when parsing the 10g (10.1.3) sessions XML. |
| public static boolean | Returns: true if schema validation will be used when parsing
the 10g (10.1.3) sessions XML, false otherwisePUBLIC: Return if schema validation will be used when parsing the 10g (10.1.3) sessions XML. |
| context | back to summary |
|---|---|
| private String context | |
| defaultSession | back to summary |
|---|---|
| protected AbstractSession defaultSession | |
| detectedPlatform | back to summary |
|---|---|
| private static volatile ServerPlatform detectedPlatform | |
| lock | back to summary |
|---|---|
| private static final Object[] lock | |
| LOG | back to summary |
|---|---|
| private static SessionLog LOG | |
| manager | back to summary |
|---|---|
| protected static volatile SessionManager manager | |
| managers | back to summary |
|---|---|
| private static volatile ConcurrentMap<String, SessionManager> managers | |
| sessions | back to summary |
|---|---|
| protected ConcurrentMap<String, Session> sessions | |
| shouldPerformDTDValidation | back to summary |
|---|---|
| protected static boolean shouldPerformDTDValidation | |
| shouldUseSchemaValidation | back to summary |
|---|---|
| protected static boolean shouldUseSchemaValidation Allow for usage of schema validation to be configurable. | |
| supportPartitions | back to summary |
|---|---|
| private static volatile boolean supportPartitions | |
| SessionManager | back to summary |
|---|---|
| public SessionManager() PUBLIC: The default constructor to create a new session manager. | |
| addSession | back to summary |
|---|---|
| public void addSession(Session session) INTERNAL: Add an named session to the hashtable. Session must have a name prior to setting into session manager.
| |
| addSession | back to summary |
|---|---|
| public void addSession(String sessionName, Session session) ADVANCED: add an named session to the hashtable. | |
| destroy | back to summary |
|---|---|
| public void destroy() PUBLIC: Destroy current session manager instance. | |
| destroy | back to summary |
|---|---|
| private void destroy(Session session) | |
| destroyAllSessions | back to summary |
|---|---|
| public void destroyAllSessions() INTERNAL: Destroy all sessions held onto by this manager. | |
| destroySession | back to summary |
|---|---|
| public void destroySession(String sessionName) INTERNAL: Destroy the session defined by sessionName on this manager.
| |
| getAllManagers | back to summary |
|---|---|
| public static Collection ADVANCED: Return all session managers. This allows global access to all instances of SessionManager.
| |
| getDefaultSession | back to summary |
|---|---|
| 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.
| |
| getInternalMWConfigObjects | back to summary |
|---|---|
| public synchronized SessionConfigs getInternalMWConfigObjects(String resourceName, ClassLoader objectClassLoader) INTERNAL: This method is to be used to load config objects for the Mapping Workbench only. Do not call this method.
| |
| getInternalMWConfigObjects | back to summary |
|---|---|
| public synchronized SessionConfigs getInternalMWConfigObjects(String resourceName, ClassLoader objectClassLoader, boolean validate) INTERNAL: This method is to be used to load config objects for the Mapping Workbench only. Do not call this method.
| |
| getManager | back to summary |
|---|---|
| public static SessionManager getManager() PUBLIC: Return the session manager for current context. This allow global access to a set of named sessions.
| |
| getPartitionID | back to summary |
|---|---|
| private static String getPartitionID() | |
| getSession | back to summary |
|---|---|
| public AbstractSession getSession(String sessionName) PUBLIC: Return the session by name.
| |
| getSession | back to summary |
|---|---|
| public AbstractSession getSession(String sessionName, boolean shouldLoginSession) PUBLIC: Return the session by name. Log the session in only if specified.
| |
| getSession | back to summary |
|---|---|
| public AbstractSession getSession(String sessionName, boolean shouldLoginSession, boolean shouldRefreshSession) PUBLIC: Return the session by name. Log the session in only if specified. Refresh the session only if specified.
| |
| getSession | back to summary |
|---|---|
| public AbstractSession getSession(String sessionName, 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 | back to summary |
|---|---|
| public AbstractSession getSession(String sessionName, String filename) PUBLIC: Return the session by name, in the file specified. Login the session.
| |
| getSession | back to summary |
|---|---|
| public AbstractSession getSession(String sessionName, String filename, ClassLoader classLoader) PUBLIC: Return the session by name, in the file specified, using the class loader to find the resource. This method will cause the class loader to be compared with the classloader used to load the original session of this name. If they are not the same then the session will be refreshed.
| |
| getSession | back to summary |
|---|---|
| public AbstractSession getSession(String sessionName, 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. If they are not the same then the session will be refreshed.
| |
| getSession | back to summary |
|---|---|
| public AbstractSession getSession(XMLSessionConfigLoader loader, String sessionName, 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. If they are not the same then the session will be refreshed.
| |
| getSession | back to summary |
|---|---|
| public AbstractSession getSession(XMLSessionConfigLoader loader, String sessionName, ClassLoader objectClassLoader, boolean shouldLoginSession, boolean shouldRefreshSession) PUBLIC: Return the session by name, loading the configuration from the file specified in the loader. 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 | back to summary |
|---|---|
| public AbstractSession getSession(XMLSessionConfigLoader loader, String sessionName, ClassLoader objectClassLoader, boolean shouldLoginSession, boolean shouldRefreshSession, boolean shouldCheckClassLoader) PUBLIC: Return the session by name, loading the configuration from the file specified in the loader. 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. Pass true for shouldCheckClassLoader will cause the class loader to be compared with the classloader used to load the original session of this name. If they are not the same then the session will be refreshed, this can be used for re-deployment.
| |
| getSession | back to summary |
|---|---|
| public AbstractSession getSession(XMLSessionConfigLoader loader) PUBLIC: Return the session by name, loading the configuration from the file specified in the loader, using the loading options provided on the loader.
| |
| getSessions | back to summary |
|---|---|
| public ConcurrentMap INTERNAL: Return a hashtable on all sessions.
| |
| init | back to summary |
|---|---|
| private static void init() | |
| initializeManager | back to summary |
|---|---|
| protected static SessionManager initializeManager() INTERNAL: Initialize the singleton session manager.
| |
| logAndThrowException | back to summary |
|---|---|
| private void logAndThrowException(int level, RuntimeException exception) throws RuntimeException INTERNAL: Log exceptions to the default log then throw them. | |
| setDefaultSession | back to summary |
|---|---|
| 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.
| |
| setManager | back to summary |
|---|---|
| public static void setManager(SessionManager theManager) INTERNAL: Set the singleton session manager. This allows global access to a set of named sessions.
| |
| setSessions | back to summary |
|---|---|
| public void setSessions(ConcurrentMap<String, Session> sessions) INTERNAL: Set a hashtable of all sessions
| |
| setShouldUseSchemaValidation | back to summary |
|---|---|
| public static void setShouldUseSchemaValidation(boolean useSchemaValidation) 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.
| |
| shouldUseSchemaValidation | back to summary |
|---|---|
| public static boolean shouldUseSchemaValidation() PUBLIC: Return if schema validation will be used when parsing the 10g (10.1.3) sessions XML.
| |