-
1. Re: PostConstruct on JBoss 6 M2 not working
nickarls May 10, 2010 12:59 PM (in response to hbraun.myownwastebin.gmail.com)Show us some code.
Especially the usage part so we see that it's actually instantiated and not only proxied...
-
2. Re: PostConstruct on JBoss 6 M2 not working
hbraun.myownwastebin.gmail.com May 10, 2010 2:00 PM (in response to hbraun.myownwastebin.gmail.com)
Especially the usage part so we see that it's actually instantiated and not only proxied...your are right. the proxy is created and upon invocation everything works as expected. My bad.
-
3. Re: PostConstruct on JBoss 6 M2 not working
hbraun.myownwastebin.gmail.com May 10, 2010 2:08 PM (in response to hbraun.myownwastebin.gmail.com)BTW, is there a way to force creation of @ApplicationScope'd instances at the time a proxy is requested?
-
4. Re: PostConstruct on JBoss 6 M2 not working
nickarls May 10, 2010 2:18 PM (in response to hbraun.myownwastebin.gmail.com)Well proxies are constructed in a non-extensible place so it's a bit tricky, besides they are all created at startup. Of course it shouldn't be that difficult to write an extension that observes AfterDeploymentValidation and warms up the application context for beans with a @Startup annotation or something like that.
-
5. Re: PostConstruct on JBoss 6 M2 not working
hbraun.myownwastebin.gmail.com May 10, 2010 3:43 PM (in response to hbraun.myownwastebin.gmail.com)Yeah, agree. It's an edge case I am asking for. I mean that's the reason why we have proxies in the first place. Let's see how far I can take it. Thanks for your help.
-
6. Re: PostConstruct on JBoss 6 M2 not working
pmuir May 19, 2010 1:19 PM (in response to hbraun.myownwastebin.gmail.com)
Heiko Braun wrote on May 10, 2010 15:43:
Yeah, agree. It's an edge case I am asking for. I mean that's the reason why we have proxies in the first place. Let's see how far I can take it. Thanks for your help.In general, you can't rely on behavior like this - the container is free to lazily or eagerly instantiate beans in any situation. Best approach if you need to mimic eager-instantiation is to call a method on the instantiated bean.