Class DefaultFactory

  • All Implemented Interfaces:
    SessionHelperFactory

    public class DefaultFactory
    extends Base
    implements SessionHelperFactory
    The Coherence session management Factory for the Servlet 2.3 specification.
    Version:
    Coherence 2.3
    Author:
    cp 2003.07.22
    • Constructor Detail

      • DefaultFactory

        public DefaultFactory()
        Default constructor.
    • Method Detail

      • instantiateSessionHelper

        public SessionHelper instantiateSessionHelper​(javax.servlet.ServletContext ctx)
        Given an application server's ServletContext object, initialize the factory and create the SessionHelper object. This is the bootstrap, and will be called exactly once.
        Specified by:
        instantiateSessionHelper in interface SessionHelperFactory
        Parameters:
        ctx - an application server ServletContext object
        Returns:
        the SessionHelper object that the factory will work for
      • instantiateServletContext

        public javax.servlet.ServletContext instantiateServletContext()
        Create a ServletContext wrapper implementation.
        Specified by:
        instantiateServletContext in interface SessionHelperFactory
        Returns:
        a ServletContext object to provide to the application
      • instantiateHttpSessionContext

        public javax.servlet.http.HttpSessionContext instantiateHttpSessionContext()
        Create an HttpSessionContext implementation.
        Specified by:
        instantiateHttpSessionContext in interface SessionHelperFactory
        Returns:
        an HttpSessionContext object to provide to the application
      • instantiateFilterConfig

        public javax.servlet.FilterConfig instantiateFilterConfig​(javax.servlet.FilterConfig cfg)
        Given an application server's FilterConfig object, create a wrapper.
        Specified by:
        instantiateFilterConfig in interface SessionHelperFactory
        Parameters:
        cfg - an application server FilterConfig object
        Returns:
        the FilterConfig object to provide to the application
      • instantiateServletConfig

        public javax.servlet.ServletConfig instantiateServletConfig​(javax.servlet.ServletConfig cfg)
        Given an application server's ServletConfig object, create a wrapper.
        Specified by:
        instantiateServletConfig in interface SessionHelperFactory
        Parameters:
        cfg - an application server ServletConfig object
        Returns:
        the ServletConfig object to provide to the application
      • instantiateHttpServletRequest

        public javax.servlet.http.HttpServletRequest instantiateHttpServletRequest​(javax.servlet.http.HttpServletRequest req,
                                                                                   javax.servlet.http.HttpServletResponse res,
                                                                                   String sSessionId,
                                                                                   boolean fCookie,
                                                                                   boolean fUrl)
        Create an HttpServletRequest wrapper.
        Specified by:
        instantiateHttpServletRequest in interface SessionHelperFactory
        Parameters:
        req - the app server's request object
        res - the app server's response object
        sSessionId - the session ID (if any) that came with the request
        fCookie - if the session ID came from a cookie
        fUrl - if the session ID came from the url
        Returns:
        an HttpServletRequest object to provide to the application
      • instantiateHttpServletResponse

        public javax.servlet.http.HttpServletResponse instantiateHttpServletResponse​(javax.servlet.http.HttpServletRequest req,
                                                                                     javax.servlet.http.HttpServletResponse res)
        Create an HttpServletResponse wrapper.
        Specified by:
        instantiateHttpServletResponse in interface SessionHelperFactory
        Parameters:
        req - the wrapped request object
        res - the app server's response object
        Returns:
        an HttpServletResponse object to provide to the application
      • instantiateHttpSession

        public javax.servlet.http.HttpSession instantiateHttpSession​(HttpSessionCollection collection)
        Create a new HttpSession object.
        Specified by:
        instantiateHttpSession in interface SessionHelperFactory
        Parameters:
        collection - the HttpSessionCollection that manages the session models
        Returns:
        an HttpSession object
      • instantiateHttpSession

        public javax.servlet.http.HttpSession instantiateHttpSession​(HttpSessionCollection collection,
                                                                     String sId)
        Create an HttpSession object for an existing session ID.
        Specified by:
        instantiateHttpSession in interface SessionHelperFactory
        Parameters:
        collection - the HttpSessionCollection that manages the session models
        sId - the session ID
        Returns:
        an HttpSession object
      • toString

        public String toString()
        Returns a string representation of the object.
        Overrides:
        toString in class Object
        Returns:
        a string representation of the object
      • getDescription

        protected String getDescription()
        Returns a string representation of this object's attributes.
        Returns:
        a string representation of this object's attributes
      • getSessionHelper

        protected SessionHelper getSessionHelper()
        Get the SessionHelper created by and used by the factory.
        Returns:
        the SessionHelper for this factory
      • setSessionHelper

        protected void setSessionHelper​(SessionHelper helper)
        Set the SessionHelper that is to be used by the factory.
        Parameters:
        helper - the SessionHelper for this factory
      • getServletContext

        protected javax.servlet.ServletContext getServletContext()
        Get the original application server's ServletContext.
        Returns:
        the wrapped ServletContext
      • setServletContext

        protected void setServletContext​(javax.servlet.ServletContext ctx)
        Set the original application server's ServletContext.
        Parameters:
        ctx - the wrapped ServletContext