[weld-issues] [JBoss JIRA] Updated: (CDI-30) An API for managing built in contexts

Pete Muir (JIRA) jira-events at lists.jboss.org
Tue Jan 25 10:34:50 EST 2011


     [ https://issues.jboss.org/browse/CDI-30?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pete Muir updated CDI-30:
-------------------------

        Summary: An API for managing built in contexts  (was: An API for conversation management)
    Description: Add management API for built in contexts allowing them to be reused as needed.  (was:   I think it would be useful to have a ConversationManager API for CDI that would allow for portable modules that use the conversation context.

  Weld has been using the following interface, which has also been approved by Mark Struberg representing OpenWebBeans and by Reza Rahman 
representing CanDI and I hope it can be used for the basis of discussions on this topic:

public interface ConversationManager
{
   /**
    * Checks the state of the conversation context
    * 
    * @return true if the conversation context is active, false otherwise
    */
   public abstract boolean isContextActive();
   
   /**
    * Sets up and activates the conversation context
    * 
    * @return The conversation manager
    * 
    * @throws IllegalStateException if the context is already active
    */   
   public abstract ConversationManager setupContext();
   
   /**
    * Destroys the conversations and deactivates the conversation context
    * 
    * @return The conversation manager
    * 
    * @throws IllegalStateException if the context is already deactive
    */   
   public abstract ConversationManager teardownContext();

   /**
    * Resumes a long running conversation. If the cid is null, nothing is done and the current
    * transient conversation is resumed
    * 
    * 
    * @param cid The conversation id to restore
    * @return The conversation manager
    * @throws NonexistentConversationException If the non-transient conversation is not known
    * @throws BusyConversationException If the conversation is locked and not released while waiting 
    * @throws IllegalStateException if the conversation context is not active
    */
   
   public abstract ConversationManager setupConversation(String cid);
   
   /**
    * Destroys the current conversation if it's transient. Stores it for conversation 
    * propagation if it's non-transient
    * 
    * @return The conversation manager
    * @throws IllegalStateException if the conversation context is not active
    */
   public abstract ConversationManager teardownConversation();
   
   /**
    * Gets the current non-transient conversations
    * 
    * @return The conversations, mapped by id
    * @throws IllegalStateException if the conversation context is not active
    */
   public abstract Map<String, Conversation> getConversations();

   /**
    * Returns a new, session-unique conversation ID
    * 
    * @return The conversation id
    * @throws IllegalStateException if the conversation context is not active
    */   
   public abstract String generateConversationId();
 
})


Weld has been using the following interface, which has also been approved by Mark Struberg representing OpenWebBeans and by Reza Rahman 
representing CanDI and I hope it can be used for the basis of discussions on this topic:

public interface ConversationManager
{
   /**
    * Checks the state of the conversation context
    * 
    * @return true if the conversation context is active, false otherwise
    */
   public abstract boolean isContextActive();
   
   /**
    * Sets up and activates the conversation context
    * 
    * @return The conversation manager
    * 
    * @throws IllegalStateException if the context is already active
    */   
   public abstract ConversationManager setupContext();
   
   /**
    * Destroys the conversations and deactivates the conversation context
    * 
    * @return The conversation manager
    * 
    * @throws IllegalStateException if the context is already deactive
    */   
   public abstract ConversationManager teardownContext();

   /**
    * Resumes a long running conversation. If the cid is null, nothing is done and the current
    * transient conversation is resumed
    * 
    * 
    * @param cid The conversation id to restore
    * @return The conversation manager
    * @throws NonexistentConversationException If the non-transient conversation is not known
    * @throws BusyConversationException If the conversation is locked and not released while waiting 
    * @throws IllegalStateException if the conversation context is not active
    */
   
   public abstract ConversationManager setupConversation(String cid);
   
   /**
    * Destroys the current conversation if it's transient. Stores it for conversation 
    * propagation if it's non-transient
    * 
    * @return The conversation manager
    * @throws IllegalStateException if the conversation context is not active
    */
   public abstract ConversationManager teardownConversation();
   
   /**
    * Gets the current non-transient conversations
    * 
    * @return The conversations, mapped by id
    * @throws IllegalStateException if the conversation context is not active
    */
   public abstract Map<String, Conversation> getConversations();

   /**
    * Returns a new, session-unique conversation ID
    * 
    * @return The conversation id
    * @throws IllegalStateException if the conversation context is not active
    */   
   public abstract String generateConversationId();
 
}

> An API for managing built in contexts
> -------------------------------------
>
>                 Key: CDI-30
>                 URL: https://issues.jboss.org/browse/CDI-30
>             Project: CDI Specification Issues
>          Issue Type: Feature Request
>          Components: Specification
>    Affects Versions: 1.0
>            Reporter: Nicklas Karlsson
>
> Add management API for built in contexts allowing them to be reused as needed.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the weld-issues mailing list