]
Antoine Sabot-Durand updated CDI-518:
-------------------------------------
Fix Version/s: 2.0 (discussion)
Clarify boundaries of the ServletContext event
----------------------------------------------
Key: CDI-518
URL:
https://issues.jboss.org/browse/CDI-518
Project: CDI Specification Issues
Issue Type: Clarification
Components: Events
Reporter: Jozef Hartinger
Fix For: 2.0 (discussion)
{quote}
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.
{quote}
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.