-
1. Re: Weld integration question: HTTP session replication and passivation
mkouba Dec 12, 2014 11:01 AM (in response to mark.nuttall)Hi Mark,
Weld does not invoke HttpSession.setAttribute() at the end of the request (during ServletRequestListener.requestDestroyed() notification). HttpSession.getAttribute()/setAttribute() is called when the session context is activated (during ServletRequestListener.requestInitialized() notification). HttpSession.setAttribute() is also called when a new bean instance of of a @SessionScoped or @ConversationScoped bean is created. I'm not sure there is some portable way to observe HttpSession.getAttribute() invocation though.
-
2. Re: Weld integration question: HTTP session replication and passivation
mark.nuttall Dec 15, 2014 6:51 AM (in response to mkouba)Hi Martin,
Thank you for your reply. Let me rephrase the question: does Weld support HTTP session passivation, replication and failover? If so, where is this documented? Many thanks in advance for any help.
Regards,
Mark
-
3. Re: Weld integration question: HTTP session replication and passivation
jharting Dec 16, 2014 3:45 AM (in response to mark.nuttall)Weld does support replication of @SessionScoped and @ConversationScoped bean instances. It is built on session replication which a Servlet container may or may not provide. As long as an attribute, which is stored in the session by Weld, gets replicated, Weld's instance on the other node of a cluster finds this attribute and will use it. There is nothing more to be configured.
Note that Weld does not re-set the attribute after each change to a bean instance. It is therefore important that the Servlet container replication is triggered by session.getAttribute().