Package com.tangosol.coherence.servlet
Class SessionHelperManager
java.lang.Object
com.tangosol.coherence.servlet.SessionHelperManager
This is a helper class for the SessionHelper. All methods are static.
- Author:
- James Kirsch
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static SessionHelpercreateSessionHelper(javax.servlet.ServletContext ctx) static SessionHelperensureSessionHelper(javax.servlet.ServletContext ctx) Find the existing (or create new) Coherence SessionHelper that will act as a coordinator to manage the creation and lookup of container objects, fake container objects (the Coherence implementation of the Servlet spec interfaces), and helper classes (such as the SessionHelper itself, the servlet model collection, etc.).static SessionHelperensureSessionHelper(javax.servlet.ServletContext ctx, boolean configureSessionHelper) Find the existing (or create new) Coherence SessionHelper that will act as a coordinator to manage the creation and lookup of container objects, fake container objects (the Coherence implementation of the Servlet spec interfaces), and helper classes (such as the SessionHelper itself, the servlet model collection, etc.).static javax.servlet.ServletContextensureWrappedServletContext(javax.servlet.ServletContext ctx) Make sure that there is a ServletContext wrapper for the specified servlet context for this application, creating one if necessary.static int[]getSupportedVersion(javax.servlet.ServletContext ctx) Determine the version of the spec to find the factory for based on the passed application server ServletContext object.static javax.servlet.ServletContextgetWrappedServletContext(javax.servlet.ServletContext ctx) Determine the ServletContext wrapper for the specified application server context.
-
Field Details
-
DEFAULT_FACTORY
The default class name for the SessionHelper factory implementation.- See Also:
-
CTX_ATTR_HELPER
The name of the application server context's attribute that Coherence stores its session helper object under.- See Also:
-
-
Constructor Details
-
SessionHelperManager
public SessionHelperManager()
-
-
Method Details
-
createSessionHelper
-
ensureSessionHelper
Find the existing (or create new) Coherence SessionHelper that will act as a coordinator to manage the creation and lookup of container objects, fake container objects (the Coherence implementation of the Servlet spec interfaces), and helper classes (such as the SessionHelper itself, the servlet model collection, etc.).- Parameters:
ctx- the application server's ServletContext object- Returns:
- the SessionHelper
-
ensureSessionHelper
public static SessionHelper ensureSessionHelper(javax.servlet.ServletContext ctx, boolean configureSessionHelper) Find the existing (or create new) Coherence SessionHelper that will act as a coordinator to manage the creation and lookup of container objects, fake container objects (the Coherence implementation of the Servlet spec interfaces), and helper classes (such as the SessionHelper itself, the servlet model collection, etc.).- Parameters:
ctx- the application server's ServletContext objectconfigureSessionHelper- if true, configure the new SessionHelper obj- Returns:
- the SessionHelper
-
getSupportedVersion
public static int[] getSupportedVersion(javax.servlet.ServletContext ctx) Determine the version of the spec to find the factory for based on the passed application server ServletContext object.Note: Hard-coded to support 2.3 through 2.5.
- Parameters:
ctx- the application server's ServletContext object- Returns:
- an array containing [0] major and [1] minor version of the servlet spec to find the factory for
-
getWrappedServletContext
public static javax.servlet.ServletContext getWrappedServletContext(javax.servlet.ServletContext ctx) Determine the ServletContext wrapper for the specified application server context. This method can also be used to determine if another application has a Coherence ServletContext wrapper.- Parameters:
ctx- a ServletContext- Returns:
- a ServletContext that wraps around the specified ServletContext or the passed ServletContext itself if it is a wrapper already or null if there is no wrapper
-
ensureWrappedServletContext
public static javax.servlet.ServletContext ensureWrappedServletContext(javax.servlet.ServletContext ctx) Make sure that there is a ServletContext wrapper for the specified servlet context for this application, creating one if necessary.- Parameters:
ctx- this application's ServletContext- Returns:
- a ServletContext that wraps around the specified ServletContext or the passed ServletContext itself if it is a wrapper already
-