org.granite.client.tide.impl
Class SimpleContextManager
java.lang.Object
org.granite.client.tide.impl.SimpleContextManager
- All Implemented Interfaces:
- ContextManager
- Direct Known Subclasses:
- CDIContextManager, SpringContextManager
public class SimpleContextManager
- extends Object
- implements ContextManager
- Author:
- William DRAI
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CONTEXT_CREATE
public static final String CONTEXT_CREATE
- See Also:
- Constant Field Values
CONTEXT_DESTROY
public static final String CONTEXT_DESTROY
- See Also:
- Constant Field Values
platform
protected final Platform platform
eventBus
protected final EventBus eventBus
SimpleContextManager
protected SimpleContextManager()
SimpleContextManager
public SimpleContextManager(Platform platform)
SimpleContextManager
public SimpleContextManager(Platform platform,
EventBus eventBus)
setInstanceStoreFactory
public void setInstanceStoreFactory(InstanceStoreFactory instanceStoreFactory)
- Specified by:
setInstanceStoreFactory in interface ContextManager
setBeanManager
public void setBeanManager(BeanManager beanManager)
- Specified by:
setBeanManager in interface ContextManager
isGlobal
public boolean isGlobal(Context context)
- Determine if the specified context is the global one
- Parameters:
context -
- Returns:
- true if global
getContext
public Context getContext()
- Return the global context
- Specified by:
getContext in interface ContextManager
- Returns:
- context
getContext
public Context getContext(String contextId)
- Return a context from its id
- Specified by:
getContext in interface ContextManager
- Parameters:
contextId - context id
- Returns:
- context
createContext
protected Context createContext(Context parentCtx,
String contextId)
getContext
public Context getContext(String contextId,
String parentContextId,
boolean create)
- Return a context from its id
- Specified by:
getContext in interface ContextManager
- Parameters:
contextId - context idcreate - should create when not existing
- Returns:
- context
newContext
public Context newContext(String contextId,
String parentContextId)
- Specified by:
newContext in interface ContextManager
- Parameters:
contextId - the requested context id
- Returns:
- the context
destroyContext
public void destroyContext(String contextId,
boolean force)
- Specified by:
destroyContext in interface ContextManager
- Parameters:
contextId - context idforce - force complete destruction of context
getAllContexts
public List<Context> getAllContexts()
- Returns the list of conversation contexts
- Specified by:
getAllContexts in interface ContextManager
- Returns:
- conversation contexts
destroyContexts
public void destroyContexts(boolean force)
- Specified by:
destroyContexts in interface ContextManager
- Parameters:
force - force complete destruction of contexts (all event listeners...), used for testing
destroyFinishedContexts
public void destroyFinishedContexts()
- Specified by:
destroyFinishedContexts in interface ContextManager
removeFromContextsToDestroy
public void removeFromContextsToDestroy(String contextId)
- Specified by:
removeFromContextsToDestroy in interface ContextManager
- Parameters:
contextId - context id
addToContextsToDestroy
public void addToContextsToDestroy(String contextId)
- Specified by:
addToContextsToDestroy in interface ContextManager
- Parameters:
contextId - context id
retrieveContext
public Context retrieveContext(Context sourceContext,
String contextId,
boolean wasConversationCreated,
boolean wasConversationEnded)
- Specified by:
retrieveContext in interface ContextManager
updateContextId
public void updateContextId(String previousContextId,
Context context)
- Specified by:
updateContextId in interface ContextManager
- Parameters:
previousContextId - existing idcontext - new context