Question

I'm writing application in JBoss 7.1.1.Final, Weld, Seam 3. I have following bean:

@ConversationScoped
public class ConversationBean implements Serializable {

   @Inject
   Conversation conversation;

   private Article article;
...
}

Now, the user might create multiple conversations, each conversation will be associated with the instance of ConversationBean. I need to be able to get all those instances that are associated with long-running conversation.

The reason why I need an access to them is that if a user opens one Article multiple times (thus he will create multiple conversations with the same article). If he changes the Article in one conversation, I want to be able to refresh the Articles in the other conversations.

Is there some standard way to do this?

Edit: "article" instance is looked up by entityManager and is managed within conversation. Entity manager is retrieved using Seam Managed Persistence Context.

Was it helpful?

Solution

Per session there's only ever one conversation going on. Injection Conversation will give you the one long-running conversation (or temporary conversation if it hasn't been promoted) going on).

OTHER TIPS

see http://docs.jboss.org/weld/reference/latest/en-US/html/contexts.html

@Inject @Http private HttpConversationContext conversationContext;

[...]    

     conversationContext.getConversations()
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top