public class LazyHttpConversationContextImpl extends HttpConversationContextImpl
HttpConversationContext
that is capable of lazy initialization. By default, the context is associated with a request and the active flag
is set to true in the beginning of the request processing but the context is not initialized (cid not read and the state not restored) until the conversation context is first
accessed. As a result, BusyConversationException
or NonexistentConversationException
may be thrown late in the request processing and any component invoking
methods on ConversationScoped
beans should be ready to catch these exceptions.
Lazy initialization is mostly a workaround for https://issues.jboss.org/browse/CDI-411.CONVERSATIONS_ATTRIBUTE_NAME
Constructor and Description |
---|
LazyHttpConversationContextImpl(String contextId,
BeanIdentifierIndex beanIdentifierIndex) |
Modifier and Type | Method and Description |
---|---|
void |
activate() |
protected void |
checkContextInitialized()
Allows contexts that are initialized lazily to plug in additional logic.
|
void |
deactivate() |
boolean |
destroy(javax.servlet.http.HttpSession session) |
protected void |
initialize(String cid) |
boolean |
isInitialized() |
createRequestBeanStore, createSessionBeanStore, getNamingSchemePrefix, getRequestAttribute, getSessionAttribute, getSessionAttributeFromSession, getSessionFromRequest, removeRequestAttribute, setRequestAttribute, setSessionAttribute
activate, associate, associateRequest, associateRequestWithNewConversation, conversationPromotedToLongRunning, copyConversationIdGeneratorAndConversationsToSession, destroyConversation, dissociate, generateConversationId, getConcurrentAccessTimeout, getConversation, getConversations, getCurrentConversation, getDefaultTimeout, getParameterName, getRequest, getScope, invalidate, isAssociated, sessionCreated, setConcurrentAccessTimeout, setDefaultTimeout, setParameterName
cleanup, getBeanStore, setBeanStore
isActive, isValid, setActive
destroy, destroy, get, get, getContextual, getId, getServiceRegistry
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
activate, generateConversationId, getConcurrentAccessTimeout, getConversation, getConversations, getCurrentConversation, getDefaultTimeout, getParameterName, invalidate, setConcurrentAccessTimeout, setDefaultTimeout, setParameterName
public LazyHttpConversationContextImpl(String contextId, BeanIdentifierIndex beanIdentifierIndex)
public void activate()
activate
in interface org.jboss.weld.context.ConversationContext
activate
in interface org.jboss.weld.context.ManagedContext
activate
in class AbstractConversationContext<javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpSession>
public boolean isInitialized()
protected void initialize(String cid)
initialize
in class AbstractConversationContext<javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpSession>
public void deactivate()
deactivate
in interface org.jboss.weld.context.ManagedContext
deactivate
in class AbstractConversationContext<javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpSession>
public boolean destroy(javax.servlet.http.HttpSession session)
destroy
in interface org.jboss.weld.context.http.HttpConversationContext
destroy
in class AbstractConversationContext<javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpSession>
protected void checkContextInitialized()
AbstractContext
checkContextInitialized
in class AbstractContext
Copyright © 2016. All rights reserved.