-
1. Re: Bean instantiated twice
pieter.martin Jan 21, 2010 8:48 PM (in response to pieter.martin)Ok I checked on the SE Guess example in the distro and it has the same behavior as explained above
Is this a bug or not?
Thanks
Pieter -
2. Re: Bean instantiated twice
nickarls Jan 21, 2010 9:11 PM (in response to pieter.martin)How is the JSF version behaving on this point?
-
3. Re: Bean instantiated twice
pieter.martin Jan 21, 2010 9:42 PM (in response to pieter.martin)Uhmm, don't know, going to sleep now but will have a look tomorrow.
Cheers
-
4. Re: Bean instantiated twice
pieter.martin Jan 22, 2010 7:47 AM (in response to pieter.martin)Still not sure about the jsf version's behavior (waiting for jboss6 to download) but I have spotted the ShutdownManager class.
So I
@Inject ShutdownManager shutdownManager;
and then call
shutdownManager.shutdown();
before the main thread exist.
This inturn calls the @PreDestroy methods of ApplicationScoped objects.
Cheers
Pieter -
5. Re: Bean instantiated twice
pieter.martin Jan 22, 2010 7:58 AM (in response to pieter.martin)Ok, another way I spotted now,
@Inject @Shutdown Event<BeanManager> shutdownEvent; @Inject BeanManager beanManager;
and the before the mail thread exist call,
shutdownEvent.fire(beanManager);
Cheers
Pieter -
6. Re: Bean instantiated twice
peteroyle.howardmoon.hitcity.com.au Jan 29, 2010 3:22 AM (in response to pieter.martin)I'll try to have a look at the double-instanciation thing over the next week, and will double-check the documentation to see if I can't clarify the use of the ShutdownManager.
Cheers,
Pete.