org.sintef.mofscript.runtime.traceability
Class TraceabilityEnvironment

java.lang.Object
  extended by org.sintef.mofscript.runtime.ExecutionEnvironment
      extended by org.sintef.mofscript.runtime.traceability.TraceabilityEnvironment

public class TraceabilityEnvironment
extends ExecutionEnvironment

The Traceability Environment is used to provide extra functionality to the environment when traceability is turned on.

Author:
jol, gko

Nested Class Summary
 class TraceabilityEnvironment.OffsetCounter
          Class to handle the counting of offset
 
Field Summary
protected static int _traceCount
           
protected static TraceabilitymodelFactory _traceFactory
           
protected static TraceModel _traceModel
           
protected static TraceabilitymodelPackage _tracePackage
           
 
Fields inherited from class org.sintef.mofscript.runtime.ExecutionEnvironment
_currentStream, _inPrintAction, _lineNumber, _objectId, _offsets, _openFileUri, _parentEnv, _printStreams, _streamContexts, _streams, _tempObject, _tempRef, _traceValue, _variablesRefValues
 
Constructor Summary
TraceabilityEnvironment()
          Default constructor
 
Method Summary
static void cleanTraceEnv()
           
 Trace createTrace(java.lang.String refValue, int offset, int refLength, org.eclipse.emf.ecore.EObject object, java.lang.String feature, RuleExecutor rExec, java.lang.String fullRefName)
          creates a trace
 void endUnprotectedBlock()
           
static java.lang.String getObjectId(org.eclipse.emf.ecore.EObject obj)
           
protected  void loadTraceabilityModel()
          Load the traceablity model from file?
 void print(java.lang.String s, boolean println)
          Overrides the print function
static void resetTraceCounter()
          Resets the trace counter Called from ExecutionManager when execution is finished
 void startUnprotectedBlock(java.lang.String objectUri)
           
 void storeTraceablityModel(java.lang.String traceGenDir)
          Stores the traceability model
 
Methods inherited from class org.sintef.mofscript.runtime.ExecutionEnvironment
addInputObject, addOutputStream, addVariable, addVariableInfo, addVariables, assignValue, assignVariableValue, clean, cleanLocal, cleanResources, clearInputObject, clearReferenceCache, finalize, findVariable, getCachedReference, getCurrentPrintStream, getCurrentStream, getCurrentStreamUri, getFileModel, getIndent, getInputObject, getIteratorCount, getIteratorPosition, getLineNumber, getOutputStream, getOutputStreamForContext, getParentEnvironment, getPrintStreamForContext, getResources, getUseFileModel, getUseLog, getVariable, getVariableEObject, getVariableImplementation, getVariableInfo, getVariableRefName, getVariableValue, increaseIteratorCount, increaseIteratorPosition, increaseLineNumber, indent, initIteratorCounters, isInPrintAction, isUnprotectedBlock, log, notifyMessage, println, removeVariable, removeVariableInfo, resetBlockCounter, setCachedReference, setCurrentStream, setCurrentStream, setInPrintAction, setOwnerStack, setParentEnvironment, setPrintContext, setRootDirectory, setTrace, setTypeForVariable, setUnprotectedBlock, setUseFileModel, setUseLog, setUseParentCache, setVariable, setVariableInfo, storeFiles, undent, useIndent
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_tracePackage

protected static TraceabilitymodelPackage _tracePackage

_traceFactory

protected static TraceabilitymodelFactory _traceFactory

_traceModel

protected static TraceModel _traceModel

_traceCount

protected static int _traceCount
Constructor Detail

TraceabilityEnvironment

public TraceabilityEnvironment()
Default constructor

Method Detail

print

public void print(java.lang.String s,
                  boolean println)
Overrides the print function

Overrides:
print in class ExecutionEnvironment
Parameters:
s -
println -

createTrace

public Trace createTrace(java.lang.String refValue,
                         int offset,
                         int refLength,
                         org.eclipse.emf.ecore.EObject object,
                         java.lang.String feature,
                         RuleExecutor rExec,
                         java.lang.String fullRefName)
creates a trace

Parameters:
offset -
object -
feature -
rExec -

getObjectId

public static java.lang.String getObjectId(org.eclipse.emf.ecore.EObject obj)

loadTraceabilityModel

protected void loadTraceabilityModel()
Load the traceablity model from file? Or create a new traceability model


storeTraceablityModel

public void storeTraceablityModel(java.lang.String traceGenDir)
Stores the traceability model


resetTraceCounter

public static void resetTraceCounter()
Resets the trace counter Called from ExecutionManager when execution is finished


cleanTraceEnv

public static void cleanTraceEnv()

startUnprotectedBlock

public void startUnprotectedBlock(java.lang.String objectUri)
Overrides:
startUnprotectedBlock in class ExecutionEnvironment

endUnprotectedBlock

public void endUnprotectedBlock()
Overrides:
endUnprotectedBlock in class ExecutionEnvironment