How about begin() and end()?<br><br>reference: <a href="http://docs.jboss.org/seam/2.2.0.GA/api/org/jboss/seam/core/Conversation.html">http://docs.jboss.org/seam/2.2.0.GA/api/org/jboss/seam/core/Conversation.html</a><br><br>
<div class="gmail_quote">On Thu, Jan 28, 2010 at 11:56 PM, Nicklas Karlsson <span dir="ltr"><<a href="mailto:nickarls@gmail.com">nickarls@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;">
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>
_______________________________________________<br>
weld-dev mailing list<br>
<a href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/weld-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/weld-dev</a><br>
</blockquote></div><br>