CDI-86: Application lifecycle events
by Pete Muir
A number of people have requested that CDI fire lifecycle events. I have produced the following proposal to start a discussion:
================================================
Add these qualifiers:
• @Initialized
• @Destroyed
• @Application
• @Session
• @Conversation
• @Request
And require that the container fires an event with an event type of Object when a context is initialized and destroyed, giving us 8 distinct events:
• @Initialized @Application Object o;
• @Destroyed @Application Object o;
• @Initialized @Session Object o;
• @Destroyed @Session Object o;
• @Initialized @Conversation Object o;
• @Destroyed @Conversation Object o;
• @Initialized @Request Object o;
• @Destroyed @Request Object o;
The payload of the event will depend on the environment in which CDI is operating. The spec would require that if the application was a web application that the payload would be the relevant event as defined by the Servlet spec.
The @Application event would be deferred until bootstrap is complete.
================================================
This will require the support of the Platform EG, so once we have a proposal we like, I will take it to them.
WDYT?
Pete
13 years, 10 months
[JBoss JIRA] Commented: (CDI-86) Support firing general purpose lifecycle events in Java EE environments
by Pete Muir (JIRA)
[ https://issues.jboss.org/browse/CDI-86?page=com.atlassian.jira.plugin.sys... ]
Pete Muir commented on CDI-86:
------------------------------
h1. Proposal
Add these qualifiers:
* {{@Initialized}}
* {{@Destroyed}}
* {{@Application}}
* {{@Session}}
* {{@Conversation}}
* {{@Request}}
And require that the container fires an event with an event type of Object when a context is initialized and destroyed, giving us 8 distinct events:
* {{@Initialized @Application Object o;}}
* {{@Destroyed @Application Object o;}}
* {{@Initialized @Session Object o;}}
* {{@Destroyed @Session Object o;}}
* {{@Initialized @Conversation Object o;}}
* {{@Destroyed @Conversation Object o;}}
* {{@Initialized @Request Object o;}}
* {{@Destroyed @Request Object o;}}
The payload of the event will depend on the environment in which CDI is operating. The spec would require that if the application was a web application that the payload would be the relevant event as defined by the Servlet spec.
The @Application event would be deferred until bootstrap is complete.
> Support firing general purpose lifecycle events in Java EE environments
> -----------------------------------------------------------------------
>
> Key: CDI-86
> URL: https://issues.jboss.org/browse/CDI-86
> Project: CDI Specification Issues
> Issue Type: Feature Request
> Components: Java EE integration
> Affects Versions: 1.0
> Reporter: Pete Muir
> Fix For: 1.1 (Proposed)
>
>
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 10 months