Class ExecEnvImpl
- java.lang.Object
-
- org.eclipse.emf.common.notify.impl.BasicNotifierImpl
-
- org.eclipse.emf.ecore.impl.BasicEObjectImpl
-
- org.eclipse.emf.ecore.impl.EObjectImpl
-
- org.eclipse.m2m.atl.emftvm.impl.ExecEnvImpl
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.emf.ecore.impl.BasicEObjectImpl
org.eclipse.emf.ecore.impl.BasicEObjectImpl.EPropertiesHolder, org.eclipse.emf.ecore.impl.BasicEObjectImpl.EPropertiesHolderBaseImpl, org.eclipse.emf.ecore.impl.BasicEObjectImpl.EPropertiesHolderImpl
-
Nested classes/interfaces inherited from class org.eclipse.emf.common.notify.impl.BasicNotifierImpl
org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EAdapterList<E extends java.lang.Object & org.eclipse.emf.common.notify.Adapter>, org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EObservableAdapterList, org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EScannableAdapterList
-
-
Field Summary
Fields Modifier and Type Field Description protected Validator<CodeBlock>cbStackValidatorCode block stack level validator.protected static RuleModeCURRENT_PHASE_EDEFAULTThe default value of the 'Current Phase' attribute.protected RuleModecurrentPhaseThe cached value of the 'Current Phase' attribute.protected java.util.Map<org.eclipse.emf.ecore.EObject,org.eclipse.m2m.atl.emftvm.impl.ExecEnvImpl.DeletionEntry>deletionQueueQueue of elements to be deleted, along with theStackFramecontext in which the deletion takes place.protected FieldContainerfieldContainerField storage and lookup.protected org.eclipse.emf.common.util.EList<Operation>initChainThe chain of 'init()' operations to be executed before the automatic rules.protected java.util.Map<org.eclipse.emf.ecore.resource.Resource,Model>inoutModelOfLookup table of (resource -> model).protected java.util.Map<java.lang.String,Model>inoutModelsThe cached value of the 'Inout Models' attribute.protected java.util.Map<org.eclipse.emf.ecore.resource.Resource,Model>inputModelOfLookup table of (resource -> model).protected java.util.Map<java.lang.String,Model>inputModelsThe cached value of the 'Input Models' attribute.protected Validator<Instruction>instrStackValidatorInstruction stack level validator.protected java.util.Map<java.lang.String,Model>internalInoutModelsThe internal value of the 'Inout Models' attribute.protected java.util.Map<java.lang.String,Model>internalInputModelsThe internal value of the 'Input Models' attribute.protected java.util.Map<java.lang.String,Metamodel>internalMetaModelsThe internal value of the 'Meta Models' attribute.protected java.util.Map<java.lang.String,Module>internalModulesThe internal value of the 'Modules' attribute.protected java.util.Map<java.lang.String,Model>internalOutputModelsThe internal value of the 'Output Models' attribute.protected static booleanJIT_DISABLED_EDEFAULTThe default value of the 'Jit Disabled' attribute.protected booleanjitDisabledThe cached value of the 'Jit Disabled' attribute.protected java.util.Set<java.lang.String>loadedModulesSet of modules that have effectively been loaded.protected org.eclipse.emf.common.util.EList<Operation>mainChainThe chain of 'main()' operations to be executed after the automatic rules.protected TraceLinkSetmatchesThe cached value of the 'Matches' reference.protected java.util.Map<Metamodel,java.lang.String>metaModelIdLookup table of (metamodel -> ID).protected java.util.Map<org.eclipse.emf.ecore.resource.Resource,Metamodel>metaModelOfLookup table of (resource -> metamodel).protected java.util.Map<java.lang.String,Metamodel>metaModelsThe cached value of the 'Meta Models' attribute.protected booleanmodelCacheInitModel cache initialised?protected java.util.Map<Model,java.lang.String>modelIdLookup table of (model -> ID).protected java.util.Map<org.eclipse.emf.ecore.resource.Resource,Model>modelOfLookup table of (resource -> model).protected java.util.Map<java.lang.String,Module>modulesThe cached value of the 'Modules' attribute.protected VMMonitormonitorTheVMMonitorfor the currently running VM instance.protected java.util.Map<java.lang.String,java.util.Map<java.lang.Integer,TypeMap<java.lang.Object,java.lang.Object>>>operationsprotected java.util.Map<org.eclipse.emf.ecore.resource.Resource,Model>outputModelOfLookup table of (resource -> model).protected java.util.Map<java.lang.String,Model>outputModelsThe cached value of the 'Output Models' attribute.protected java.util.Map<org.eclipse.emf.ecore.EObject,org.eclipse.m2m.atl.emftvm.impl.ExecEnvImpl.RemapEntry>remapQueueQueue of source/target values to be remapped, along with theStackFramecontext in which the remapping takes place.protected java.util.Map<java.lang.String,Rule>rulesLookup table for rules: (name -> rule).protected java.util.Queue<org.eclipse.m2m.atl.emftvm.impl.ExecEnvImpl.QueueEntry>setQueueQueueof features/fields to be set, along with theStackFramecontext in which the set takes place.protected java.util.Map<java.lang.String,java.util.Map<java.lang.Integer,TypeMap<java.lang.Object,java.lang.Object>>>staticOperationsprotected TraceLinkSettracesThe cached value of the 'Traces' reference.protected java.util.Map<TraceLink,java.lang.Object>uniqueResultsThe cached value of the 'Unique Results' attribute.-
Fields inherited from class org.eclipse.emf.ecore.impl.EObjectImpl
eAdapters, eContainer, eContainerFeatureID, EDELIVER, EDYNAMIC_CLASS, eFlags, ELAST_EOBJECT_FLAG, ELAST_NOTIFIER_FLAG, eProperties, EPROXY
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedExecEnvImpl()Creates a newExecEnvImpl.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TraceLinkSetbasicGetMatches()Returns the value of the 'Matches' reference.TraceLinkSetbasicGetTraces()Returns the value of the 'Traces' reference.protected voidcacheModels()Caches run-time models in various lookup tables.protected voidclearModelCaches()Clears the model caches.voidclearModels()Removes all registered input, in/out, and output models from thisExecEnv.protected voidclearRuleModels(Rule r)Clears model references for aRule.voiddeleteQueue()Deletes all elements in the deletion queue.java.lang.ObjecteGet(int featureID, boolean resolve, boolean coreType)booleaneIsSet(int featureID)voideSet(int featureID, java.lang.Object newValue)protected org.eclipse.emf.ecore.EClasseStaticClass()Returns theEClassthat correspond to this metaclass.voideUnset(int featureID)FieldfindField(java.lang.Object context, java.lang.String name)OperationfindOperation(java.lang.Object context, java.lang.String name)OperationfindOperation(java.lang.Object context, java.lang.String name, java.lang.Object parameterType)OperationfindOperation(java.lang.Object context, java.lang.String name, java.lang.Object[] parameterTypes)RulefindRule(java.lang.String name)FieldfindStaticField(java.lang.Object context, java.lang.String name)OperationfindStaticOperation(java.lang.Object context, java.lang.String name)OperationfindStaticOperation(java.lang.Object context, java.lang.String name, java.lang.Object parameterType)OperationfindStaticOperation(java.lang.Object context, java.lang.String name, java.lang.Object[] parameterTypes)java.lang.ObjectfindType(java.lang.String modelName, java.lang.String typeName)Finds the type for the given (meta-)modelNameandtypeName.RuleModegetCurrentPhase()ModelgetInoutModelOf(org.eclipse.emf.ecore.EObject object)java.util.Map<java.lang.String,Model>getInoutModels()Returns the value of the 'Inout Models' attribute.ModelgetInputModelOf(org.eclipse.emf.ecore.EObject object)java.util.Map<java.lang.String,Model>getInputModels()Returns the value of the 'Input Models' attribute.CodeBlockJITgetJITCompiler()Returns the JIT compiler instance for this execution environment.TraceLinkSetgetMatches()Returns the value of the 'Matches' reference.MetamodelgetMetaModel(org.eclipse.emf.ecore.resource.Resource resource)java.lang.StringgetMetaModelID(Metamodel metamodel)Returns the ID under whichmetamodelis registered within thisExecEnv.java.util.Map<java.lang.String,Metamodel>getMetaModels()Returns the value of the 'Meta Models' attribute.java.lang.StringgetModelID(Model model)Returns the ID under whichmodelis registered within thisExecEnv.ModelgetModelOf(org.eclipse.emf.ecore.EObject object)java.util.Map<java.lang.String,Module>getModules()Returns the value of the 'Modules' attribute.VMMonitorgetMonitor()ModelgetOutputModelOf(org.eclipse.emf.ecore.EObject object)java.util.Map<java.lang.String,Model>getOutputModels()Returns the value of the 'Output Models' attribute.LazyList<Rule>getRules()Returns all rules registered in thisExecEnv.TraceLinkSetgetTraces()Returns the value of the 'Traces' reference.java.util.Map<TraceLink,java.lang.Object>getUniqueResults()Returns the value of the 'Unique Results' attribute.booleanhasField(java.lang.String name)Returnstrueiff this execution environment has any registered fields with the givenname.booleanhasOperation(java.lang.String name, int argcount)Returnstrueiff this execution environment has any registered operations with the givennameandargcount.booleanhasStaticField(java.lang.String name)Returnstrueiff this execution environment has any registered static fields with the givenname.booleanhasStaticOperation(java.lang.String name, int argcount)Returnstrueiff this execution environment has any registered static operations with the givennameandargcount.booleanisJitDisabled()protected booleanisRuleStateCompiled()Returns whether the internal state of the rules has been compiled.ModuleloadModule(ModuleResolver resolver, java.lang.String name)Loads the module with the givennameand its imports closure into thisExecEnvusing theresolver, and registers its contents for execution.ModuleloadModule(ModuleResolver resolver, java.lang.String name, boolean validate)Loads the module with the givennameand its imports closure into thisExecEnvusing theresolver, and registers its contents for execution.voidqueueForAdd(org.eclipse.emf.ecore.EStructuralFeature feature, org.eclipse.emf.ecore.EObject object, java.lang.Object value, int index, StackFrame frame)Queues the given object and value for adding a value to the given feature.voidqueueForAdd(Field field, java.lang.Object object, java.lang.Object value, int index, StackFrame frame)Queues the given object and value for adding a value to the given feature.voidqueueForDelete(org.eclipse.emf.ecore.EObject element, StackFrame frame)Queueselementfor deletion.voidqueueForRemap(org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EObject target, StackFrame frame)Queues the given source and target value for remapping.voidqueueForRemove(org.eclipse.emf.ecore.EStructuralFeature feature, org.eclipse.emf.ecore.EObject object, java.lang.Object value, StackFrame frame)Queues the given object and value for removing a value from the given feature.voidqueueForRemove(Field field, java.lang.Object object, java.lang.Object value, StackFrame frame)Queues the given object and value for removing a value from the given feature.voidqueueForSet(org.eclipse.emf.ecore.EStructuralFeature feature, org.eclipse.emf.ecore.EObject object, java.lang.Object value, StackFrame frame)Queues the given object and value for setting the given feature.voidqueueForSet(Field field, java.lang.Object object, java.lang.Object value, StackFrame frame)Queues the given object and value for setting the given field.voidqueueXmiIDForAdd(org.eclipse.emf.ecore.EObject object, java.lang.Object value, int index, StackFrame frame)Queues the given object and value for adding to the XMI ID.voidqueueXmiIDForRemove(org.eclipse.emf.ecore.EObject object, java.lang.Object value, StackFrame frame)Queues the given object and value for removing from the XMI ID.voidqueueXmiIDForSet(org.eclipse.emf.ecore.EObject object, java.lang.Object value, StackFrame frame)Queues the given object and value for setting the XMI ID.protected voidregisterFeature(Feature feature)voidregisterInOutModel(java.lang.String name, Model model)Registersmodelas an in/out model undername.voidregisterInputModel(java.lang.String name, Model model)Registersmodelas an input model undername.voidregisterMetaModel(java.lang.String name, Metamodel metamodel)Registersmetamodelundername.voidregisterOutputModel(java.lang.String name, Model model)Registersmodelas an output model undername.protected voidregisterRule(Rule r)voidremapQueue()Processes all element in the "remap" queue.protected voidresetJITCompiler()Sets the JIT compiler instance for this execution environment tonull.protected voidresolveRuleModels(Rule r)Resolves model references for aRule.java.lang.Objectrun(TimingData timingData)Executes the loaded modules and returns the execution result.voidsetJitDisabled(boolean newJitDisabled)voidsetMonitor(VMMonitor monitor)voidsetQueue()Processes all elements in the "set" queue.protected voidsetRuleStateCompiled(boolean ruleStateCompiled)Sets whether the internal state of the rules has been compiled.java.lang.StringtoString()-
Methods inherited from class org.eclipse.emf.ecore.impl.EObjectImpl
eAdapters, eBasicAdapters, eBasicProperties, eBasicSetContainer, eClass, eContainerFeatureID, eDeliver, eInternalContainer, eInvoke, eIsProxy, eProperties, eSetClass, eSetDeliver, eSetProxyURI
-
Methods inherited from class org.eclipse.emf.ecore.impl.BasicEObjectImpl
eAddVirtualValue, eAllContents, eBaseStructuralFeatureID, eBasicRemoveFromContainer, eBasicRemoveFromContainerFeature, eBasicSetContainer, eComputeVirtualValuesCapacity, eContainer, eContainerAdapterArray, eContainingFeature, eContainmentFeature, eContainmentFeature, eContains, eContents, eCrossReferences, eDerivedOperationID, eDerivedOperationID, eDerivedStructuralFeatureID, eDerivedStructuralFeatureID, eDirectResource, eDynamicBasicRemoveFromContainer, eDynamicClass, eDynamicFeature, eDynamicFeatureID, eDynamicGet, eDynamicGet, eDynamicGet, eDynamicInverseAdd, eDynamicInverseAdd, eDynamicInverseRemove, eDynamicInverseRemove, eDynamicInvoke, eDynamicInvoke, eDynamicIsSet, eDynamicIsSet, eDynamicIsSet, eDynamicSet, eDynamicSet, eDynamicSet, eDynamicUnset, eDynamicUnset, eDynamicUnset, eGet, eGet, eGet, eHasSettings, eInternalResource, eInverseAdd, eInverseAdd, eInverseRemove, eInverseRemove, eInvocationDelegate, eInvoke, eIsSet, eObjectForURIFragmentSegment, eOpenGet, eOpenIsSet, eOpenSet, eOpenUnset, eProxyURI, eRemoveVirtualValue, eResolveProxy, eResource, eSet, eSetDirectResource, eSetResource, eSetStore, eSetting, eSettingDelegate, eSettings, eSetVirtualIndexBits, eSetVirtualValue, eSetVirtualValues, eStaticFeatureCount, eStaticOperationCount, eStore, eUnset, eURIFragmentSegment, eVirtualBitCount, eVirtualGet, eVirtualGet, eVirtualIndex, eVirtualIndexBits, eVirtualIsSet, eVirtualSet, eVirtualUnset, eVirtualValue, eVirtualValues
-
Methods inherited from class org.eclipse.emf.common.notify.impl.BasicNotifierImpl
eBasicAdapterArray, eBasicHasAdapters, eNotificationRequired, eNotify
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Field Detail
-
metaModels
protected java.util.Map<java.lang.String,Metamodel> metaModels
The cached value of the 'Meta Models' attribute.- See Also:
getMetaModels()
-
inputModels
protected java.util.Map<java.lang.String,Model> inputModels
The cached value of the 'Input Models' attribute.- See Also:
getInputModels()
-
inoutModels
protected java.util.Map<java.lang.String,Model> inoutModels
The cached value of the 'Inout Models' attribute.- See Also:
getInoutModels()
-
outputModels
protected java.util.Map<java.lang.String,Model> outputModels
The cached value of the 'Output Models' attribute.- See Also:
getOutputModels()
-
modules
protected java.util.Map<java.lang.String,Module> modules
The cached value of the 'Modules' attribute.- See Also:
getModules()
-
matches
protected TraceLinkSet matches
The cached value of the 'Matches' reference.- See Also:
getMatches()
-
traces
protected TraceLinkSet traces
The cached value of the 'Traces' reference.- See Also:
getTraces()
-
uniqueResults
protected java.util.Map<TraceLink,java.lang.Object> uniqueResults
The cached value of the 'Unique Results' attribute.- See Also:
getUniqueResults()
-
JIT_DISABLED_EDEFAULT
protected static final boolean JIT_DISABLED_EDEFAULT
The default value of the 'Jit Disabled' attribute.- See Also:
isJitDisabled(), Constant Field Values
-
jitDisabled
protected boolean jitDisabled
The cached value of the 'Jit Disabled' attribute.- See Also:
isJitDisabled()
-
CURRENT_PHASE_EDEFAULT
protected static final RuleMode CURRENT_PHASE_EDEFAULT
The default value of the 'Current Phase' attribute.- See Also:
getCurrentPhase()
-
currentPhase
protected RuleMode currentPhase
The cached value of the 'Current Phase' attribute.- See Also:
getCurrentPhase()
-
internalMetaModels
protected final java.util.Map<java.lang.String,Metamodel> internalMetaModels
The internal value of the 'Meta Models' attribute.
-
internalInputModels
protected final java.util.Map<java.lang.String,Model> internalInputModels
The internal value of the 'Input Models' attribute.
-
internalInoutModels
protected final java.util.Map<java.lang.String,Model> internalInoutModels
The internal value of the 'Inout Models' attribute.
-
internalOutputModels
protected final java.util.Map<java.lang.String,Model> internalOutputModels
The internal value of the 'Output Models' attribute.
-
internalModules
protected final java.util.Map<java.lang.String,Module> internalModules
The internal value of the 'Modules' attribute.
-
loadedModules
protected final java.util.Set<java.lang.String> loadedModules
Set of modules that have effectively been loaded. Intended for keeping track of cyclic imports.
-
mainChain
protected final org.eclipse.emf.common.util.EList<Operation> mainChain
The chain of 'main()' operations to be executed after the automatic rules.
-
initChain
protected final org.eclipse.emf.common.util.EList<Operation> initChain
The chain of 'init()' operations to be executed before the automatic rules.
-
fieldContainer
protected final FieldContainer fieldContainer
Field storage and lookup.
-
operations
protected final java.util.Map<java.lang.String,java.util.Map<java.lang.Integer,TypeMap<java.lang.Object,java.lang.Object>>> operations
-
staticOperations
protected final java.util.Map<java.lang.String,java.util.Map<java.lang.Integer,TypeMap<java.lang.Object,java.lang.Object>>> staticOperations
-
rules
protected final java.util.Map<java.lang.String,Rule> rules
Lookup table for rules: (name -> rule).
-
modelOf
protected final java.util.Map<org.eclipse.emf.ecore.resource.Resource,Model> modelOf
Lookup table of (resource -> model).
-
inputModelOf
protected final java.util.Map<org.eclipse.emf.ecore.resource.Resource,Model> inputModelOf
Lookup table of (resource -> model).
-
inoutModelOf
protected final java.util.Map<org.eclipse.emf.ecore.resource.Resource,Model> inoutModelOf
Lookup table of (resource -> model).
-
outputModelOf
protected final java.util.Map<org.eclipse.emf.ecore.resource.Resource,Model> outputModelOf
Lookup table of (resource -> model).
-
metaModelOf
protected final java.util.Map<org.eclipse.emf.ecore.resource.Resource,Metamodel> metaModelOf
Lookup table of (resource -> metamodel).
-
modelId
protected final java.util.Map<Model,java.lang.String> modelId
Lookup table of (model -> ID).
-
metaModelId
protected final java.util.Map<Metamodel,java.lang.String> metaModelId
Lookup table of (metamodel -> ID).
-
modelCacheInit
protected boolean modelCacheInit
Model cache initialised?
-
deletionQueue
protected final java.util.Map<org.eclipse.emf.ecore.EObject,org.eclipse.m2m.atl.emftvm.impl.ExecEnvImpl.DeletionEntry> deletionQueue
Queue of elements to be deleted, along with theStackFramecontext in which the deletion takes place.
-
setQueue
protected final java.util.Queue<org.eclipse.m2m.atl.emftvm.impl.ExecEnvImpl.QueueEntry> setQueue
Queueof features/fields to be set, along with theStackFramecontext in which the set takes place.
-
remapQueue
protected final java.util.Map<org.eclipse.emf.ecore.EObject,org.eclipse.m2m.atl.emftvm.impl.ExecEnvImpl.RemapEntry> remapQueue
Queue of source/target values to be remapped, along with theStackFramecontext in which the remapping takes place. Only one queue entry per source value to remap is supported.
-
cbStackValidator
protected final Validator<CodeBlock> cbStackValidator
Code block stack level validator.
-
instrStackValidator
protected final Validator<Instruction> instrStackValidator
Instruction stack level validator.
-
-
Constructor Detail
-
ExecEnvImpl
protected ExecEnvImpl()
Creates a newExecEnvImpl.
-
-
Method Detail
-
eStaticClass
protected org.eclipse.emf.ecore.EClass eStaticClass()
Returns theEClassthat correspond to this metaclass.- Overrides:
eStaticClassin classorg.eclipse.emf.ecore.impl.EObjectImpl- Returns:
- the
EClassthat correspond to this metaclass.
-
getModules
public java.util.Map<java.lang.String,Module> getModules()
Returns the value of the 'Modules' attribute.If the meaning of the 'Modules' reference list isn't clear, there really should be more of a description here...
- Specified by:
getModulesin interfaceExecEnv- Returns:
- the value of the 'Modules' attribute.
- See Also:
EmftvmPackage.getExecEnv_Modules()
-
getMatches
public TraceLinkSet getMatches()
Returns the value of the 'Matches' reference.If the meaning of the 'Matches' reference isn't clear, there really should be more of a description here...
- Specified by:
getMatchesin interfaceExecEnv- Returns:
- the value of the 'Matches' reference.
- See Also:
EmftvmPackage.getExecEnv_Matches()
-
basicGetMatches
public TraceLinkSet basicGetMatches()
Returns the value of the 'Matches' reference.- Returns:
- the value of the 'Matches' reference.
-
getTraces
public TraceLinkSet getTraces()
Returns the value of the 'Traces' reference.If the meaning of the 'Traces' reference isn't clear, there really should be more of a description here...
- Specified by:
getTracesin interfaceExecEnv- Returns:
- the value of the 'Traces' reference.
- See Also:
EmftvmPackage.getExecEnv_Traces()
-
basicGetTraces
public TraceLinkSet basicGetTraces()
Returns the value of the 'Traces' reference.- Returns:
- the value of the 'Traces' reference.
-
getUniqueResults
public java.util.Map<TraceLink,java.lang.Object> getUniqueResults()
Returns the value of the 'Unique Results' attribute.If the meaning of the 'Unique Results' attribute isn't clear, there really should be more of a description here...
- Specified by:
getUniqueResultsin interfaceExecEnv- Returns:
- the value of the 'Unique Results' attribute.
- See Also:
EmftvmPackage.getExecEnv_UniqueResults()
-
isJitDisabled
public boolean isJitDisabled()
- Specified by:
isJitDisabledin interfaceExecEnv- Returns:
- the value of the 'Jit Disabled' attribute.
- See Also:
ExecEnv.setJitDisabled(boolean),EmftvmPackage.getExecEnv_JitDisabled()
-
setJitDisabled
public void setJitDisabled(boolean newJitDisabled)
- Specified by:
setJitDisabledin interfaceExecEnv- Parameters:
newJitDisabled- the new value of the 'Jit Disabled' attribute.- See Also:
ExecEnv.isJitDisabled()
-
getCurrentPhase
public RuleMode getCurrentPhase()
- Specified by:
getCurrentPhasein interfaceExecEnv- Returns:
- the value of the 'Current Phase' attribute.
- See Also:
RuleMode,EmftvmPackage.getExecEnv_CurrentPhase()
-
getMonitor
public VMMonitor getMonitor()
Returns the
VMMonitorfor the currently running VM instance.- Specified by:
getMonitorin interfaceExecEnv- Returns:
- the
VMMonitorfor the currently running VM instance. - See Also:
-
setMonitor
public void setMonitor(VMMonitor monitor)
- Specified by:
setMonitorin interfaceExecEnv
-
registerMetaModel
public void registerMetaModel(java.lang.String name, Metamodel metamodel)Registersmetamodelundername.- Specified by:
registerMetaModelin interfaceExecEnv- Parameters:
name- the name under which to registermetamodel- the metamodel to register
-
registerInputModel
public void registerInputModel(java.lang.String name, Model model)Registersmodelas an input model undername.- Specified by:
registerInputModelin interfaceExecEnv- Parameters:
name- the name under which to registermodel- the model to register
-
registerInOutModel
public void registerInOutModel(java.lang.String name, Model model)Registersmodelas an in/out model undername.- Specified by:
registerInOutModelin interfaceExecEnv- Parameters:
name- the name under which to registermodel- the model to register
-
registerOutputModel
public void registerOutputModel(java.lang.String name, Model model)Registersmodelas an output model undername.- Specified by:
registerOutputModelin interfaceExecEnv- Parameters:
name- the name under which to registermodel- the model to register
-
clearModels
public void clearModels()
Removes all registered input, in/out, and output models from thisExecEnv.- Specified by:
clearModelsin interfaceExecEnv
-
getMetaModel
public Metamodel getMetaModel(org.eclipse.emf.ecore.resource.Resource resource)
- Specified by:
getMetaModelin interfaceExecEnv- Parameters:
resource- the EMFResourceof theMetamodel- Returns:
- the
Metamodel
-
queueForSet
public void queueForSet(org.eclipse.emf.ecore.EStructuralFeature feature, org.eclipse.emf.ecore.EObject object, java.lang.Object value, StackFrame frame)Queues the given object and value for setting the given feature.- Specified by:
queueForSetin interfaceExecEnv- Parameters:
feature- the feature to setobject- the object for which to set the featurevalue- the feature value to setframe- the stack frame context in which to set the feature value
-
queueForSet
public void queueForSet(Field field, java.lang.Object object, java.lang.Object value, StackFrame frame)
Queues the given object and value for setting the given field.- Specified by:
queueForSetin interfaceExecEnv- Parameters:
field- the field to setobject- the object for which to set the fieldvalue- the field value to setframe- the stack frame context in which to set the field value
-
queueXmiIDForSet
public void queueXmiIDForSet(org.eclipse.emf.ecore.EObject object, java.lang.Object value, StackFrame frame)Queues the given object and value for setting the XMI ID.- Specified by:
queueXmiIDForSetin interfaceExecEnv- Parameters:
object- the object for which to set the fieldvalue- the field value to setframe- the stack frame context in which to set the field value
-
queueForAdd
public void queueForAdd(org.eclipse.emf.ecore.EStructuralFeature feature, org.eclipse.emf.ecore.EObject object, java.lang.Object value, int index, StackFrame frame)Queues the given object and value for adding a value to the given feature.- Specified by:
queueForAddin interfaceExecEnv- Parameters:
feature- the feature to add toobject- the object for which to add to the featurevalue- the feature value to addindex- the index at which to add, or-1frame- the stack frame context in which to add to the feature value
-
queueForAdd
public void queueForAdd(Field field, java.lang.Object object, java.lang.Object value, int index, StackFrame frame)
Queues the given object and value for adding a value to the given feature.- Specified by:
queueForAddin interfaceExecEnv- Parameters:
field- the field to add toobject- the object for which to add to the fieldvalue- the field value to addindex- the index at which to add, or-1frame- the stack frame context in which to add to the field value
-
queueXmiIDForAdd
public void queueXmiIDForAdd(org.eclipse.emf.ecore.EObject object, java.lang.Object value, int index, StackFrame frame)Queues the given object and value for adding to the XMI ID.- Specified by:
queueXmiIDForAddin interfaceExecEnv- Parameters:
object- the object for which to add to the fieldvalue- the field value to addindex- the index at which to add, or-1frame- the stack frame context in which to add to the field value
-
queueForRemove
public void queueForRemove(org.eclipse.emf.ecore.EStructuralFeature feature, org.eclipse.emf.ecore.EObject object, java.lang.Object value, StackFrame frame)Queues the given object and value for removing a value from the given feature.- Specified by:
queueForRemovein interfaceExecEnv- Parameters:
feature- the feature to remove fromobject- the object for which to remove from the featurevalue- the feature value to removeframe- the stack frame context in which to remove from the feature value
-
queueForRemove
public void queueForRemove(Field field, java.lang.Object object, java.lang.Object value, StackFrame frame)
Queues the given object and value for removing a value from the given feature.- Specified by:
queueForRemovein interfaceExecEnv- Parameters:
field- the field to remove fromobject- the object for which to remove from the fieldvalue- the field value to removeframe- the stack frame context in which to remove from the field value
-
queueXmiIDForRemove
public void queueXmiIDForRemove(org.eclipse.emf.ecore.EObject object, java.lang.Object value, StackFrame frame)Queues the given object and value for removing from the XMI ID.- Specified by:
queueXmiIDForRemovein interfaceExecEnv- Parameters:
object- the object for which to remove from the fieldvalue- the field value to removeframe- the stack frame context in which to remove from the field value
-
setQueue
public void setQueue()
Processes all elements in the "set" queue. Sets all queued features and fields, and clears the queue.
-
queueForRemap
public void queueForRemap(org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EObject target, StackFrame frame)Queues the given source and target value for remapping.- Specified by:
queueForRemapin interfaceExecEnv- Parameters:
source- the source value to remaptarget- the target value to map toframe- the stack frame context in which to remap
-
remapQueue
public void remapQueue()
Processes all element in the "remap" queue. Remaps all queued source/target value pairs, and clears the queue.- Specified by:
remapQueuein interfaceExecEnv
-
getMetaModels
public java.util.Map<java.lang.String,Metamodel> getMetaModels()
Returns the value of the 'Meta Models' attribute. The default value is"".If the meaning of the 'Meta Models' attribute isn't clear, there really should be more of a description here...
- Specified by:
getMetaModelsin interfaceExecEnv- Returns:
- the value of the 'Meta Models' attribute.
- See Also:
EmftvmPackage.getExecEnv_MetaModels()
-
getInputModels
public java.util.Map<java.lang.String,Model> getInputModels()
Returns the value of the 'Input Models' attribute. The default value is"".If the meaning of the 'Input Models' attribute isn't clear, there really should be more of a description here...
- Specified by:
getInputModelsin interfaceExecEnv- Returns:
- the value of the 'Input Models' attribute.
- See Also:
EmftvmPackage.getExecEnv_InputModels()
-
getInoutModels
public java.util.Map<java.lang.String,Model> getInoutModels()
Returns the value of the 'Inout Models' attribute. The default value is"".If the meaning of the 'Inout Models' attribute isn't clear, there really should be more of a description here...
- Specified by:
getInoutModelsin interfaceExecEnv- Returns:
- the value of the 'Inout Models' attribute.
- See Also:
EmftvmPackage.getExecEnv_InoutModels()
-
getOutputModels
public java.util.Map<java.lang.String,Model> getOutputModels()
Returns the value of the 'Output Models' attribute. The default value is"".If the meaning of the 'Output Models' attribute isn't clear, there really should be more of a description here...
- Specified by:
getOutputModelsin interfaceExecEnv- Returns:
- the value of the 'Output Models' attribute.
- See Also:
EmftvmPackage.getExecEnv_OutputModels()
-
loadModule
public Module loadModule(ModuleResolver resolver, java.lang.String name)
Loads the module with the givennameand its imports closure into thisExecEnvusing theresolver, and registers its contents for execution.- Specified by:
loadModulein interfaceExecEnv- Parameters:
resolver- the module file resolvername- the module name- Returns:
- the loaded module
-
loadModule
public Module loadModule(ModuleResolver resolver, java.lang.String name, boolean validate)
Loads the module with the givennameand its imports closure into thisExecEnvusing theresolver, and registers its contents for execution.- Specified by:
loadModulein interfaceExecEnv- Parameters:
resolver- the module file resolvername- the module namevalidate- iftrue, validates the loaded bytecode- Returns:
- the loaded module
-
registerFeature
protected void registerFeature(Feature feature)
- Parameters:
feature- theFeatureto register
-
resolveRuleModels
protected void resolveRuleModels(Rule r)
Resolves model references for aRule.- Parameters:
rule- theRuleto resolve
-
clearRuleModels
protected void clearRuleModels(Rule r)
Clears model references for aRule.- Parameters:
rule- theRuleto resolve
-
findOperation
public Operation findOperation(java.lang.Object context, java.lang.String name, java.lang.Object[] parameterTypes)
- Specified by:
findOperationin interfaceExecEnv- Parameters:
context- the context type of the operationname- the operation nameparameterTypes- the parameter types of the operation- Returns:
- the
Operationwith the given properties, ornullif none registered
-
findOperation
public Operation findOperation(java.lang.Object context, java.lang.String name)
- Specified by:
findOperationin interfaceExecEnv- Parameters:
context- the context type of the operationname- the operation name- Returns:
- the
Operationwith the given properties, ornullif none registered
-
findOperation
public Operation findOperation(java.lang.Object context, java.lang.String name, java.lang.Object parameterType)
- Specified by:
findOperationin interfaceExecEnv- Parameters:
context- the context type of the operationname- the operation nameparameterType- the parameter type of the operation- Returns:
- the
Operationwith the given properties, ornullif none registered
-
hasOperation
public boolean hasOperation(java.lang.String name, int argcount)Returnstrueiff this execution environment has any registered operations with the givennameandargcount.- Specified by:
hasOperationin interfaceExecEnv- Parameters:
name- the operation nameargcount- the number of operation arguments (excludingself)- Returns:
trueiff this execution environment has any registered operations with the givennameandargcount
-
findStaticOperation
public Operation findStaticOperation(java.lang.Object context, java.lang.String name, java.lang.Object[] parameterTypes)
- Specified by:
findStaticOperationin interfaceExecEnv- Parameters:
context- the context type of the operationname- the operation nameparameterTypes- the parameter types of the operation- Returns:
- the static
Operationwith the given properties, ornullif none registered
-
findStaticOperation
public Operation findStaticOperation(java.lang.Object context, java.lang.String name)
- Specified by:
findStaticOperationin interfaceExecEnv- Parameters:
context- the context type of the operationname- the operation name- Returns:
- the static
Operationwith the given properties, ornullif none registered
-
findStaticOperation
public Operation findStaticOperation(java.lang.Object context, java.lang.String name, java.lang.Object parameterType)
- Specified by:
findStaticOperationin interfaceExecEnv- Parameters:
context- the context type of the operationname- the operation nameparameterType- the parameter type of the operation- Returns:
- the static
Operationwith the given properties, ornullif none registered
-
hasStaticOperation
public boolean hasStaticOperation(java.lang.String name, int argcount)Returnstrueiff this execution environment has any registered static operations with the givennameandargcount.- Specified by:
hasStaticOperationin interfaceExecEnv- Parameters:
name- the operation nameargcount- the number of operation arguments- Returns:
trueiff this execution environment has any registered static operations with the givennameandargcount
-
findField
public Field findField(java.lang.Object context, java.lang.String name)
-
hasField
public boolean hasField(java.lang.String name)
Returnstrueiff this execution environment has any registered fields with the givenname.
-
findStaticField
public Field findStaticField(java.lang.Object context, java.lang.String name)
- Specified by:
findStaticFieldin interfaceExecEnv- Parameters:
context- the context type of the fieldname- the operation name- Returns:
- the static
Fieldwith the given properties, ornullif none registered
-
hasStaticField
public boolean hasStaticField(java.lang.String name)
Returnstrueiff this execution environment has any registered static fields with the givenname.- Specified by:
hasStaticFieldin interfaceExecEnv- Parameters:
name- the field name- Returns:
trueiff this execution environment has any registered static fields with the givenname
-
findRule
public Rule findRule(java.lang.String name)
-
findType
public java.lang.Object findType(java.lang.String modelName, java.lang.String typeName) throws java.lang.ClassNotFoundExceptionFinds the type for the given (meta-)modelNameandtypeName.- Specified by:
findTypein interfaceExecEnv- Parameters:
modelName- the name under which the metamodel that contains the type is registeredtypeName- the type/metaclass name (may be fully qualified using '::')- Returns:
- the type/metaclass
- Throws:
java.lang.ClassNotFoundException- if the type is not found
-
run
public java.lang.Object run(TimingData timingData)
Executes the loaded modules and returns the execution result.
-
cacheModels
protected void cacheModels()
Caches run-time models in various lookup tables.
-
clearModelCaches
protected void clearModelCaches()
Clears the model caches.
-
getModelOf
public Model getModelOf(org.eclipse.emf.ecore.EObject object)
- Specified by:
getModelOfin interfaceExecEnv- Parameters:
object- the object for which to look up the containing model- Returns:
- the
Modelthat containsobject, ornullif not found.
-
getModelID
public java.lang.String getModelID(Model model)
Returns the ID under whichmodelis registered within thisExecEnv.- Specified by:
getModelIDin interfaceExecEnv- Parameters:
model- the registeredModelto retrieve the ID for- Returns:
- the ID under which
modelis registered within thisExecEnv.
-
getMetaModelID
public java.lang.String getMetaModelID(Metamodel metamodel)
Returns the ID under whichmetamodelis registered within thisExecEnv.- Specified by:
getMetaModelIDin interfaceExecEnv- Parameters:
metamodel- the registeredMetamodelto retrieve the ID for- Returns:
- the ID under which
metamodelis registered within thisExecEnv.
-
queueForDelete
public void queueForDelete(org.eclipse.emf.ecore.EObject element, StackFrame frame)Queueselementfor deletion.- Specified by:
queueForDeletein interfaceExecEnv- Parameters:
element- the element to deleteframe- the stack frame context in which to perform the deletion
-
deleteQueue
public void deleteQueue()
Deletes all elements in the deletion queue.- Specified by:
deleteQueuein interfaceExecEnv
-
getInputModelOf
public Model getInputModelOf(org.eclipse.emf.ecore.EObject object)
- Specified by:
getInputModelOfin interfaceExecEnv- Parameters:
object- the object for which to look up the containing model- Returns:
- the input
Modelthat containsobject, ornullif not found.
-
getInoutModelOf
public Model getInoutModelOf(org.eclipse.emf.ecore.EObject object)
- Specified by:
getInoutModelOfin interfaceExecEnv- Parameters:
object- the object for which to look up the containing model- Returns:
- the in/out
Modelthat containsobject, ornullif not found.
-
getOutputModelOf
public Model getOutputModelOf(org.eclipse.emf.ecore.EObject object)
- Specified by:
getOutputModelOfin interfaceExecEnv- Parameters:
object- the object for which to look up the containing model- Returns:
- the output
Modelthat containsobject, ornullif not found.
-
eGet
public java.lang.Object eGet(int featureID, boolean resolve, boolean coreType)- Specified by:
eGetin interfaceorg.eclipse.emf.ecore.InternalEObject- Overrides:
eGetin classorg.eclipse.emf.ecore.impl.BasicEObjectImpl
-
eSet
public void eSet(int featureID, java.lang.Object newValue)- Specified by:
eSetin interfaceorg.eclipse.emf.ecore.InternalEObject- Overrides:
eSetin classorg.eclipse.emf.ecore.impl.BasicEObjectImpl
-
eUnset
public void eUnset(int featureID)
- Specified by:
eUnsetin interfaceorg.eclipse.emf.ecore.InternalEObject- Overrides:
eUnsetin classorg.eclipse.emf.ecore.impl.BasicEObjectImpl
-
eIsSet
public boolean eIsSet(int featureID)
- Specified by:
eIsSetin interfaceorg.eclipse.emf.ecore.InternalEObject- Overrides:
eIsSetin classorg.eclipse.emf.ecore.impl.BasicEObjectImpl
-
toString
public java.lang.String toString()
- Overrides:
toStringin classorg.eclipse.emf.ecore.impl.BasicEObjectImpl
-
getJITCompiler
public CodeBlockJIT getJITCompiler()
Returns the JIT compiler instance for this execution environment.- Specified by:
getJITCompilerin interfaceExecEnv- Returns:
- the JIT compiler instance
-
resetJITCompiler
protected void resetJITCompiler()
Sets the JIT compiler instance for this execution environment tonull.
-
isRuleStateCompiled
protected boolean isRuleStateCompiled()
Returns whether the internal state of the rules has been compiled.- Returns:
- the ruleStateCompiled
-
setRuleStateCompiled
protected void setRuleStateCompiled(boolean ruleStateCompiled)
Sets whether the internal state of the rules has been compiled.- Parameters:
ruleStateCompiled- the ruleStateCompiled to set
-
-