36.5. @Startup
Seam 2 provides the
@Startup annotation that can be applied to an application or session scoped component. A @Startup annotated component is instantiated immediately after the context is started up, instead of instantiating the component lazily when first needed by a client.
There are several alternatives in Java EE 6:
- Observing CDI 1.1+ built-in events which notify the component when the application starts or when the request or session context is activated due to a servlet request.
- Observing initialization of the ServletContext using the DeltaSpike Servlet module and
@Observes @Initialized ServletContext.