public class MockExecutionContext extends AbstractExecutionContext
ExecutionContext which should be
used for testing. By default it uses MockNamespace as a
Namespace implementation, but you can provide your own
Namespace which will be used.| Constructor and Description |
|---|
MockExecutionContext()
Creates new instance with a
MockNamespace as a Namespace
implementation, no parent context, 0L as the context id and no
ContextModelElement. |
MockExecutionContext(Namespace namespace)
Creates new instance with no parent context, 0L as the context id and no
ContextModelElement. |
MockExecutionContext(Namespace namespace,
ExecutionContext parentContext,
long contextId,
com.whitestein.lsps.model.ContextModelElement element)
Creates new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addExecutionTrace(ExecutionTrace et)
Adds ExecutionTrace to the context.
|
void |
addExecutionTraceElement(ExecutionTraceElement e)
Adds ExecutionTraceElement to the context.
|
void |
addSignal(Object signal)
Adds a signal to the signal queue.
|
void |
flushAll()
Flush of all sessions (core, org, human,...
|
CompiledContext |
getCompiled() |
CompiledContext |
getCompiled(String moduleName) |
ComponentService |
getComponentService()
Returns component service
|
long |
getContextId()
Returns the context id.
|
String |
getEvaluationLevel()
Returns evaluation level.
|
ExecutionTrace |
getExecutionTrace() |
Handle |
getHandle(ValueHolder valueHolder)
Returns a serializable handle for the given value-holder.
|
com.whitestein.lsps.model.ContextModelElement |
getModelElement()
Returns the corresponding context model element.
|
ModelInstance |
getModelInstance()
Returns the model instance.
|
ModelProviderClientService |
getModelProviderService() |
Namespace |
getNamespace()
Returns namespace associated with this context.
|
protected NamespaceModel |
getNamespaceModel()
Returns namespace model for this context.
|
ExecutionContext |
getParentContext()
Returns the parent execution context or null if it does not exist.
|
String |
getPath()
Returns the full path to this context as a string.
|
QID |
getPathQID()
Returns the full path to this context as a QID.
|
ProcessInstance |
getProcessInstance()
Returns the process instance.
|
com.whitestein.lsps.model.ProcessModel |
getProcessModel()
Returns the process model.
|
ValueHolder |
getValueHolder(Handle handle)
Returns a value-holder for the given handle.
|
void |
persist(ValueHolder object)
When getting
ValueHolders from the context, they may be later garbage collected. |
void |
setCompiled(CompiledContext compiledContext) |
void |
setModelInstance(ModelInstance modelInstance)
Sets the model instance.
|
void |
setProcessInstance(ProcessInstance processInstance)
Sets the process instance.
|
void |
setProcessModel(com.whitestein.lsps.model.ProcessModel processModel)
Sets the process model
|
getStackTrace, getStackTraceInfo, getVariableValue, getVariableValue, resolveVariableNamespace, resolveVariableNamespace, setVariableValue, setVariableValue, toStringpublic MockExecutionContext()
MockNamespace as a Namespace
implementation, no parent context, 0L as the context id and no
ContextModelElement.public MockExecutionContext(Namespace namespace)
ContextModelElement.namespace - NullPointerException - if namespace is nullpublic MockExecutionContext(Namespace namespace, ExecutionContext parentContext, long contextId, com.whitestein.lsps.model.ContextModelElement element)
namespace - parentContext - contextId - element - NullPointerException - if namespace is nullpublic Namespace getNamespace()
ExecutionContextprotected NamespaceModel getNamespaceModel()
AbstractExecutionContextgetNamespaceModel in class AbstractExecutionContextpublic void addSignal(Object signal)
ExecutionContextpublic com.whitestein.lsps.model.ContextModelElement getModelElement()
ExecutionContextpublic long getContextId()
ExecutionContextpublic ExecutionContext getParentContext()
ExecutionContextpublic void persist(ValueHolder object)
ExecutionContextValueHolders from the context, they may be later garbage collected. This
method ensures that the object will never be garbage collected.object - object to make persistentpublic Handle getHandle(ValueHolder valueHolder)
HandleResolverHandleResolver.getValueHolder(Handle).valueHolder - the value-holderpublic ValueHolder getValueHolder(Handle handle)
HandleResolverhandle - the handlepublic String getPath()
ExecutionContextpublic QID getPathQID()
ExecutionContextpublic ModelInstance getModelInstance()
ExecutionContextpublic void setModelInstance(ModelInstance modelInstance)
modelInstance - the model instancepublic ProcessInstance getProcessInstance()
ExecutionContextpublic void setProcessInstance(ProcessInstance processInstance)
processInstance - the process instancepublic com.whitestein.lsps.model.ProcessModel getProcessModel()
ExecutionContextpublic void setProcessModel(com.whitestein.lsps.model.ProcessModel processModel)
processModel - the process modelpublic void flushAll()
ExecutionContextpublic String getEvaluationLevel()
ExecutionContextpublic void addExecutionTraceElement(ExecutionTraceElement e)
TraceableExecutionExecutionTrace and
ExecutionTraceElement.e - ExecutionTraceElement to be added.public void addExecutionTrace(ExecutionTrace et)
TraceableExecutionExecutionTrace and
ExecutionTraceElement.et - ExecutionTrace to be added.public ExecutionTrace getExecutionTrace()
ExecutionTrace and
ExecutionTraceElement.public CompiledContext getCompiled()
public void setCompiled(CompiledContext compiledContext)
public CompiledContext getCompiled(String moduleName)
public ModelProviderClientService getModelProviderService()
public ComponentService getComponentService()
ExecutionContextCopyright © 2007-2018 Whitestein Technologies. All Rights Reserved.