-
1. Re: how to end a conversation using <s:link>
leonardinius Jun 3, 2008 1:20 AM (in response to infinity2heaven)I believe All you need is add
@End //!!!!!!!!!!!!!!!! @Remove @Destroy public void destroy() { log.info('here'); Contexts.removeFromAllContexts("selectedTimePeriod"); }
annotation there.
@Destroy - is bean related? @Remove - either?
@Begin/@End annotations would mark your conversation properly.
-
2. Re: how to end a conversation using <s:link>
infinity2heaven Jun 3, 2008 1:27 AM (in response to infinity2heaven)The answer is irrelevant to my question. I need to end teh current conversation when user clicks on any <s:link>, not in the SFSB (which I understand)
-
3. Re: how to end a conversation using <s:link>
leonardinius Jun 3, 2008 1:37 AM (in response to infinity2heaven)Sorry, I am a little confused (and it's kinda too late or too early in my location ;)
SFSB - Seam Front Side Bus?
I could suggest You to mark some action method method as @End and pass it to the s:link<s:link action="#{bean.endSmth} />"
and to see what happens.
But, IMO propagation "end" should work.
May be it's worth to pass the some action and digg into Conversations/Contexts via debugging console :) -
4. Re: how to end a conversation using <s:link>
leonardinius Jun 3, 2008 1:40 AM (in response to infinity2heaven)I assume my answer is still irrelevant enough. :)
+1 cent - possible solution to see what happens where - to invalidate session, reset conversation timeouts and so on.. Just to see what happens along the changes
-
5. Re: how to end a conversation using <s:link>
infinity2heaven Jun 3, 2008 2:05 AM (in response to infinity2heaven)Ok, let me explain my use case. There are 3 main tabs A, B, C (menu). Each Tab internally may have multiple sub tabs under it. Let's say A1, A2, A3. And B1, B2, B3. Each of these subtabs, is backed by a conversation scoped SFSB (StateFul Session Bean).
Let's say the user is working on A1 and suddenly changes his mind and clicks on B. I need to end the conversaion A1.(after showing a js popup that changes will be lost). I can't have an action here because I don't know from
where he's coming
. He could come from B1 or C3. The point is, the current conversation should end.Seam reference says <s:link propagation="end"> would end the current conversation. But it doesn't look like as my @Destroy method is never called
-
6. Re: how to end a conversation using <s:link>
leonardinius Jun 3, 2008 8:01 AM (in response to infinity2heaven)Hi Priya,
I see Your pain now. I think I am not the right man to speak about SFSB related stuff :) Anyway, my vision of the problem:
- conversation isn't ended
- conversation scoped bean cleanup procedure isn't called. As I see - it should be called onto a) remove from AS 2) destroying context
So, I would suggest You to demark/divide each of this do you really have. I would suggest You to use
@Observer(value="org.jboss.seam.endConversation") public void observeConversationEnd() { log.info("CONVERSATION Ended"); } @Observer(value="org.jboss.seam.beginConversation") public void observeConversationStart() { log.info("CONVERSATION Started"); }
or similar Just to see what is the state of conversations.
And once more- I would suggest you to call Conversation.instance().end() by hand - to see that happens.I believe You could invoke this stuff from your *.jsf via
<s:link action="#{conversation.end}">
So, what I would do myself (in order):
- Ensure conversation lifecycle through observers or smth. (In the worst case calling #{conversation.end} in action or via Seam Remoting.
- Only after that look on SFSB cleanup procedure invocation problems.