org.jboss.errai.cdi.server
Class ConversationContext

java.lang.Object
  extended by org.jboss.errai.cdi.server.ConversationContext
All Implemented Interfaces:
org.jboss.weld.context.bound.BoundRequest

public class ConversationContext
extends Object
implements org.jboss.weld.context.bound.BoundRequest

A conversation is used to span multiple requests, however is shorter than a session. The BoundConversationContext uses one Map to represent a request, and a second to represent the session, which are encapsulated in a BoundRequest.

TODO: Verify thread safety requirements


Constructor Summary
ConversationContext()
           
 
Method Summary
 Map<String,Object> getRequestMap()
          Get the current request map.
 Map<String,Object> getSessionMap(boolean create)
           Get the current session map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConversationContext

public ConversationContext()
Method Detail

getRequestMap

public Map<String,Object> getRequestMap()
Get the current request map.

Specified by:
getRequestMap in interface org.jboss.weld.context.bound.BoundRequest
Returns:

getSessionMap

public Map<String,Object> getSessionMap(boolean create)

Get the current session map.

A BoundRequest may be backed by a data store that only creates sessions on demand. It is recommended that if the session is not created on demand, or that the session has already been created (but is not required by this access) that the session is returned as it allows the conversation context to work more efficiently.

Specified by:
getSessionMap in interface org.jboss.weld.context.bound.BoundRequest
Parameters:
create - if true, then a session must be created
Returns:
the session map; null may be returned if create is false


Copyright © 2011 JBoss, a division of Red Hat. All Rights Reserved.