[cdi-dev] CDI-86: Application lifecycle events

Pete Muir pmuir at redhat.com
Tue Jun 21 12:47:06 EDT 2011

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.



More information about the cdi-dev mailing list