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.
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.
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().