I presume this event is only being fired from the WebBeansPhaseListener and won't exist for non-faces requests?<br><br>-Clint<br><br><div class="gmail_quote">On Sat, May 30, 2009 at 3:41 PM, Gavin King <span dir="ltr"><<a href="mailto:gavin.king@gmail.com">gavin.king@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Or we could say it is an event that is observable by Extensions:<br>
<br>
void request(@Observes BeforeRestoreConversation brc) {<br>
brc.setId( brc.getRequest().getParameter("specialcid") );<br>
}<br>
<br>
where we define the following interface:<br>
<br>
public interface BeforeRestoreConversation {<br>
String getId();<br>
void setId(String id);<br>
ServletContext getContext();<br>
HttpServletRequest getRequest();<br>
}<br>
<br>
This seems to me like the better option, WDYT?<br>
<div><div></div><div class="h5"><br>
On Sat, May 30, 2009 at 1:31 PM, Gavin King <<a href="mailto:gavin.king@gmail.com">gavin.king@gmail.com</a>> wrote:<br>
> On Sat, May 30, 2009 at 12:43 PM, Gavin King <<a href="mailto:gavin.king@gmail.com">gavin.king@gmail.com</a>> wrote:<br>
><br>
>>> Looking at the Conversation public API I don't see any programmatic<br>
>>> way to restore a conversation. Perhaps we should add such an API?<br>
>><br>
>> Ugh, I really didn't want to go there in this release, though it<br>
>> would, very clearly, be a very useful feature.<br>
>><br>
>> If we were going to go there, the way I would do it is to say that the<br>
>> conversation context is defined for all servlet requests, but it is by<br>
>> default transient. The container would be required to call back to<br>
>> Extensions to obtain a conversation id.<br>
><br>
> Actually, upon reflection, I think we need to do this :-/<br>
><br>
> Because even in JSF, we want a way to customize the mechanism for<br>
> conversation propagation.<br>
><br>
> So we could say that an Extension may optionally implement this interface:<br>
><br>
> public interface ConversationExtension {<br>
> String getConversationId(HttpServletRequest request,<br>
> ServletContext context);<br>
> }<br>
><br>
> And say that before any Filter is called, the container calls all<br>
> ConversationExtensions looking for a conversation id, and if it finds<br>
> one, restores the conversation.<br>
><br>
> Alternatively, we could say that the conversation is only restored<br>
> *after* all ServletFilters have been called, and say that the<br>
> container looks in a specially-named request attribute, for example<br>
> "javax.contexts.spi.conversationId". Then we would not need a special<br>
> interface, and any servlet filter could do conversation management.<br>
> This seems more elegant, but means you don't get a conversation<br>
> context in your filters.<br>
><br>
</div></div><div><div></div><div class="h5">> WDYT?<br>
><br>
> --<br>
> Gavin King<br>
> <a href="mailto:gavin.king@gmail.com">gavin.king@gmail.com</a><br>
> <a href="http://in.relation.to/Bloggers/Gavin" target="_blank">http://in.relation.to/Bloggers/Gavin</a><br>
> <a href="http://hibernate.org" target="_blank">http://hibernate.org</a><br>
> <a href="http://seamframework.org" target="_blank">http://seamframework.org</a><br>
><br>
<br>
<br>
<br>
--<br>
Gavin King<br>
<a href="mailto:gavin.king@gmail.com">gavin.king@gmail.com</a><br>
<a href="http://in.relation.to/Bloggers/Gavin" target="_blank">http://in.relation.to/Bloggers/Gavin</a><br>
<a href="http://hibernate.org" target="_blank">http://hibernate.org</a><br>
<a href="http://seamframework.org" target="_blank">http://seamframework.org</a><br>
<br>
_______________________________________________<br>
webbeans-dev mailing list<br>
<a href="mailto:webbeans-dev@lists.jboss.org">webbeans-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/webbeans-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/webbeans-dev</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Clint Popetz<br><a href="http://42lines.net">http://42lines.net</a><br>Scalable Web Application Development<br>