Package com.tangosol.coherence.servlet
Class SessionHelperManager
- java.lang.Object
-
- com.tangosol.coherence.servlet.SessionHelperManager
-
public class SessionHelperManager extends Object
This is a helper class for the SessionHelper. All methods are static.- Author:
- James Kirsch
-
-
Field Summary
Fields Modifier and Type Field Description static String
CTX_ATTR_HELPER
The name of the application server context's attribute that Coherence stores its session helper object under.static String
DEFAULT_FACTORY
The default class name for the SessionHelper factory implementation.
-
Constructor Summary
Constructors Constructor Description SessionHelperManager()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static SessionHelper
createSessionHelper(javax.servlet.ServletContext ctx)
static SessionHelper
ensureSessionHelper(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 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.).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.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.ServletContext
getWrappedServletContext(javax.servlet.ServletContext ctx)
Determine the ServletContext wrapper for the specified application server context.
-
-
-
Field Detail
-
DEFAULT_FACTORY
public static final String DEFAULT_FACTORY
The default class name for the SessionHelper factory implementation.- See Also:
- Constant Field Values
-
CTX_ATTR_HELPER
public static final String CTX_ATTR_HELPER
The name of the application server context's attribute that Coherence stores its session helper object under.- See Also:
- Constant Field Values
-
-
Method Detail
-
createSessionHelper
protected static SessionHelper createSessionHelper(javax.servlet.ServletContext ctx)
-
ensureSessionHelper
public static SessionHelper ensureSessionHelper(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.).- 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
-
-