Interface HttpConversationContext
- All Superinterfaces:
jakarta.enterprise.context.spi.AlterableContext,BoundContext<jakarta.servlet.http.HttpServletRequest>,jakarta.enterprise.context.spi.Context,ConversationContext,ManagedContext,WeldAlterableContext
- Author:
- Pete Muir
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidactivateLazily(Consumer<jakarta.servlet.http.HttpServletRequest> transientConversationInitializationCallback) Activate the conversation context lazily - neither determine the conversation id, nor initialize the context.booleandestroy(jakarta.servlet.http.HttpSession session) If the context is not currently associated with aHttpServletRequest, then the context will be associated with the specifiedHttpSession(for this thread), activated, destroyed, and then deactivated.Methods inherited from interface jakarta.enterprise.context.spi.AlterableContext
destroyMethods inherited from interface org.jboss.weld.context.BoundContext
associate, dissociateMethods inherited from interface jakarta.enterprise.context.spi.Context
get, get, getScope, isActiveMethods inherited from interface org.jboss.weld.context.ConversationContext
activate, activate, generateConversationId, getConcurrentAccessTimeout, getConversation, getConversations, getCurrentConversation, getDefaultTimeout, getParameterName, invalidate, setConcurrentAccessTimeout, setDefaultTimeout, setParameterNameMethods inherited from interface org.jboss.weld.context.ManagedContext
deactivateMethods inherited from interface org.jboss.weld.context.WeldAlterableContext
clearAndSet, getAllContextualInstances
-
Method Details
-
destroy
boolean destroy(jakarta.servlet.http.HttpSession session) If the context is not currently associated with a
HttpServletRequest, then the context will be associated with the specifiedHttpSession(for this thread), activated, destroyed, and then deactivated. Any conversations associated with the context will also be destroyed.If the context is already associated with a
HttpServletRequestthen this call will detach the context from the underlying Http Session, and mark the context for destruction when the request is destroyed.This will cause any transient conversations, and any long running conversations associated with the session, to be destroyed.
- Parameters:
session- theHttpSessionin which to store the bean instances- Returns:
- true if the context was destroyed immediately
-
activateLazily
default void activateLazily(Consumer<jakarta.servlet.http.HttpServletRequest> transientConversationInitializationCallback) Activate the conversation context lazily - neither determine the conversation id, nor initialize the context. The context is only initialized when a conversation-scoped bean is accessed for the first time. The callback, if specified, is executed during initialization of a transient conversation. The implementation must throw a
RuntimeExceptionif the lazy initialization is not supported.- Parameters:
transientConversationInitializationCallback- the callback which is invoked during initialization of a transient conversation
-