public class MockTaskContext extends Object implements TaskContext
| Constructor and Description |
|---|
MockTaskContext()
Creates new instance.
|
MockTaskContext(ExecutionContext executionContext)
Creates new instance.
|
MockTaskContext(ExecutionContext executionContext,
com.whitestein.lsps.model.Task task,
long taskId,
Map<String,?> parameters)
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()
Returns compiled context.
|
CompiledContext |
getCompiled(String moduleName)
Returns compiled context of the module
|
ComponentService |
getComponentService()
Returns component service
|
long |
getContextId()
Returns the context id.
|
RuntimeToPersistentConverter |
getConverter()
Returns converter.
|
String |
getEvaluationLevel()
Returns evaluation level.
|
ExecutionTrace |
getExecutionTrace() |
Handle |
getHandle(ValueHolder valueHolder)
Returns a serializable handle for the given value-holder.
|
Identifier |
getIdentifier()
Returns the identifier of this task.
|
com.whitestein.lsps.model.ContextModelElement |
getModelElement()
Returns the corresponding context model element.
|
ModelInstance |
getModelInstance()
Returns the model instance.
|
ModelProvider |
getModelProvider()
Returns model provider.
|
Namespace |
getNamespace()
Returns namespace associated with this context.
|
Object |
getParameter(String name)
Returns a parameter by name.
|
Set<String> |
getParameterNames()
Returns a set of the task parameter names.
|
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.
|
String |
getProcessPath()
Returns the full path to model element that is bound to this context.
|
QID |
getProcessPathQID()
Returns the full path to model element that is bound to this context.
|
InterpreterStackTrace |
getStackTrace()
Returns the interpreter stack trace.
|
String[] |
getStackTraceInfo()
Returns the stack trace info from the interpreter stack trace.
|
com.whitestein.lsps.model.Task |
getTask()
Returns the task model element.
|
long |
getTaskId()
Returns the task instance id.
|
ValueHolder |
getValueHolder(Handle handle)
Returns a value-holder for the given handle.
|
Object |
getVariableValue(QID name)
Resolves variable for given name and returns its value.
|
Object |
getVariableValue(String name)
Deprecated.
|
Namespace |
resolveVariableNamespace(QID name)
Resolves variable for given name and returns its containing namespace.
|
Namespace |
resolveVariableNamespace(String name)
Deprecated.
|
void |
setCompiled(CompiledContext compiledContext)
Sets compiled context.
|
void |
setVariableValue(QID name,
Object value)
Resolves variable for given name and sets its value.
|
void |
setVariableValue(String name,
Object value)
Deprecated.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetInLevelpublic MockTaskContext()
public MockTaskContext(ExecutionContext executionContext)
executionContext - public MockTaskContext(ExecutionContext executionContext, com.whitestein.lsps.model.Task task, long taskId, Map<String,?> parameters)
executionContext - task - taskId - parameters - public InterpreterStackTrace getStackTrace()
ExecutionContexterror exceptions.
The method returns null if the execution context is not a
JavaOperationExecutionContext.
getStackTrace in interface ExecutionContextnullpublic String[] getStackTraceInfo()
ExecutionContextShould be equivalent to
return getStackTrace() != null ? getStackTrace().getStackTraceInfo() : null;
getStackTraceInfo in interface ExecutionContextpublic com.whitestein.lsps.model.Task getTask()
TaskContextgetTask in interface TaskContextpublic long getTaskId()
TaskContextgetTaskId in interface TaskContextpublic Set<String> getParameterNames()
TaskContextgetParameterNames in interface TaskContextpublic Object getParameter(String name)
TaskContextgetParameter in interface TaskContextpublic Identifier getIdentifier()
TaskContextgetIdentifier in interface TaskContextpublic Namespace getNamespace()
ExecutionContextgetNamespace in interface ExecutionContextpublic Object getVariableValue(QID name)
ExecutionContext
Difference between this method and
Namespace.getVariableValue(String) is that the latter return only value directly from
its namespace while this one does resolution of namespace and calls
Namespace.getVariableValue(String) on the resolved namespace.
getVariableValue in interface ExecutionContextname - a variable namepublic void setVariableValue(QID name, Object value)
ExecutionContext
Difference between this method and
Namespace.setVariableValue(String, Object) is that the latter sets variable
directly from its namespace while this one does resolution of namespace and calls
Namespace.setVariableValue(String, Object) on the resolved namespace.
setVariableValue in interface ExecutionContextname - a variable namevalue - a new variable valuepublic Namespace resolveVariableNamespace(QID name)
ExecutionContext
The resolution goes primarily into parents, if it fails then it looks in the imports.
The resolution throws IllegalArgumentException if the variable is not found
or the name is ambiguous.
resolveVariableNamespace in interface ExecutionContextname - variable name@Deprecated public Object getVariableValue(String name)
ExecutionContext
Difference between this method and
Namespace.getVariableValue(String) is that the latter return only value directly from
its namespace while this one does resolution of namespace and calls
Namespace.getVariableValue(String) on the resolved namespace.
Known issue: The name parameter should be unescaped name. The method may not work correctly if the variable name is a full name (i.e. with module prefix) and contains special characters.
getVariableValue in interface ExecutionContextname - a variable name@Deprecated public void setVariableValue(String name, Object value)
ExecutionContext
Difference between this method and
Namespace.setVariableValue(String, Object) is that the latter sets variable
directly from its namespace while this one does resolution of namespace and calls
Namespace.setVariableValue(String, Object) on the resolved namespace.
Known issue: The name parameter should be unescaped name. The method may not work correctly if the variable name is a full name (i.e. with module prefix) and contains special characters.
setVariableValue in interface ExecutionContextname - a variable namevalue - a new variable value@Deprecated public Namespace resolveVariableNamespace(String name)
ExecutionContext
The resolution goes primarily into parents, if it fails then it looks in the imports.
The resolution throws IllegalArgumentException if the variable is not found
or the name is ambiguous.
Known issue: The name parameter should be unescaped name. The method may not work correctly if the variable name is a full name (i.e. with module prefix) and contains special characters.
resolveVariableNamespace in interface ExecutionContextname - variable namepublic void addSignal(Object signal)
ExecutionContextaddSignal in interface ExecutionContextpublic com.whitestein.lsps.model.ContextModelElement getModelElement()
ExecutionContextgetModelElement in interface ExecutionContextpublic long getContextId()
ExecutionContextgetContextId in interface ExecutionContextpublic ExecutionContext getParentContext()
ExecutionContextgetParentContext in interface ExecutionContextpublic Handle getHandle(ValueHolder valueHolder)
HandleResolverHandleResolver.getValueHolder(Handle).getHandle in interface HandleResolvervalueHolder - the value-holderpublic ValueHolder getValueHolder(Handle handle)
HandleResolvergetValueHolder in interface HandleResolverhandle - the handlepublic String getPath()
ExecutionContextgetPath in interface ExecutionContextpublic QID getPathQID()
ExecutionContextgetPathQID in interface ExecutionContextpublic String getProcessPath()
ExecutionContextgetProcessPath in interface ExecutionContextpublic QID getProcessPathQID()
ExecutionContextgetProcessPathQID in interface ExecutionContextpublic ModelInstance getModelInstance()
ExecutionContextgetModelInstance in interface ExecutionContextpublic ProcessInstance getProcessInstance()
ExecutionContextgetProcessInstance in interface ExecutionContextpublic com.whitestein.lsps.model.ProcessModel getProcessModel()
ExecutionContextgetProcessModel in interface ExecutionContextpublic void flushAll()
ExecutionContextflushAll in interface ExecutionContextpublic String getEvaluationLevel()
ExecutionContextgetEvaluationLevel in interface ExecutionContextpublic void addExecutionTraceElement(ExecutionTraceElement e)
TraceableExecutionExecutionTrace and
ExecutionTraceElement.addExecutionTraceElement in interface TraceableExecutione - ExecutionTraceElement to be added.public void addExecutionTrace(ExecutionTrace et)
TraceableExecutionExecutionTrace and
ExecutionTraceElement.addExecutionTrace in interface TraceableExecutionet - ExecutionTrace to be added.public ExecutionTrace getExecutionTrace()
getExecutionTrace in interface TraceableExecutionExecutionTrace and
ExecutionTraceElement.public CompiledContext getCompiled()
ExecutionContextgetCompiled in interface ExecutionContextpublic void setCompiled(CompiledContext compiledContext)
ExecutionContextsetCompiled in interface ExecutionContextpublic CompiledContext getCompiled(String moduleName)
ExecutionContextgetCompiled in interface ExecutionContextpublic ModelProvider getModelProvider()
ExecutionContextgetModelProvider in interface ExecutionContextpublic ComponentService getComponentService()
ExecutionContextgetComponentService in interface ExecutionContextpublic RuntimeToPersistentConverter getConverter()
ExecutionContextgetConverter in interface ExecutionContextCopyright © 2007-2020 Whitestein Technologies. All Rights Reserved.