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 Details

    • ConversationManager

      public ConversationManager(WebBeansContext webBeansContext)
      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 at Conversation.begin().
    • removeConversationFromStorage

      public boolean removeConversationFromStorage(ConversationContext conversationContext)
      Remove the given ConversationContext from the SessionContext storage. This method usually will get called at Conversation.end() or during cleanup. Not that this does not destroy the ConversationContext!
      Returns:
      true if 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