Class ConversationManager


  • public class ConversationManager
    extends Object
    Manager for the conversations. Each conversation is related with conversation id and session id.
    Version:
    $Rev$ $Date$
    • 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 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.
      • 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