Package org.jboss.weld.context.http
Class HttpConversationContextImpl
- java.lang.Object
-
- org.jboss.weld.context.AbstractContext
-
- org.jboss.weld.context.AbstractManagedContext
-
- org.jboss.weld.context.AbstractBoundContext<R>
-
- org.jboss.weld.context.AbstractConversationContext<javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpSession>
-
- org.jboss.weld.context.http.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
-
-
Field Summary
-
Fields inherited from class org.jboss.weld.context.AbstractConversationContext
CONVERSATIONS_ATTRIBUTE_NAME, DESTRUCTION_QUEUE_ATTRIBUTE_NAME
-
-
Constructor Summary
Constructors Constructor Description HttpConversationContextImpl(String contextId, org.jboss.weld.bootstrap.api.ServiceRegistry services)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected BoundBeanStorecreateRequestBeanStore(NamingScheme namingScheme, javax.servlet.http.HttpServletRequest request)protected BoundBeanStorecreateSessionBeanStore(NamingScheme namingScheme, javax.servlet.http.HttpSession session)protected StringgetNamingSchemePrefix()protected ObjectgetRequestAttribute(javax.servlet.http.HttpServletRequest request, String name)Retrieve an attribute value from the requestprotected ObjectgetSessionAttribute(javax.servlet.http.HttpServletRequest request, String name, boolean create)Get an attribute value from the session.protected ObjectgetSessionAttributeFromSession(javax.servlet.http.HttpSession session, String name)Get an attribute value from the session.protected Iterator<String>getSessionAttributeNames(javax.servlet.http.HttpSession session)protected javax.servlet.http.HttpSessiongetSessionFromRequest(javax.servlet.http.HttpServletRequest request, boolean create)protected voidremoveRequestAttribute(javax.servlet.http.HttpServletRequest request, String name)Remove an attribute from the request.protected voidsetRequestAttribute(javax.servlet.http.HttpServletRequest request, String name, Object value)Set an attribute in the request.protected voidsetSessionAttribute(javax.servlet.http.HttpServletRequest request, String name, Object value, boolean create)Set an attribute in the session.-
Methods inherited from class org.jboss.weld.context.AbstractConversationContext
activate, activate, associate, associateRequest, associateRequestWithNewConversation, conversationPromotedToLongRunning, copyConversationIdGeneratorAndConversationsToSession, deactivate, destroy, destroyConversation, dissociate, generateConversationId, getConcurrentAccessTimeout, getConversation, getConversationIdGenerator, getConversations, getCurrentConversation, getDefaultTimeout, getParameterName, getRequest, getScope, initialize, invalidate, isAssociated, sessionCreated, setConcurrentAccessTimeout, setDefaultTimeout, setParameterName
-
Methods inherited from class org.jboss.weld.context.AbstractBoundContext
cleanup, getBeanStore, setBeanStore
-
Methods inherited from class org.jboss.weld.context.AbstractManagedContext
isActive, isValid, removeState, setActive
-
Methods inherited from class org.jboss.weld.context.AbstractContext
checkContextInitialized, destroy, destroy, get, get, getContextual, getId, getServiceRegistry
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jboss.weld.context.ConversationContext
activate, activate, generateConversationId, getConcurrentAccessTimeout, getConversation, getConversations, getCurrentConversation, getDefaultTimeout, getParameterName, invalidate, setConcurrentAccessTimeout, setDefaultTimeout, setParameterName
-
-
-
-
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:AbstractConversationContextSet an attribute in the session.- Specified by:
setSessionAttributein classAbstractConversationContext<javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpSession>- Parameters:
request- the request to set the session attribute inname- the name of the attributevalue- the value of the attributecreate- 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:AbstractConversationContextGet an attribute value from the session.- Specified by:
getSessionAttributein classAbstractConversationContext<javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpSession>- Parameters:
request- the request to get the session attribute fromname- the name of the attributecreate- 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:AbstractConversationContextRemove an attribute from the request.- Specified by:
removeRequestAttributein classAbstractConversationContext<javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpSession>- Parameters:
request- the request to remove the attribute fromname- the name of the attribute
-
setRequestAttribute
protected void setRequestAttribute(javax.servlet.http.HttpServletRequest request, String name, Object value)Description copied from class:AbstractConversationContextSet an attribute in the request.- Specified by:
setRequestAttributein classAbstractConversationContext<javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpSession>- Parameters:
request- the request to set the attribute fromname- the name of the attributevalue- the value of the attribute
-
getRequestAttribute
protected Object getRequestAttribute(javax.servlet.http.HttpServletRequest request, String name)
Description copied from class:AbstractConversationContextRetrieve an attribute value from the request- Specified by:
getRequestAttributein classAbstractConversationContext<javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpSession>- Parameters:
request- the request to get the attribute fromname- the name of the attribute to get- Returns:
- the value of the attribute
-
createRequestBeanStore
protected BoundBeanStore createRequestBeanStore(NamingScheme namingScheme, javax.servlet.http.HttpServletRequest request)
- Specified by:
createRequestBeanStorein classAbstractConversationContext<javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpSession>
-
createSessionBeanStore
protected BoundBeanStore createSessionBeanStore(NamingScheme namingScheme, javax.servlet.http.HttpSession session)
- Specified by:
createSessionBeanStorein classAbstractConversationContext<javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpSession>
-
getSessionAttributeFromSession
protected Object getSessionAttributeFromSession(javax.servlet.http.HttpSession session, String name)
Description copied from class:AbstractConversationContextGet an attribute value from the session.- Specified by:
getSessionAttributeFromSessionin classAbstractConversationContext<javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpSession>- Parameters:
session- the session to get the session attribute fromname- the name of the attribute- Returns:
- attribute
-
getSessionFromRequest
protected javax.servlet.http.HttpSession getSessionFromRequest(javax.servlet.http.HttpServletRequest request, boolean create)- Specified by:
getSessionFromRequestin classAbstractConversationContext<javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpSession>
-
getNamingSchemePrefix
protected String getNamingSchemePrefix()
- Specified by:
getNamingSchemePrefixin classAbstractConversationContext<javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpSession>
-
getSessionAttributeNames
protected Iterator<String> getSessionAttributeNames(javax.servlet.http.HttpSession session)
- Specified by:
getSessionAttributeNamesin classAbstractConversationContext<javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpSession>
-
-