-
Notifications
You must be signed in to change notification settings - Fork 11
Startup Singleton
LightGuard edited this page Jan 25, 2012
·
1 revision
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 two possible alternatives in Java EE 6:
- EJB Singleton beans – which can be marked to be instantiated eagerly at application startup using the @Startup annotation. Combined with the fact that these components can benefit from declarative transaction management, these components are good candidates for performing database imports, etc.
- Observing Solder’s events which notify the component when the application starts or when the request or session context is activated due to a servlet request.