Eager loading of Seam components that are not application or session scoped
This is my first question so let me know if I'm doing something I shouldn't. I have searched 开发者_开发技巧the Seam documentation and the forums about eagerly loading components in Seam, which normally loads components lazily. I only came across one annotation:
@Startup
This annotation only works for the APPLICATION and SESSION scopes as detailed here (section 27.1).
Is there a way to eagerly load components in other scopes? I am specifically hoping to eagerly load a component in the EVENT scope.
We are currently developing for JBoss 5.1.0.GA and so are using Seam 2.1.0.GA.
Thanks,
Gary.
You can put in your component an @Observer method using an event that you know will be raised at the beginning of the request, maybe org.jboss.seam.beforePhase
.
I cannot imagine a reason for having a component instantiated in such a way, though. What are you actually trying to achieve?
精彩评论