public abstract class AbstractConversationContext<R,S> extends AbstractBoundContext<R> implements ConversationContext
| Modifier and Type | Field and Description |
|---|---|
static String |
CONVERSATIONS_ATTRIBUTE_NAME |
static String |
DESTRUCTION_QUEUE_ATTRIBUTE_NAME |
| Constructor and Description |
|---|
AbstractConversationContext(String contextId,
org.jboss.weld.bootstrap.api.ServiceRegistry services) |
| Modifier and Type | Method and Description |
|---|---|
void |
activate() |
void |
activate(String cid) |
boolean |
associate(R request) |
protected void |
associateRequest(ManagedConversation conversation) |
protected void |
associateRequestWithNewConversation() |
void |
conversationPromotedToLongRunning(ConversationImpl conversation) |
protected void |
copyConversationIdGeneratorAndConversationsToSession() |
protected abstract BoundBeanStore |
createRequestBeanStore(NamingScheme namingScheme,
R request) |
protected abstract BoundBeanStore |
createSessionBeanStore(NamingScheme namingScheme,
S session) |
void |
deactivate() |
boolean |
destroy(S session) |
protected void |
destroyConversation(S session,
String id) |
boolean |
dissociate(R request) |
String |
generateConversationId() |
long |
getConcurrentAccessTimeout() |
ManagedConversation |
getConversation(String id) |
protected ConversationIdGenerator |
getConversationIdGenerator() |
Collection<ManagedConversation> |
getConversations() |
ManagedConversation |
getCurrentConversation() |
long |
getDefaultTimeout() |
protected abstract String |
getNamingSchemePrefix() |
String |
getParameterName() |
protected R |
getRequest()
Get the associated store
|
protected abstract Object |
getRequestAttribute(R request,
String name)
Retrieve an attribute value from the request
|
Class<? extends Annotation> |
getScope() |
protected abstract Object |
getSessionAttribute(R request,
String name,
boolean create)
Get an attribute value from the session.
|
protected abstract Object |
getSessionAttributeFromSession(S session,
String name)
Get an attribute value from the session.
|
protected abstract Iterator<String> |
getSessionAttributeNames(S session) |
protected abstract S |
getSessionFromRequest(R request,
boolean create) |
protected void |
initialize(String cid) |
void |
invalidate() |
protected boolean |
isAssociated()
Check if the context is currently associated
|
protected abstract void |
removeRequestAttribute(R request,
String name)
Remove an attribute from the request.
|
void |
sessionCreated() |
void |
setConcurrentAccessTimeout(long timeout) |
void |
setDefaultTimeout(long timeout) |
void |
setParameterName(String cid) |
protected abstract void |
setRequestAttribute(R request,
String name,
Object value)
Set an attribute in the request.
|
protected abstract void |
setSessionAttribute(R request,
String name,
Object value,
boolean create)
Set an attribute in the session.
|
cleanup, getBeanStore, setBeanStoreisActive, isValid, removeState, setActivecheckContextInitialized, destroy, destroy, get, get, getContextual, getId, getServiceRegistrypublic static final String CONVERSATIONS_ATTRIBUTE_NAME
public static final String DESTRUCTION_QUEUE_ATTRIBUTE_NAME
public AbstractConversationContext(String contextId, org.jboss.weld.bootstrap.api.ServiceRegistry services)
public String getParameterName()
getParameterName in interface ConversationContextpublic void setParameterName(String cid)
setParameterName in interface ConversationContextpublic void setConcurrentAccessTimeout(long timeout)
setConcurrentAccessTimeout in interface ConversationContextpublic long getConcurrentAccessTimeout()
getConcurrentAccessTimeout in interface ConversationContextpublic void setDefaultTimeout(long timeout)
setDefaultTimeout in interface ConversationContextpublic long getDefaultTimeout()
getDefaultTimeout in interface ConversationContextpublic boolean associate(R request)
associate in interface BoundContext<R>public boolean dissociate(R request)
dissociate in interface BoundContext<R>dissociate in class AbstractBoundContext<R>protected void copyConversationIdGeneratorAndConversationsToSession()
public void sessionCreated()
protected void associateRequestWithNewConversation()
protected void associateRequest(ManagedConversation conversation)
public void activate()
activate in interface ConversationContextactivate in interface ManagedContextactivate in class AbstractBoundContext<R>public void activate(String cid)
activate in interface ConversationContextprotected void initialize(String cid)
public void deactivate()
deactivate in interface ManagedContextdeactivate in class AbstractBoundContext<R>public void conversationPromotedToLongRunning(ConversationImpl conversation)
public void invalidate()
invalidate in interface ConversationContextinvalidate in interface ManagedContextinvalidate in class AbstractManagedContextpublic boolean destroy(S session)
public String generateConversationId()
generateConversationId in interface ConversationContextprotected ConversationIdGenerator getConversationIdGenerator()
public ManagedConversation getConversation(String id)
getConversation in interface ConversationContextpublic Collection<ManagedConversation> getConversations()
getConversations in interface ConversationContextpublic ManagedConversation getCurrentConversation()
getCurrentConversation in interface ConversationContextpublic Class<? extends Annotation> getScope()
getScope in interface javax.enterprise.context.spi.Contextprotected abstract void setSessionAttribute(R request, String name, Object value, boolean create)
request - the request to set the session attribute inname - the name of the attributevalue - the value of the attributecreate - if false, the attribute will only be set if the session
already exists, otherwise it will always be setIllegalStateException - if create is true, and the session can't be
createdprotected abstract Object getSessionAttribute(R request, String name, boolean create)
request - the request to get the session attribute fromname - the name of the attributecreate - if false, the attribute will only be retrieved if the
session already exists, other wise it will always be retrievedIllegalStateException - if create is true, and the session can't be
createdprotected abstract Object getSessionAttributeFromSession(S session, String name)
session - the session to get the session attribute fromname - the name of the attributeIllegalStateException - if create is true, and the session can't be
createdprotected abstract void removeRequestAttribute(R request, String name)
request - the request to remove the attribute fromname - the name of the attributeprotected abstract void setRequestAttribute(R request, String name, Object value)
request - the request to set the attribute fromname - the name of the attributevalue - the value of the attributeprotected abstract Object getRequestAttribute(R request, String name)
request - the request to get the attribute fromname - the name of the attribute to getprotected abstract BoundBeanStore createRequestBeanStore(NamingScheme namingScheme, R request)
protected abstract BoundBeanStore createSessionBeanStore(NamingScheme namingScheme, S session)
protected abstract String getNamingSchemePrefix()
protected boolean isAssociated()
protected R getRequest()
Copyright © 2017. All rights reserved.