2 Replies Latest reply on Dec 23, 2011 12:22 AM by lightguard

    Switching current conversation

    riboriori

      Hi all,
      I have 2 questions:
      1) Wich conversation is propagated? the current?


      2) If yes, say, in a certain moment, i have n long running conversations: can i manually decide how conversation make as current conversation in order to decide which one i propagate?


      Best regards

        • 1. Re: Switching current conversation
          riboriori

          I've found in WeldPhaseListener:







          HttpConversationContext conversationContext =instance().select(HttpConversationContext.class).get();
          HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
          conversationContext.dissociate(request);
          conversationContext.associate(request);
          conversationContext.activate(cidToActivate)



          ;


          where instance():




          private static Instance<Context> instance() {
            return Container.instance().deploymentManager().instance().select(Context.class);
          }







          Only a question: is there a chance to have more than one active conversation with weld?


          • 2. Re: Switching current conversation
            lightguard

            No, that's a CDI spec deal. You'd have to create your own Conversation implementation and use that.