Class WeldTerminalListener
java.lang.Object
org.jboss.weld.module.web.servlet.WeldTerminalListener
- All Implemented Interfaces:
jakarta.servlet.http.HttpSessionListener,EventListener
public class WeldTerminalListener
extends Object
implements jakarta.servlet.http.HttpSessionListener
This listener activates the HttpSessionDestructionContext in sessionDestroyed(), but only if HttpSessionContext is not
active at the time (it is active when sessionDestroyed is invoked as a result of session.invalidate() during an
http request, and is not active when sessionDestroyed is invoked when the session times out or when all the sessions
are destroyed because the deployment is being removed).
This listener should always be the last registered listener. This will ensure this listener can activate the
session context before any other listeners try to access it (the listeners are notified in reverse order when a
session is being destroyed). Any listeners notified before this one will receive a ContextNotActiveException when
trying to access any @SessionScoped bean.
- Author:
- Marko Luksa
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsessionCreated(jakarta.servlet.http.HttpSessionEvent httpSessionEvent) voidsessionDestroyed(jakarta.servlet.http.HttpSessionEvent event)
-
Constructor Details
-
WeldTerminalListener
public WeldTerminalListener() -
WeldTerminalListener
-
-
Method Details
-
sessionCreated
public void sessionCreated(jakarta.servlet.http.HttpSessionEvent httpSessionEvent) - Specified by:
sessionCreatedin interfacejakarta.servlet.http.HttpSessionListener
-
sessionDestroyed
public void sessionDestroyed(jakarta.servlet.http.HttpSessionEvent event) - Specified by:
sessionDestroyedin interfacejakarta.servlet.http.HttpSessionListener
-