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
ValueHolder s 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, toString
public 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()
ExecutionContext
protected NamespaceModel getNamespaceModel()
AbstractExecutionContext
getNamespaceModel
in class AbstractExecutionContext
public void addSignal(Object signal)
ExecutionContext
public com.whitestein.lsps.model.ContextModelElement getModelElement()
ExecutionContext
public long getContextId()
ExecutionContext
public ExecutionContext getParentContext()
ExecutionContext
public void persist(ValueHolder object)
ExecutionContext
ValueHolder
s 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)
HandleResolver
HandleResolver.getValueHolder(Handle)
.valueHolder
- the value-holderpublic ValueHolder getValueHolder(Handle handle)
HandleResolver
handle
- the handlepublic String getPath()
ExecutionContext
public QID getPathQID()
ExecutionContext
public ModelInstance getModelInstance()
ExecutionContext
public void setModelInstance(ModelInstance modelInstance)
modelInstance
- the model instancepublic ProcessInstance getProcessInstance()
ExecutionContext
public void setProcessInstance(ProcessInstance processInstance)
processInstance
- the process instancepublic com.whitestein.lsps.model.ProcessModel getProcessModel()
ExecutionContext
public void setProcessModel(com.whitestein.lsps.model.ProcessModel processModel)
processModel
- the process modelpublic void flushAll()
ExecutionContext
public String getEvaluationLevel()
ExecutionContext
public void addExecutionTraceElement(ExecutionTraceElement e)
TraceableExecution
ExecutionTrace
and
ExecutionTraceElement
.e
- ExecutionTraceElement to be added.public void addExecutionTrace(ExecutionTrace et)
TraceableExecution
ExecutionTrace
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()
ExecutionContext
Copyright © 2007-2018 Whitestein Technologies. All Rights Reserved.