org.camunda.bpm.engine.cdi.impl.context
Class DefaultContextAssociationManager

java.lang.Object
  extended by org.camunda.bpm.engine.cdi.impl.context.DefaultContextAssociationManager
All Implemented Interfaces:
Serializable, ContextAssociationManager

public class DefaultContextAssociationManager
extends Object
implements ContextAssociationManager, Serializable

Default implementation of the business process association manager. Uses a fallback-strategy to associate the process instance with the "broadest" active scope, starting with the conversation.

Subclass in order to implement custom association schemes and association with custom scopes.

Author:
Daniel Meyer
See Also:
Serialized Form

Nested Class Summary
protected static class DefaultContextAssociationManager.ConversationScopedAssociation
           
protected static class DefaultContextAssociationManager.RequestScopedAssociation
           
protected static class DefaultContextAssociationManager.ScopedAssociation
           
 
Constructor Summary
DefaultContextAssociationManager()
           
 
Method Summary
 void disAssociate()
          Disassociates the current process instance with a context / scope
protected  void ensureCommandContextNotActive()
           
 void flushVariableCache()
          allows to flush the cached variables.
protected  List<Class<? extends DefaultContextAssociationManager.ScopedAssociation>> getAvailableScopedAssociationClasses()
          Override to add different / additional contexts.
protected  Class<? extends DefaultContextAssociationManager.ScopedAssociation> getBroadestActiveContext()
           
 Map<String,Object> getCachedVariables()
           
 Map<String,Object> getCachedVariablesLocal()
           
 Execution getExecution()
          get the current execution
protected  ExecutionEntity getExecutionFromContext()
           
 String getExecutionId()
           
protected  DefaultContextAssociationManager.ScopedAssociation getScopedAssociation()
           
 Task getTask()
          get the current task
 Object getVariable(String variableName)
          get a process variable
 Object getVariableLocal(String variableName)
          get a local process variable
 void setExecution(Execution execution)
          associate with the provided execution
 void setTask(Task task)
          set a current task
 void setVariable(String variableName, Object value)
          set a process variable
 void setVariableLocal(String variableName, Object value)
          set a local process variable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultContextAssociationManager

public DefaultContextAssociationManager()
Method Detail

getBroadestActiveContext

protected Class<? extends DefaultContextAssociationManager.ScopedAssociation> getBroadestActiveContext()

getAvailableScopedAssociationClasses

protected List<Class<? extends DefaultContextAssociationManager.ScopedAssociation>> getAvailableScopedAssociationClasses()
Override to add different / additional contexts.


getScopedAssociation

protected DefaultContextAssociationManager.ScopedAssociation getScopedAssociation()

setExecution

public void setExecution(Execution execution)
Description copied from interface: ContextAssociationManager
associate with the provided execution

Specified by:
setExecution in interface ContextAssociationManager

disAssociate

public void disAssociate()
Description copied from interface: ContextAssociationManager
Disassociates the current process instance with a context / scope

Specified by:
disAssociate in interface ContextAssociationManager

getExecutionId

public String getExecutionId()
Specified by:
getExecutionId in interface ContextAssociationManager
Returns:
the id of the execution currently associated or null

getExecution

public Execution getExecution()
Description copied from interface: ContextAssociationManager
get the current execution

Specified by:
getExecution in interface ContextAssociationManager

getVariable

public Object getVariable(String variableName)
Description copied from interface: ContextAssociationManager
get a process variable

Specified by:
getVariable in interface ContextAssociationManager

setVariable

public void setVariable(String variableName,
                        Object value)
Description copied from interface: ContextAssociationManager
set a process variable

Specified by:
setVariable in interface ContextAssociationManager

getVariableLocal

public Object getVariableLocal(String variableName)
Description copied from interface: ContextAssociationManager
get a local process variable

Specified by:
getVariableLocal in interface ContextAssociationManager

setVariableLocal

public void setVariableLocal(String variableName,
                             Object value)
Description copied from interface: ContextAssociationManager
set a local process variable

Specified by:
setVariableLocal in interface ContextAssociationManager

getExecutionFromContext

protected ExecutionEntity getExecutionFromContext()

getTask

public Task getTask()
Description copied from interface: ContextAssociationManager
get the current task

Specified by:
getTask in interface ContextAssociationManager

setTask

public void setTask(Task task)
Description copied from interface: ContextAssociationManager
set a current task

Specified by:
setTask in interface ContextAssociationManager

getCachedVariables

public Map<String,Object> getCachedVariables()
Specified by:
getCachedVariables in interface ContextAssociationManager
Returns:
a map of process variables cached between flushes

getCachedVariablesLocal

public Map<String,Object> getCachedVariablesLocal()
Specified by:
getCachedVariablesLocal in interface ContextAssociationManager
Returns:
a map of local process variables cached between flushes

flushVariableCache

public void flushVariableCache()
Description copied from interface: ContextAssociationManager
allows to flush the cached variables.

Specified by:
flushVariableCache in interface ContextAssociationManager

ensureCommandContextNotActive

protected void ensureCommandContextNotActive()


Copyright © 2014 camunda services GmbH. All Rights Reserved.