-
1. Re: Problems regarding CONVERSATION
vikram.vikram.chhetry.gmail.com May 2, 2008 2:06 PM (in response to vikram.vikram.chhetry.gmail.com)Editing second question:--
What are ways of finding out when a stateful bean is destroyed. One way is to use destroy method. Is there any other way to find out. -
2. Re: Problems regarding CONVERSATION
danielc.roth May 2, 2008 2:19 PM (in response to vikram.vikram.chhetry.gmail.com)According to http://docs.jboss.com/seam/2.0.1.GA/reference/en/html_single/#d0e4167
you may observe the following events to find out....
org.jboss.seam.preDestroyContext.<SCOPE> — called before the <SCOPE> context is destroyed org.jboss.seam.postDestroyContext.<SCOPE> — called after the <SCOPE> context is destroyed org.jboss.seam.preDestroy.<name> — called when the component <name> is destroyed
-
3. Re: Problems regarding CONVERSATION
danielc.roth May 2, 2008 2:22 PM (in response to vikram.vikram.chhetry.gmail.com)Regarding conversation, you have end/timeout etc in that list too.
-
4. Re: Problems regarding CONVERSATION
vikram.vikram.chhetry.gmail.com May 2, 2008 2:26 PM (in response to vikram.vikram.chhetry.gmail.com)Could you please tell me how to use them. Or gimme a url where I can find how to use it.
Thanks for the reply.
-
5. Re: Problems regarding CONVERSATION
danielc.roth May 2, 2008 2:31 PM (in response to vikram.vikram.chhetry.gmail.com)If your bean has @Name(
myBean
) do this:@Observer("org.jboss.seam.preDestroy.myBean") public void myBeanIsDestroyed() { //Do logic }
And myBeanIsDestroyed will be invoked before the component is destroyed. For conversations there are quite another few useful events, look in the list.
-
6. Re: Problems regarding CONVERSATION
vikram.vikram.chhetry.gmail.com May 2, 2008 2:56 PM (in response to vikram.vikram.chhetry.gmail.com)But this thing will happen every time when the bean is destroyed.
What happens with me is when I am playing with my user entity sometimes the bean destroys on its own. And my modalPanel is not able to detect that bean is destroyed and the modalPanel loads without values.What should I do in this case?
-
7. Re: Problems regarding CONVERSATION
danielc.roth May 2, 2008 3:08 PM (in response to vikram.vikram.chhetry.gmail.com)Listen to those events to see why/when the bean is destroyed. Then proceed from there...
It seems odd that the entity
self-destroys
. In what scope is it? If it is in conversation-scope, also observe all the other conversation events. -
8. Re: Problems regarding CONVERSATION
vikram.vikram.chhetry.gmail.com May 2, 2008 4:57 PM (in response to vikram.vikram.chhetry.gmail.com)@Observer("org.jboss.seam.preDestroy.myBean") public void myBeanIsDestroyed() { //Do logic }
when is this method called?
When ever I click a link and load a page all the other stateful beans are destroyed by seam. If I do this will it be called whenever seam destroys the beans? or only destroy method is called when seam destroys the beans?Thanks for replys