Package org.apache.webbeans.conversation
Class ConversationManager
- java.lang.Object
-
- org.apache.webbeans.conversation.ConversationManager
-
public class ConversationManager extends Object
Manager for the conversations. Each conversation is related with conversation id and session id.- Version:
- $Rev$ $Date$
-
-
Constructor Summary
Constructors Constructor Description ConversationManager(WebBeansContext webBeansContext)Creates new conversation manager
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddToConversationStorage(ConversationContext conversationContext, String conversationId)Add the given ConversationContext to the SessionContext.booleanconversationTimedOut(ConversationImpl conv)voiddestroyConversationContext(ConversationContext ctx)Destroy the given ConversationContext and fire the proper @Destroyed event with the correct payload.jakarta.enterprise.context.ConversationgetConversationBeanReference()Gets conversation instance from conversation bean.ConversationContextgetConversationContext(jakarta.enterprise.context.spi.Context sessionContext)This method shall only get called from the ContextsService.ObjectgetLifecycleEventPayload(ConversationContext ctx)Set<ConversationContext>getSessionConversations(jakarta.enterprise.context.spi.Context sessionContext, boolean create)booleanremoveConversationFromStorage(ConversationContext conversationContext)Remove the given ConversationContext from the SessionContext storage.
-
-
-
Constructor Detail
-
ConversationManager
public ConversationManager(WebBeansContext webBeansContext)
Creates new conversation manager
-
-
Method Detail
-
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
public boolean removeConversationFromStorage(ConversationContext conversationContext)
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
public boolean conversationTimedOut(ConversationImpl conv)
-
destroyConversationContext
public void destroyConversationContext(ConversationContext ctx)
Destroy the given ConversationContext and fire the proper @Destroyed event with the correct payload.
-
getLifecycleEventPayload
public Object getLifecycleEventPayload(ConversationContext ctx)
-
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
-
-