Class HttpConversationContextImpl

  • All Implemented Interfaces:
    javax.enterprise.context.spi.AlterableContext, javax.enterprise.context.spi.Context, org.jboss.weld.context.BoundContext<javax.servlet.http.HttpServletRequest>, org.jboss.weld.context.ConversationContext, org.jboss.weld.context.http.HttpConversationContext, org.jboss.weld.context.ManagedContext
    Direct Known Subclasses:
    LazyHttpConversationContextImpl

    public class HttpConversationContextImpl
    extends AbstractConversationContext<javax.servlet.http.HttpServletRequest,​javax.servlet.http.HttpSession>
    implements org.jboss.weld.context.http.HttpConversationContext
    • Constructor Detail

      • HttpConversationContextImpl

        public HttpConversationContextImpl​(String contextId,
                                           org.jboss.weld.bootstrap.api.ServiceRegistry services)
    • Method Detail

      • setSessionAttribute

        protected void setSessionAttribute​(javax.servlet.http.HttpServletRequest request,
                                           String name,
                                           Object value,
                                           boolean create)
        Description copied from class: AbstractConversationContext
        Set an attribute in the session.
        Specified by:
        setSessionAttribute in class AbstractConversationContext<javax.servlet.http.HttpServletRequest,​javax.servlet.http.HttpSession>
        Parameters:
        request - the request to set the session attribute in
        name - the name of the attribute
        value - the value of the attribute
        create - if false, the attribute will only be set if the session already exists, otherwise it will always be set
      • getSessionAttribute

        protected Object getSessionAttribute​(javax.servlet.http.HttpServletRequest request,
                                             String name,
                                             boolean create)
        Description copied from class: AbstractConversationContext
        Get an attribute value from the session.
        Specified by:
        getSessionAttribute in class AbstractConversationContext<javax.servlet.http.HttpServletRequest,​javax.servlet.http.HttpSession>
        Parameters:
        request - the request to get the session attribute from
        name - the name of the attribute
        create - if false, the attribute will only be retrieved if the session already exists, other wise it will always be retrieved
        Returns:
        attribute
      • removeRequestAttribute

        protected void removeRequestAttribute​(javax.servlet.http.HttpServletRequest request,
                                              String name)
        Description copied from class: AbstractConversationContext
        Remove an attribute from the request.
        Specified by:
        removeRequestAttribute in class AbstractConversationContext<javax.servlet.http.HttpServletRequest,​javax.servlet.http.HttpSession>
        Parameters:
        request - the request to remove the attribute from
        name - the name of the attribute
      • setRequestAttribute

        protected void setRequestAttribute​(javax.servlet.http.HttpServletRequest request,
                                           String name,
                                           Object value)
        Description copied from class: AbstractConversationContext
        Set an attribute in the request.
        Specified by:
        setRequestAttribute in class AbstractConversationContext<javax.servlet.http.HttpServletRequest,​javax.servlet.http.HttpSession>
        Parameters:
        request - the request to set the attribute from
        name - the name of the attribute
        value - the value of the attribute
      • getRequestAttribute

        protected Object getRequestAttribute​(javax.servlet.http.HttpServletRequest request,
                                             String name)
        Description copied from class: AbstractConversationContext
        Retrieve an attribute value from the request
        Specified by:
        getRequestAttribute in class AbstractConversationContext<javax.servlet.http.HttpServletRequest,​javax.servlet.http.HttpSession>
        Parameters:
        request - the request to get the attribute from
        name - the name of the attribute to get
        Returns:
        the value of the attribute
      • getSessionAttributeFromSession

        protected Object getSessionAttributeFromSession​(javax.servlet.http.HttpSession session,
                                                        String name)
        Description copied from class: AbstractConversationContext
        Get an attribute value from the session.
        Specified by:
        getSessionAttributeFromSession in class AbstractConversationContext<javax.servlet.http.HttpServletRequest,​javax.servlet.http.HttpSession>
        Parameters:
        session - the session to get the session attribute from
        name - the name of the attribute
        Returns:
        attribute
      • getSessionFromRequest

        protected javax.servlet.http.HttpSession getSessionFromRequest​(javax.servlet.http.HttpServletRequest request,
                                                                       boolean create)
        Specified by:
        getSessionFromRequest in class AbstractConversationContext<javax.servlet.http.HttpServletRequest,​javax.servlet.http.HttpSession>