Package org.apache.webbeans.conversation
Class ConversationManager
java.lang.Object
org.apache.webbeans.conversation.ConversationManager
Manager for the conversations.
Each conversation is related with conversation id and session id.
- Version:
- $Rev$ $Date$
-
Constructor Summary
ConstructorsConstructorDescriptionConversationManager(WebBeansContext webBeansContext) Creates new conversation manager -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToConversationStorage(ConversationContext conversationContext, String conversationId) Add the given ConversationContext to the SessionContext.booleanvoidDestroy the given ConversationContext and fire the proper @Destroyed event with the correct payload.jakarta.enterprise.context.ConversationGets conversation instance from conversation bean.getConversationContext(jakarta.enterprise.context.spi.Context sessionContext) This method shall only get called from the ContextsService.getSessionConversations(jakarta.enterprise.context.spi.Context sessionContext, boolean create) booleanremoveConversationFromStorage(ConversationContext conversationContext) Remove the given ConversationContext from the SessionContext storage.
-
Constructor Details
-
ConversationManager
Creates new conversation manager
-
-
Method Details
-
getConversationContext
public ConversationContext getConversationContext(jakarta.enterprise.context.spi.Context sessionContext) This method shall only get called from the ContextsService. It will create a new ConversationContext if there is no long running Conversation already running.- Returns:
- the ConversationContext which is valid for the whole request.
-
addToConversationStorage
public void addToConversationStorage(ConversationContext conversationContext, String conversationId) Add the given ConversationContext to the SessionContext. This method usually will get called atConversation.begin(). -
removeConversationFromStorage
Remove the given ConversationContext from the SessionContext storage. This method usually will get called atConversation.end()or during cleanup. Not that this does not destroy the ConversationContext!- Returns:
trueif the conversationContext got removed
-
getConversationBeanReference
public jakarta.enterprise.context.Conversation getConversationBeanReference()Gets conversation instance from conversation bean.- Returns:
- conversation instance
-
conversationTimedOut
-
destroyConversationContext
Destroy the given ConversationContext and fire the proper @Destroyed event with the correct payload. -
getLifecycleEventPayload
-
getSessionConversations
public Set<ConversationContext> getSessionConversations(jakarta.enterprise.context.spi.Context sessionContext, boolean create) - Parameters:
create- whether a session and the map in there shall get created or not- Returns:
- the conversation Map from the current session
-