[webbeans-dev] Lifecycle for WebBeans SE Module
Peter Royle
howardmoon at screamingcoder.com
Tue Sep 22 20:38:57 EDT 2009
Hi,
I've come across a bit of a problem with the PFD2 from the SE module
perspective. There's no longer any suitable built-in event which can
be used to kick off the SE application, due to there not being any
lifecycle events which fire while the contexts are active. We used to
use @Observes @Deployed Manager, and by doing so the observer method
was executed inside a fully injected bean with all contexts available.
In PFD2 we have the AfterDeploymentValidation event, but it gets fired
'before creating contexts and processing requests'. Then the next
lifecycle event after that is BeforeShutdown.
The simplest alternative I can think of is a custom event introduced
for WebBeans SE specifically, thrown by the SE module itself, which
isn't ideal because we lose that portability.
Any thoughts or advice?
Related question: How is application code written for CDI supposed to
execute code on startup - does it have to register an Extension and
execute without any contexts/injection?
Cheers,
Pete.
More information about the weld-dev
mailing list