Interface ExecEnv

  • All Superinterfaces:
    org.eclipse.emf.ecore.EObject, org.eclipse.emf.common.notify.Notifier
    All Known Implementing Classes:
    ExecEnvImpl

    public interface ExecEnv
    extends org.eclipse.emf.ecore.EObject
    A representation of the model object 'Exec Env'.
    See Also:
    EmftvmPackage.getExecEnv()
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void clearModels()
      Removes all registered input, in/out, and output models from this ExecEnv.
      void deleteQueue()
      Deletes all elements in the deletion queue.
      Field findField​(java.lang.Object context, java.lang.String name)
      Finds a Field registered within this ExecEnv.
      Operation findOperation​(java.lang.Object context, java.lang.String name)
      Finds an Operation registered within this ExecEnv.
      Operation findOperation​(java.lang.Object context, java.lang.String name, java.lang.Object parameterType)
      Finds an Operation registered within this ExecEnv.
      Operation findOperation​(java.lang.Object context, java.lang.String name, java.lang.Object[] parameterTypes)
      Finds an Operation registered within this ExecEnv.
      Rule findRule​(java.lang.String name)
      Finds a Rule registered within this ExecEnv.
      Field findStaticField​(java.lang.Object context, java.lang.String name)
      Finds a static Field registered within this ExecEnv.
      Operation findStaticOperation​(java.lang.Object context, java.lang.String name)
      Finds a static Operation registered within this ExecEnv.
      Operation findStaticOperation​(java.lang.Object context, java.lang.String name, java.lang.Object parameterType)
      Finds a static Operation registered within this ExecEnv.
      Operation findStaticOperation​(java.lang.Object context, java.lang.String name, java.lang.Object[] parameterTypes)
      Finds a static Operation registered within this ExecEnv.
      java.lang.Object findType​(java.lang.String modelName, java.lang.String typeName)
      Finds the type for the given (meta-)modelName and typeName.
      RuleMode getCurrentPhase()
      Returns the value of the 'Current Phase' attribute.
      Model getInoutModelOf​(org.eclipse.emf.ecore.EObject object)
      Returns the in/out Model that is registered in this ExecEnv, and that contains object.
      java.util.Map<java.lang.String,​Model> getInoutModels()
      Returns the value of the 'Inout Models' attribute.
      Model getInputModelOf​(org.eclipse.emf.ecore.EObject object)
      Returns the input Model that is registered in this ExecEnv, and that contains object.
      java.util.Map<java.lang.String,​Model> getInputModels()
      Returns the value of the 'Input Models' attribute.
      CodeBlockJIT getJITCompiler()
      Returns the JIT compiler instance for this execution environment.
      TraceLinkSet getMatches()
      Returns the value of the 'Matches' reference.
      Metamodel getMetaModel​(org.eclipse.emf.ecore.resource.Resource resource)
      Returns the Metamodel for the given resource, or null.
      java.lang.String getMetaModelID​(Metamodel metamodel)
      Returns the ID under which metamodel is registered within this ExecEnv.
      java.util.Map<java.lang.String,​Metamodel> getMetaModels()
      Returns the value of the 'Meta Models' attribute.
      java.lang.String getModelID​(Model model)
      Returns the ID under which model is registered within this ExecEnv.
      Model getModelOf​(org.eclipse.emf.ecore.EObject object)
      Returns the Model that is registered in this ExecEnv, and that contains object.
      java.util.Map<java.lang.String,​Module> getModules()
      Returns the value of the 'Modules' attribute.
      VMMonitor getMonitor()
      Model getOutputModelOf​(org.eclipse.emf.ecore.EObject object)
      Returns the output Model that is registered in this ExecEnv, and that contains 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 this ExecEnv.
      TraceLinkSet getTraces()
      Returns the value of the 'Traces' reference.
      java.util.Map<TraceLink,​java.lang.Object> getUniqueResults()
      Returns the value of the 'Unique Results' attribute.
      boolean hasField​(java.lang.String name)
      Returns true iff this execution environment has any registered fields with the given name.
      boolean hasOperation​(java.lang.String name, int argcount)
      Returns true iff this execution environment has any registered operations with the given name and argcount.
      boolean hasStaticField​(java.lang.String name)
      Returns true iff this execution environment has any registered static fields with the given name.
      boolean hasStaticOperation​(java.lang.String name, int argcount)
      Returns true iff this execution environment has any registered static operations with the given name and argcount.
      boolean isJitDisabled()
      Returns the value of the 'Jit Disabled' attribute.
      Module loadModule​(ModuleResolver resolver, java.lang.String name)
      Loads the module with the given name and its imports closure into this ExecEnv using the resolver, and registers its contents for execution.
      Module loadModule​(ModuleResolver resolver, java.lang.String name, boolean validate)
      Loads the module with the given name and its imports closure into this ExecEnv using the resolver, and registers its contents for execution.
      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.
      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.
      void queueForDelete​(org.eclipse.emf.ecore.EObject element, StackFrame frame)
      Queues element for deletion.
      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.
      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.
      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.
      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.
      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.
      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.
      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.
      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.
      void registerInOutModel​(java.lang.String name, Model model)
      Registers model as an in/out model under name.
      void registerInputModel​(java.lang.String name, Model model)
      Registers model as an input model under name.
      void registerMetaModel​(java.lang.String name, Metamodel metamodel)
      Registers metamodel under name.
      void registerOutputModel​(java.lang.String name, Model model)
      Registers model as an output model under name.
      void remapQueue()
      Processes all element in the "remap" queue.
      java.lang.Object run​(TimingData timingData)
      Executes the loaded modules and returns the execution result.
      void setJitDisabled​(boolean value)
      Sets the value of the 'Jit Disabled' attribute.
      void setMonitor​(VMMonitor monitor)
      void setQueue()
      Processes all elements in the "set" queue.
      • Methods inherited from interface org.eclipse.emf.ecore.EObject

        eAllContents, eClass, eContainer, eContainingFeature, eContainmentFeature, eContents, eCrossReferences, eGet, eGet, eInvoke, eIsProxy, eIsSet, eResource, eSet, eUnset
      • Methods inherited from interface org.eclipse.emf.common.notify.Notifier

        eAdapters, eDeliver, eNotify, eSetDeliver
    • Method Detail

      • getModules

        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...

        Returns:
        the value of the 'Modules' attribute.
        See Also:
        EmftvmPackage.getExecEnv_Modules()
      • getMatches

        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...

        Returns:
        the value of the 'Matches' reference.
        See Also:
        EmftvmPackage.getExecEnv_Matches()
      • getTraces

        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...

        Returns:
        the value of the 'Traces' reference.
        See Also:
        EmftvmPackage.getExecEnv_Traces()
      • getUniqueResults

        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...

        Returns:
        the value of the 'Unique Results' attribute.
        See Also:
        EmftvmPackage.getExecEnv_UniqueResults()
      • isJitDisabled

        boolean isJitDisabled()
        Returns the value of the 'Jit Disabled' attribute.

        If the meaning of the 'Jit Disabled' attribute isn't clear, there really should be more of a description here...

        Returns:
        the value of the 'Jit Disabled' attribute.
        See Also:
        setJitDisabled(boolean), EmftvmPackage.getExecEnv_JitDisabled()
      • setJitDisabled

        void setJitDisabled​(boolean value)
        Sets the value of the 'Jit Disabled' attribute.
        Parameters:
        value - the new value of the 'Jit Disabled' attribute.
        See Also:
        isJitDisabled()
      • getCurrentPhase

        RuleMode getCurrentPhase()
        Returns the value of the 'Current Phase' attribute. The default value is "manual". The literals are from the enumeration RuleMode.

        If the meaning of the 'Current Phase' attribute isn't clear, there really should be more of a description here...

        Returns:
        the value of the 'Current Phase' attribute.
        See Also:
        RuleMode, EmftvmPackage.getExecEnv_CurrentPhase()
      • getMonitor

        VMMonitor getMonitor()

        Returns the VMMonitor for the currently running VM instance.

        Returns:
        the VMMonitor for the currently running VM instance.
        See Also:
      • setMonitor

        void setMonitor​(VMMonitor monitor)
      • registerMetaModel

        void registerMetaModel​(java.lang.String name,
                               Metamodel metamodel)
        Registers metamodel under name.
        Parameters:
        name - the name under which to register
        metamodel - the metamodel to register
      • registerInputModel

        void registerInputModel​(java.lang.String name,
                                Model model)
        Registers model as an input model under name.
        Parameters:
        name - the name under which to register
        model - the model to register
      • registerInOutModel

        void registerInOutModel​(java.lang.String name,
                                Model model)
        Registers model as an in/out model under name.
        Parameters:
        name - the name under which to register
        model - the model to register
      • registerOutputModel

        void registerOutputModel​(java.lang.String name,
                                 Model model)
        Registers model as an output model under name.
        Parameters:
        name - the name under which to register
        model - the model to register
      • clearModels

        void clearModels()
        Removes all registered input, in/out, and output models from this ExecEnv.
      • getMetaModel

        Metamodel getMetaModel​(org.eclipse.emf.ecore.resource.Resource resource)
        Returns the Metamodel for the given resource, or null.
        Parameters:
        resource - the EMF Resource of the Metamodel
        Returns:
        the Metamodel
      • queueForSet

        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.
        Parameters:
        feature - the feature to set
        object - the object for which to set the feature
        value - the feature value to set
        frame - the stack frame context in which to set the feature value
      • queueForSet

        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.
        Parameters:
        field - the field to set
        object - the object for which to set the field
        value - the field value to set
        frame - the stack frame context in which to set the field value
      • queueXmiIDForSet

        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.
        Parameters:
        object - the object for which to set the field
        value - the field value to set
        frame - the stack frame context in which to set the field value
      • queueForAdd

        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.
        Parameters:
        feature - the feature to add to
        object - the object for which to add to the feature
        value - the feature value to add
        index - the index at which to add, or -1
        frame - the stack frame context in which to add to the feature value
      • queueForAdd

        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.
        Parameters:
        field - the field to add to
        object - the object for which to add to the field
        value - the field value to add
        index - the index at which to add, or -1
        frame - the stack frame context in which to add to the field value
      • queueXmiIDForAdd

        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.
        Parameters:
        object - the object for which to add to the field
        value - the field value to add
        index - the index at which to add, or -1
        frame - the stack frame context in which to add to the field value
      • queueForRemove

        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.
        Parameters:
        feature - the feature to remove from
        object - the object for which to remove from the feature
        value - the feature value to remove
        frame - the stack frame context in which to remove from the feature value
      • queueForRemove

        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.
        Parameters:
        field - the field to remove from
        object - the object for which to remove from the field
        value - the field value to remove
        frame - the stack frame context in which to remove from the field value
      • queueXmiIDForRemove

        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.
        Parameters:
        object - the object for which to remove from the field
        value - the field value to remove
        frame - the stack frame context in which to remove from the field value
      • setQueue

        void setQueue()
        Processes all elements in the "set" queue. Sets all queued features and fields, and clears the queue.
      • queueForRemap

        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.
        Parameters:
        source - the source value to remap
        target - the target value to map to
        frame - the stack frame context in which to remap
      • remapQueue

        void remapQueue()
        Processes all element in the "remap" queue. Remaps all queued source/target value pairs, and clears the queue.
      • getMetaModels

        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...

        Returns:
        the value of the 'Meta Models' attribute.
        See Also:
        EmftvmPackage.getExecEnv_MetaModels()
      • getInputModels

        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...

        Returns:
        the value of the 'Input Models' attribute.
        See Also:
        EmftvmPackage.getExecEnv_InputModels()
      • getInoutModels

        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...

        Returns:
        the value of the 'Inout Models' attribute.
        See Also:
        EmftvmPackage.getExecEnv_InoutModels()
      • getOutputModels

        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...

        Returns:
        the value of the 'Output Models' attribute.
        See Also:
        EmftvmPackage.getExecEnv_OutputModels()
      • loadModule

        Module loadModule​(ModuleResolver resolver,
                          java.lang.String name)
        Loads the module with the given name and its imports closure into this ExecEnv using the resolver, and registers its contents for execution.
        Parameters:
        resolver - the module file resolver
        name - the module name
        Returns:
        the loaded module
      • loadModule

        Module loadModule​(ModuleResolver resolver,
                          java.lang.String name,
                          boolean validate)
        Loads the module with the given name and its imports closure into this ExecEnv using the resolver, and registers its contents for execution.
        Parameters:
        resolver - the module file resolver
        name - the module name
        validate - if true, validates the loaded bytecode
        Returns:
        the loaded module
      • findOperation

        Operation findOperation​(java.lang.Object context,
                                java.lang.String name,
                                java.lang.Object[] parameterTypes)
        Finds an Operation registered within this ExecEnv.
        Parameters:
        context - the context type of the operation
        name - the operation name
        parameterTypes - the parameter types of the operation
        Returns:
        the Operation with the given properties, or null if none registered
      • findOperation

        Operation findOperation​(java.lang.Object context,
                                java.lang.String name)
        Finds an Operation registered within this ExecEnv.
        Parameters:
        context - the context type of the operation
        name - the operation name
        Returns:
        the Operation with the given properties, or null if none registered
      • findOperation

        Operation findOperation​(java.lang.Object context,
                                java.lang.String name,
                                java.lang.Object parameterType)
        Finds an Operation registered within this ExecEnv.
        Parameters:
        context - the context type of the operation
        name - the operation name
        parameterType - the parameter type of the operation
        Returns:
        the Operation with the given properties, or null if none registered
      • hasOperation

        boolean hasOperation​(java.lang.String name,
                             int argcount)
        Returns true iff this execution environment has any registered operations with the given name and argcount.
        Parameters:
        name - the operation name
        argcount - the number of operation arguments (excluding self)
        Returns:
        true iff this execution environment has any registered operations with the given name and argcount
      • findStaticOperation

        Operation findStaticOperation​(java.lang.Object context,
                                      java.lang.String name,
                                      java.lang.Object[] parameterTypes)
        Finds a static Operation registered within this ExecEnv.
        Parameters:
        context - the context type of the operation
        name - the operation name
        parameterTypes - the parameter types of the operation
        Returns:
        the static Operation with the given properties, or null if none registered
      • findStaticOperation

        Operation findStaticOperation​(java.lang.Object context,
                                      java.lang.String name)
        Finds a static Operation registered within this ExecEnv.
        Parameters:
        context - the context type of the operation
        name - the operation name
        Returns:
        the static Operation with the given properties, or null if none registered
      • findStaticOperation

        Operation findStaticOperation​(java.lang.Object context,
                                      java.lang.String name,
                                      java.lang.Object parameterType)
        Finds a static Operation registered within this ExecEnv.
        Parameters:
        context - the context type of the operation
        name - the operation name
        parameterType - the parameter type of the operation
        Returns:
        the static Operation with the given properties, or null if none registered
      • hasStaticOperation

        boolean hasStaticOperation​(java.lang.String name,
                                   int argcount)
        Returns true iff this execution environment has any registered static operations with the given name and argcount.
        Parameters:
        name - the operation name
        argcount - the number of operation arguments
        Returns:
        true iff this execution environment has any registered static operations with the given name and argcount
      • findField

        Field findField​(java.lang.Object context,
                        java.lang.String name)
        Finds a Field registered within this ExecEnv.
        Parameters:
        context - the context type of the field
        name - the operation name
        Returns:
        the Field with the given properties, or null if none registered
      • hasField

        boolean hasField​(java.lang.String name)
        Returns true iff this execution environment has any registered fields with the given name.
        Parameters:
        name - the field name
        Returns:
        true iff this execution environment has any registered fields with the given name
      • findStaticField

        Field findStaticField​(java.lang.Object context,
                              java.lang.String name)
        Finds a static Field registered within this ExecEnv.
        Parameters:
        context - the context type of the field
        name - the operation name
        Returns:
        the static Field with the given properties, or null if none registered
      • hasStaticField

        boolean hasStaticField​(java.lang.String name)
        Returns true iff this execution environment has any registered static fields with the given name.
        Parameters:
        name - the field name
        Returns:
        true iff this execution environment has any registered static fields with the given name
      • findRule

        Rule findRule​(java.lang.String name)
        Finds a Rule registered within this ExecEnv.
        Parameters:
        name - the rule name
        Returns:
        the Rule with the given name, or null if none registered
      • findType

        java.lang.Object findType​(java.lang.String modelName,
                                  java.lang.String typeName)
                           throws java.lang.ClassNotFoundException
        Finds the type for the given (meta-)modelName and typeName.
        Parameters:
        modelName - the name under which the metamodel that contains the type is registered
        typeName - the type/metaclass name (may be fully qualified using '::')
        Returns:
        the type/metaclass
        Throws:
        java.lang.ClassNotFoundException - if the type is not found
      • run

        java.lang.Object run​(TimingData timingData)
        Executes the loaded modules and returns the execution result.
        Parameters:
        timingData - the timing data object, or null
        Returns:
        the execution result of the last loaded module's main operation
      • getRules

        LazyList<Rule> getRules()
        Returns all rules registered in this ExecEnv.
        Returns:
        all rules registered in this ExecEnv.
      • getModelOf

        Model getModelOf​(org.eclipse.emf.ecore.EObject object)
        Returns the Model that is registered in this ExecEnv, and that contains object.
        Parameters:
        object - the object for which to look up the containing model
        Returns:
        the Model that contains object, or null if not found.
      • getModelID

        java.lang.String getModelID​(Model model)
        Returns the ID under which model is registered within this ExecEnv.
        Parameters:
        model - the registered Model to retrieve the ID for
        Returns:
        the ID under which model is registered within this ExecEnv.
      • getMetaModelID

        java.lang.String getMetaModelID​(Metamodel metamodel)
        Returns the ID under which metamodel is registered within this ExecEnv.
        Parameters:
        metamodel - the registered Metamodel to retrieve the ID for
        Returns:
        the ID under which metamodel is registered within this ExecEnv.
      • queueForDelete

        void queueForDelete​(org.eclipse.emf.ecore.EObject element,
                            StackFrame frame)
        Queues element for deletion.
        Parameters:
        element - the element to delete
        frame - the stack frame context in which to perform the deletion
      • deleteQueue

        void deleteQueue()
        Deletes all elements in the deletion queue.
      • getInputModelOf

        Model getInputModelOf​(org.eclipse.emf.ecore.EObject object)
        Returns the input Model that is registered in this ExecEnv, and that contains object.
        Parameters:
        object - the object for which to look up the containing model
        Returns:
        the input Model that contains object, or null if not found.
      • getInoutModelOf

        Model getInoutModelOf​(org.eclipse.emf.ecore.EObject object)
        Returns the in/out Model that is registered in this ExecEnv, and that contains object.
        Parameters:
        object - the object for which to look up the containing model
        Returns:
        the in/out Model that contains object, or null if not found.
      • getOutputModelOf

        Model getOutputModelOf​(org.eclipse.emf.ecore.EObject object)
        Returns the output Model that is registered in this ExecEnv, and that contains object.
        Parameters:
        object - the object for which to look up the containing model
        Returns:
        the output Model that contains object, or null if not found.
      • getJITCompiler

        CodeBlockJIT getJITCompiler()
        Returns the JIT compiler instance for this execution environment.
        Returns:
        the JIT compiler instance