Dear all,
I'm running a Java EE 6 application which uses CDI Beans and a @SessionScoped Bean to keep track of the user's session. Now I have the need to deploy this application in cluster made up of JBoss AS 7.1.1 nodes. My doubt is: in order to achieve HA of my session, is it enough that I tag my SessionScoped bean as @Clusterable ?
@Named
@ConversationScoped
@Clustered
public class SessionDriver implements Serializable {
. . . .
}
or should I mark as @Clustered also other @Model beans which are used by the application, such as the Bean which starts the Conversation ?
@Model
@Clustered // ????
public class Controller {
@Inject
private Conversation conversation;
public String create() {
. . . . .
conversation.begin();
. . . . .
}
public String endConv() {
. . . . .
conversation.end();
. . . . .
}
}
Thanks
Mylos
No. Instead of the annotation add the <distributable/> element to web.xml (Also make sure any web-fragments used are also distributable).