<span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; color: rgb(51, 51, 51); ">Hi all, </span><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; color: rgb(51, 51, 51); "><br>
</span></div><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; color: rgb(51, 51, 51); ">First sorry if this message was received twice, I'm not sure my first response was taken in account as I was not subscribed to the list<div>
<br></div><div>I just have a few remarks for now :</div><div><br></div><div>1. I don't understand the need for <span style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">createTransientConversation and endTransientConversation if there is activateContext and deactivateContext. Why not something like setupConversation() / cleanupConversation() that always create a transient conversation that can be later promoted to long-running by restoreConversation / beginConversation.</span></div>
<div><span style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">2. It would be useful to be able to force a new conversationId defined by the client with beginConversation(cid)</span></div>
<div><span style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">3. This is not directly linked to the ConversationManager interface, but it would also be useful to be able to observe the same events than Seam 2 dispatches : BeginConversationEvent, EndConversationEvent, ConversationTimeoutEvent and ConversationDestroyedEvent (although I'm not sure the last one makes sense with CDI)</span></div>
</span><div><br></div><div><br></div>William<div><br><div class="gmail_quote"><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi,<br>
<br>
There has been many requests for a standard ConversationManager<br>
API that could be used by other frameworks (SE, GraniteDS, Seam<br>
Remoting etc) so there was a short brainstorming session and we came<br>
up with the following proposal on which I now request your feedback.<br>
<br>
public interface ConversationManager<br>
{<br>
/**<br>
* Activates the conversation context<br>
*<br>
* @return The conversation manager<br>
* @throws IllegalStateException if the context is already active<br>
*/<br>
public abstract ConversationManager activateContext();<br>
<br>
/**<br>
* Deactivates the conversation context<br>
*<br>
* @return The conversation manager<br>
* @throws IllegalStateException if the context is already deactivated<br>
*/<br>
public abstract ConversationManager deactivateContext();<br>
<br>
/**<br>
* Checks the state of the conversation context<br>
*<br>
* @return true if the conversation context is active, false otherwise<br>
*/<br>
public abstract boolean isContextActive();<br>
<br>
/**<br>
* Starts a new, transient conversation<br>
*<br>
* @return The conversation manager<br>
* @throws IllegalStateException if there is already an active<br>
conversation or if the conversation context is not active<br>
*/<br>
public abstract ConversationManager createTransientConversation();<br>
<br>
/**<br>
* Ends the current transient conversation<br>
*<br>
* @return The conversation manager<br>
* @throws IllegalStateException if the current transaction is not<br>
transient or if the conversation context is not active<br>
*/<br>
public abstract ConversationManager endTransientConversation();<br>
<br>
/**<br>
* Restores a long-running conversation.<br>
*<br>
* @param cid The id of the conversation to restore<br>
* @return The conversation manager<br>
* @throws NonexistentConversationException if the conversation id<br>
is null or not a known long-running conversation<br>
* @throws IllegalStateException if there already an active<br>
conversation or if the conversation context is not active<br>
*/<br>
public abstract ConversationManager restoreConversation(String cid);<br>
<br>
/**<br>
* Marks a long-running conversation transient<br>
*<br>
* @param cid The id of the conversation to make transient<br>
* @return The conversation manager<br>
* @throws NonexistentConversationException if the conversation id<br>
is null or not a known long-running conversation<br>
* @throws IllegalStateException if the conversation context is not active<br>
*/<br>
public abstract ConversationManager endConversation(String cid);<br>
<br>
/**<br>
* Marks all long-running conversations as transient and destroys them<br>
*<br>
* @return The conversation manager<br>
* @throws IllegalStateException if the conversation context is not active<br>
*/<br>
public abstract ConversationManager endAllConversations();<br>
<br>
/**<br>
* Returns the long-running conversation IDs<br>
*<br>
* @return The long-running conversations IDs<br>
* @throws IllegalStateException if the conversation context is not active<br>
*/<br>
public abstract Set<String> getConversations();<br>
<br>
/**<br>
* Returns a new, unused conversation ID<br>
*<br>
* @return A new, unused conversation ID<br>
* @throws IllegalStateException if the conversation context is not active<br>
*/<br>
public abstract String getNewConversationId();<br>
<br>
<br>
/**<br>
* Checks if a conversation ID is in use for any other conversation<br>
than the current one<br>
*<br>
* @return True if the conversation ID is in use, false otherwise<br>
* @throws IllegalStateException if the conversation context is not active<br>
*/<br>
public abstract boolean isConversationIdInUse(String id);<br>
<br>
}<br>
<br>
Does it do the job? Needs more ? Needs less? Violates the<br>
specification in any point (from JSF perspective)?<br>
<br>
---<br>
Nik<br>
</blockquote></div><br></div></div>