An event with qualifier @Initialized(ApplicationScoped.class) is fired when the application
context is initialized and an event with qualifier @Destroyed(ApplicationScoped.class) is fired
when the application is destroyed. The event payload is:
• the ServletContext if the application is a web application deployed to a Servlet container, or Conversation context lifecycle
• any java.lang.Object for other types of application.
Unlike dependency injection, the spec does not define any visibility boundaries for events. It could therefore be implied that in an EAR a web application could observe the ServletContext event for a different web application. This obviously does not seem right and the spec should explicitly define the expected behavior.
- relates to
-
WELD-1821 Revisit how @Initialized/@Destroyed events are fired for @ApplicationScoped
-
- Resolved
-
The CDI project is part ofJakarta and uses GitHub issues as it's issue tracking system.
Therefore, all issues in CDI JIRA project are being bulk-closed as described in this GitHub issue.
If you feel like this particular issue deserves ongoing discussion, investigation or fixes in CDI/CDI TCK, please create a new issue under GitHub repository and include a link to this JIRA.
For specification related question/issues, please use - https://github.com/eclipse-ee4j/cdi/issues
For CDI TCK related questions/issues, please use - https://github.com/eclipse-ee4j/cdi-tck/issues