|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.mofscript.runtime.ExecutionManager
public class ExecutionManager
Class responsible for managing the execution of a transformation
Field Summary | |
---|---|
protected boolean |
_coarseTramde
|
protected org.eclipse.emf.ecore.EcoreFactory |
_ecoreFactory
|
protected org.eclipse.emf.ecore.EcorePackage |
_ecorePackage
|
protected RuleExecutionStack |
_executionStack
|
protected FileResourcesType |
_filUML2eModel
|
protected MOFScriptModelFactory |
_mttModelFactory
|
protected ExecutionEnvironment |
_rootEnv
|
protected java.util.Hashtable<java.lang.String,java.lang.String> |
_sourceMetaModelNames
|
protected java.util.Hashtable<java.lang.String,org.eclipse.emf.ecore.EPackage> |
_sourceMetaModels
|
protected java.util.Hashtable<java.lang.String,org.eclipse.emf.ecore.EObject> |
_sourceModels
|
protected java.util.Hashtable<java.lang.String,java.lang.String> |
_targetMetaModelNames
|
protected java.util.Hashtable<java.lang.String,org.eclipse.emf.ecore.EPackage> |
_targetMetaModels
|
protected org.eclipse.emf.ecore.EObject |
_targetModel
|
protected TransformationProxy |
_transformationProxy
|
protected boolean |
_useFileModel
|
protected boolean |
_useTraceability
|
protected boolean |
_useTramde
|
Constructor Summary | |
---|---|
protected |
ExecutionManager()
Default constructor (protected), which is not used externally. |
Method Summary | |
---|---|
static void |
addDebugListener(DebugListener dl)
|
void |
addOutModelTypeMap(java.lang.String outParam,
java.lang.String metaModelType)
|
void |
addSourceModel(org.eclipse.emf.ecore.EObject model)
Adds a source metamodel |
protected void |
addSourceModelResource(java.lang.String metamodelRef,
org.eclipse.emf.ecore.resource.Resource res)
Fetches the model object from a resource and sets the sourceModel |
protected boolean |
checkRSAAvailability()
Checks availability of IBM RSA |
void |
checkTramdeAvailability()
Checks if TRAMDE is installed in the platform |
void |
clearModelTypeMap()
|
void |
clearSourceMetaModels()
Clears the source metamodel hash |
void |
clearTransformationModel()
Clears the transformation proxy |
java.lang.Class<?> |
createFeatureFromName(java.lang.String featureName,
org.eclipse.emf.ecore.EPackage metamodel)
Creates a classifier from a metamodel based on a name This is not really used - was for creating metamodel instances in a transformation. |
void |
executeTransformation()
Executes a transformation |
org.eclipse.emf.ecore.EStructuralFeature |
findFeatureForEcoreConcept(java.lang.String ecoreConcept,
java.lang.String feature)
Looks for a feature from an ecore concept |
org.eclipse.emf.ecore.EStructuralFeature |
findFeatureForSourceConcept(java.lang.String metaModel,
java.lang.String metamodelconcept,
java.lang.String feature)
Locates a feature for a given metamodel concept in the source metamodel |
org.eclipse.emf.ecore.EStructuralFeature |
findFeatureForSourceRootConcept_1002(java.lang.String metamodelName,
java.lang.String feature)
|
org.eclipse.emf.ecore.EStructuralFeature |
findFeatureForTargetConcept(java.lang.String metaModel,
java.lang.String metamodelconcept,
java.lang.String feature)
Locates a feature for a given metamodel concept in the target metamodel |
org.eclipse.emf.ecore.EClassifier |
findMetaModelConcept(java.lang.String metaModelName,
java.lang.String concept)
Looks for either source or target metamodel concepts |
org.eclipse.emf.ecore.EClassifier |
findSourceMetaModelConcept(java.lang.String metaModelName,
java.lang.String concept)
|
org.eclipse.emf.ecore.EClassifier |
findTargetMetaModelConcept(java.lang.String metaModelName,
java.lang.String concept)
|
java.util.List |
getAllClassifiersForMetaModel(java.lang.String metaModel)
|
java.util.List |
getAllClassifiersForPackage(org.eclipse.emf.ecore.EPackage pkg)
|
java.util.List |
getAllClassifiersForSourceMetaModel(java.lang.String metaModel)
Returns a list of all classifiers for a given meta model |
java.util.List |
getAllRulesForConcept(java.lang.String concept)
Looks for all rules that applies to a certain concept |
static java.util.Set |
getAllSuperRuleNames(MOFScriptTransformation transformation)
|
static java.util.Set |
getAllSuperRules(MOFScriptTransformation transformation)
|
java.lang.String |
getBlockCommentTag()
|
java.lang.String |
getCharset()
|
org.eclipse.emf.ecore.EClassifier |
getClassifierForPackage(org.eclipse.emf.ecore.EPackage pkg,
java.lang.String clazzifierName)
|
static java.util.List<DebugListener> |
getDebugListeners()
|
org.eclipse.emf.ecore.EPackage |
getDefaultMetaModel()
Returns the "default" metamodel, which is always the first one |
org.eclipse.emf.ecore.EPackage |
getEcoreMetaModel()
|
static ExecutionManager |
getExecutionManager()
Obtains (and creates) the singelton execution manager |
RuleExecutionStack |
getExecutionStack()
|
static org.eclipse.emf.ecore.EStructuralFeature |
getFeatureForClass(org.eclipse.emf.ecore.EClassifier clazzifier,
java.lang.String feature)
Retrieves a named features for a class. |
java.lang.Class<?> |
getFeatureForName(java.lang.String featureName)
Retrieves a feature object from the source metamodel (or one of the meta models) Currently uses the sourceMetaModel |
static java.util.List |
getFeaturesForClass(org.eclipse.emf.ecore.EClass clazz)
Fetches all features (structural features) of a class, including inherited ones Also fetches features of un |
FileResourcesType |
getFileModel()
The file model is only populated when the "useFileModel" property is set. |
ITraceEstablisher |
getITraceE()
|
org.eclipse.emf.ecore.EPackage |
getMetaModel(java.lang.String name)
|
java.util.Vector<org.eclipse.emf.ecore.EObject> |
getMetaModelConcept(java.lang.String concept)
Looks at any metamodel for a class with that name |
org.eclipse.emf.ecore.EClassifier |
getMetaModelReference(java.lang.String refName)
Looks for a classifier from a metamodel |
static java.util.List |
getMMTokens(org.eclipse.emf.ecore.EPackage metaModel)
Returns a list of strings containing the names of the concepts defined in the metamodel given in the input parameter |
MOFScriptModelFactory |
getModelFactory()
|
MOFScriptTransformation |
getMofScript2TextTransformation()
Returns the model representation of the MOFScript to Text transformation |
MOFScriptTransformation |
getMofScriptAspectTransformation()
|
protected MOFScriptTransformation |
getMofScriptTransformation(java.lang.String fileUri)
Returns the model representation of the MOFScript to Text transformation |
static java.lang.String |
getObjectAttributeValue(org.eclipse.emf.ecore.EObject object,
java.lang.String featureName)
Returns the value of a given attribute for a specific object |
static java.lang.String |
getObjectNameValue(org.eclipse.emf.ecore.EObject object)
Returns the value of the 'name' attribute for a specific object |
protected java.util.Collection |
getObjectsByType(org.eclipse.emf.common.util.TreeIterator treeIt,
org.eclipse.emf.ecore.EClassifier type)
Looks for objects of a particular type within a tree iterator and returns all objects of that type |
java.util.Collection<org.eclipse.emf.ecore.EObject> |
getOutputModels()
|
java.util.Vector |
getProducedResources()
|
java.lang.Object |
getRealObject(java.lang.Object mightBeProxy)
checks if an object is a proxy and resolves it |
org.eclipse.emf.ecore.resource.Resource |
getResource(org.eclipse.emf.common.util.URI uri)
Returns a resource based on a URI |
org.eclipse.emf.ecore.resource.ResourceSet |
getResourceSet()
|
java.lang.String |
getRootDirectory()
|
protected java.util.Map |
getRulesForConcept(java.lang.String concept)
Returns the rules for a specific concept using the transformation proxy |
org.eclipse.emf.ecore.EPackage |
getSourceMetaModel(java.lang.String name)
Returns a named metamodel |
java.lang.String |
getSourceMetaModelName(int index)
Gets the name of the source metamodels based on their index |
java.util.List |
getSourceMMTokens()
|
org.eclipse.emf.ecore.EObject |
getSourceModel(java.lang.String metaModelRef)
|
org.eclipse.emf.ecore.EPackage |
getTargetMetaModel(java.lang.String name)
|
static boolean |
getTramdeAvailable()
Returns the value true if TRAMDE is installed in the platform |
java.lang.String |
getTransformationInputUri()
|
TransformationProxy |
getTransformationProxy()
|
TransformationRule |
getTransformationRule2(java.lang.String name,
java.lang.String possibleScope,
java.lang.String ownerTransformation)
Deprecated. |
java.util.Collection |
getTransformationRules(java.lang.String name,
java.lang.String possibleScope,
java.lang.String ownerTransformation)
Returns all rules with the same name |
MOFScriptSpecification |
getTransformationSpecification()
|
boolean |
getUMLIsAvailable()
Gets the property for UML2 availability |
boolean |
getUseCoarseTramde()
|
boolean |
getUseTraceability()
|
boolean |
getUseTramde()
|
protected void |
initUMLSupport()
Tests if UML2 classes are available by dynamic instantitation If they are, the editor (and runtime) can provide extended support for UML2 |
boolean |
isTramdeActive()
This is the preferences value of Generate Tramde trace links |
protected org.eclipse.emf.ecore.EObject |
loadRSAModel(java.io.File srcFile)
RSA extension for loading RSA models |
void |
loadSourceModel(java.io.File sourceFile)
Loads the source model from a file into the set of models needed to perform a transformation The source model needs to be in accordance with the source meta model |
void |
loadTransformationModel(java.io.File sourcefile)
Loads a transformation model from a file |
protected void |
lookupAndAddMetaModel(MOFScriptParameter p)
|
org.eclipse.emf.ecore.EPackage |
lookupAndAddSourceMetaModel(java.lang.String mmName,
java.lang.String mmUri)
Looks up a given metamodel and adds it to the metamodel and name caches |
void |
lookupAndAddSourceMetaModelsFromParameterList(java.util.List paramList)
Clears source (and target) metamodel cache and lookup the models. |
org.eclipse.emf.ecore.EPackage |
lookupAndAddTargetMetaModel(java.lang.String mmName,
java.lang.String mmUri,
java.lang.String typePrefix)
Looks up a given metamodel and adds it to the metamodel and name caches |
java.util.Hashtable<java.lang.String,java.lang.String> |
lookupMetaModels()
Looks up metamodels Only loads metamodel from the MM repository |
org.eclipse.emf.ecore.EPackage |
lookupPackageRegistry_111(java.lang.String name)
Looks up a package name from the package registry |
org.eclipse.emf.ecore.EPackage |
lookupResourceMetaModel(java.lang.String mmUri)
Looks for a metamodel based on it's URI |
org.eclipse.emf.ecore.EPackage |
lookupResourceMetaModelByName(java.lang.String name)
Looks up a metamodel based on a name |
void |
messageEvent(java.lang.String message)
Prints message to console |
protected void |
registerAnonymousPackage(java.lang.Class toRegister)
Dynamically registry a package, based on the class |
protected void |
registerExternalResources()
Registers resources which might not be available, such as UML2 |
protected void |
registerNotationPackages()
RSA-specific variabilities |
protected void |
registerUML2Resources()
UML 2-specific variability |
static void |
removeDebugListener(DebugListener dl)
|
protected boolean |
ruleIsForConcept(TransformationRule r,
java.lang.String concept)
Checks if a particular rule applies to a partcular concept (metamodel type) |
void |
setBlockCommentTag(java.lang.String blockCommentTag)
|
void |
setCharset(java.lang.String cs)
|
void |
setFileMetaModelRepository(java.lang.String directory)
Sets the metamodel repository location, and updates the cached registry |
void |
setITraceE(ITraceEstablisher iTraceE)
|
void |
setRootDirectory(java.lang.String rootDir)
Sets the root directory for output generation |
void |
setTraceabilityGenDir(java.lang.String traceGenDir)
|
void |
setTransformationInputUri(java.lang.String trInputUri)
|
void |
setTransformationModel(MOFScriptTransformation transformation)
|
void |
setTransformationProxy(TransformationProxy trProxy)
Sets the transformation proxy |
void |
setTransformationSpecification(MOFScriptSpecification transformationSpec)
|
void |
setUMLIsAvailable(boolean umlIsAvailable)
Sets the property for UML2 availability |
void |
setUseCoarseTramde(boolean useIt)
|
void |
setUseFileModel(boolean useFileModel)
|
void |
setUseLog(boolean useLog)
Turns on/off the usage of logging in MOFScript |
void |
setUseTraceability(boolean useIt)
Turns traceability functionality on / off |
void |
setUseTramde(boolean useIt)
|
protected void |
updatePackageRegistry()
Updates the registered packages (based on the metamodel repository location) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected org.eclipse.emf.ecore.EcorePackage _ecorePackage
protected org.eclipse.emf.ecore.EcoreFactory _ecoreFactory
protected java.util.Hashtable<java.lang.String,org.eclipse.emf.ecore.EPackage> _sourceMetaModels
protected java.util.Hashtable<java.lang.String,java.lang.String> _sourceMetaModelNames
protected java.util.Hashtable<java.lang.String,org.eclipse.emf.ecore.EPackage> _targetMetaModels
protected java.util.Hashtable<java.lang.String,java.lang.String> _targetMetaModelNames
protected java.util.Hashtable<java.lang.String,org.eclipse.emf.ecore.EObject> _sourceModels
protected org.eclipse.emf.ecore.EObject _targetModel
protected boolean _useTraceability
protected boolean _useTramde
protected boolean _coarseTramde
protected ExecutionEnvironment _rootEnv
protected RuleExecutionStack _executionStack
protected MOFScriptModelFactory _mttModelFactory
protected TransformationProxy _transformationProxy
protected boolean _useFileModel
protected FileResourcesType _filUML2eModel
Constructor Detail |
---|
protected ExecutionManager()
Method Detail |
---|
public java.lang.String getCharset()
public void setCharset(java.lang.String cs)
charset
- public void setTransformationInputUri(java.lang.String trInputUri)
trInputUri
- public java.lang.String getTransformationInputUri()
public ITraceEstablisher getITraceE()
public void setITraceE(ITraceEstablisher iTraceE)
iTraceE
- public boolean isTramdeActive()
public void checkTramdeAvailability()
public static boolean getTramdeAvailable()
public static ExecutionManager getExecutionManager()
protected void updatePackageRegistry()
public java.util.Hashtable<java.lang.String,java.lang.String> lookupMetaModels()
public void setFileMetaModelRepository(java.lang.String directory)
directory
- public void setUseTraceability(boolean useIt)
useIt
- public void setTraceabilityGenDir(java.lang.String traceGenDir)
public boolean getUseTraceability()
public boolean getUseTramde()
public void setUseTramde(boolean useIt)
public boolean getUseCoarseTramde()
public void setUseCoarseTramde(boolean useIt)
public static void addDebugListener(DebugListener dl)
dl
- public static void removeDebugListener(DebugListener dl)
dl
- public static java.util.List<DebugListener> getDebugListeners()
public void setBlockCommentTag(java.lang.String blockCommentTag)
blockCommentTag
- Comment tag used infront of block start and end
I.e. Java "//"public java.lang.String getBlockCommentTag()
public void setUMLIsAvailable(boolean umlIsAvailable)
umlIsAvailable
- protected void initUMLSupport()
public boolean getUMLIsAvailable()
public void setUseLog(boolean useLog)
useLog
- public org.eclipse.emf.ecore.resource.Resource getResource(org.eclipse.emf.common.util.URI uri)
uri
-
public TransformationRule getTransformationRule2(java.lang.String name, java.lang.String possibleScope, java.lang.String ownerTransformation)
name
- possibleScope
- ownerTransformation
-
public java.util.Collection getTransformationRules(java.lang.String name, java.lang.String possibleScope, java.lang.String ownerTransformation)
name
- possibleScope
- ownerTransformation
-
public org.eclipse.emf.ecore.EPackage getEcoreMetaModel()
public void clearTransformationModel()
public void setTransformationProxy(TransformationProxy trProxy)
trProxy
- public TransformationProxy getTransformationProxy()
public void setTransformationModel(MOFScriptTransformation transformation)
transformation
- public void setTransformationSpecification(MOFScriptSpecification transformationSpec)
transformationSpec
- public MOFScriptSpecification getTransformationSpecification()
public void setUseFileModel(boolean useFileModel)
useFileModel
- public void setRootDirectory(java.lang.String rootDir)
rootDir
- public java.lang.String getRootDirectory()
public MOFScriptModelFactory getModelFactory()
public org.eclipse.emf.ecore.resource.ResourceSet getResourceSet()
public RuleExecutionStack getExecutionStack()
public void loadTransformationModel(java.io.File sourcefile)
public org.eclipse.emf.ecore.EPackage lookupPackageRegistry_111(java.lang.String name)
name
-
public void clearSourceMetaModels()
public void loadSourceModel(java.io.File sourceFile)
sourceFile
- the file to load the metamodel frompublic org.eclipse.emf.ecore.EPackage lookupResourceMetaModel(java.lang.String mmUri)
mmUri
-
public org.eclipse.emf.ecore.EPackage lookupResourceMetaModelByName(java.lang.String name)
name
-
public org.eclipse.emf.ecore.EPackage lookupAndAddSourceMetaModel(java.lang.String mmName, java.lang.String mmUri)
mmName
- mmUri
-
public org.eclipse.emf.ecore.EPackage lookupAndAddTargetMetaModel(java.lang.String mmName, java.lang.String mmUri, java.lang.String typePrefix)
mmName
- mmUri
-
protected void lookupAndAddMetaModel(MOFScriptParameter p)
p
- public void lookupAndAddSourceMetaModelsFromParameterList(java.util.List paramList)
protected void addSourceModelResource(java.lang.String metamodelRef, org.eclipse.emf.ecore.resource.Resource res)
metamodelRef
- The refrence name of the metamodelres
- The resource that is addedpublic void addSourceModel(org.eclipse.emf.ecore.EObject model)
model
- public org.eclipse.emf.ecore.EPackage getDefaultMetaModel()
public org.eclipse.emf.ecore.EPackage getMetaModel(java.lang.String name)
public org.eclipse.emf.ecore.EPackage getSourceMetaModel(java.lang.String name)
name
-
public org.eclipse.emf.ecore.EPackage getTargetMetaModel(java.lang.String name)
name
-
public java.lang.String getSourceMetaModelName(int index)
public org.eclipse.emf.ecore.EObject getSourceModel(java.lang.String metaModelRef)
metaModelRef
- The reference to the owner metamodel
public void executeTransformation() throws MofScriptExecutionException
MofScriptExecutionException
public FileResourcesType getFileModel()
public java.util.Vector getProducedResources()
protected java.util.Collection getObjectsByType(org.eclipse.emf.common.util.TreeIterator treeIt, org.eclipse.emf.ecore.EClassifier type)
treeIt
- The tree iteratortype
- The type
public static java.lang.String getObjectAttributeValue(org.eclipse.emf.ecore.EObject object, java.lang.String featureName)
object
- featureName
-
public static java.lang.String getObjectNameValue(org.eclipse.emf.ecore.EObject object)
object
- the object to find the name attribute value for
public java.lang.Class<?> getFeatureForName(java.lang.String featureName)
featureName
-
public java.lang.Class<?> createFeatureFromName(java.lang.String featureName, org.eclipse.emf.ecore.EPackage metamodel)
featureName
- metamodel
-
public static java.util.List getMMTokens(org.eclipse.emf.ecore.EPackage metaModel)
metaModel
- the metamodel to find the tokens for
public java.util.List getSourceMMTokens()
public org.eclipse.emf.ecore.EClassifier findMetaModelConcept(java.lang.String metaModelName, java.lang.String concept)
metaModelName
- concept
-
public org.eclipse.emf.ecore.EClassifier findSourceMetaModelConcept(java.lang.String metaModelName, java.lang.String concept)
concept
- a string containing the name og the concept to receive
public org.eclipse.emf.ecore.EClassifier findTargetMetaModelConcept(java.lang.String metaModelName, java.lang.String concept)
concept
- a string containing the name og the concept to receive
public java.util.Vector<org.eclipse.emf.ecore.EObject> getMetaModelConcept(java.lang.String concept)
concept
-
public org.eclipse.emf.ecore.EStructuralFeature findFeatureForSourceConcept(java.lang.String metaModel, java.lang.String metamodelconcept, java.lang.String feature)
public org.eclipse.emf.ecore.EStructuralFeature findFeatureForEcoreConcept(java.lang.String ecoreConcept, java.lang.String feature)
ecoreConcept
- feature
-
public org.eclipse.emf.ecore.EStructuralFeature findFeatureForSourceRootConcept_1002(java.lang.String metamodelName, java.lang.String feature)
metamodelName
- feature
-
public org.eclipse.emf.ecore.EStructuralFeature findFeatureForTargetConcept(java.lang.String metaModel, java.lang.String metamodelconcept, java.lang.String feature)
protected java.util.Map getRulesForConcept(java.lang.String concept)
concept
-
public java.util.List getAllRulesForConcept(java.lang.String concept)
concept
- The concept
protected boolean ruleIsForConcept(TransformationRule r, java.lang.String concept)
r
- concept
-
public org.eclipse.emf.ecore.EClassifier getMetaModelReference(java.lang.String refName)
refName
-
public static java.util.List getFeaturesForClass(org.eclipse.emf.ecore.EClass clazz)
public static org.eclipse.emf.ecore.EStructuralFeature getFeatureForClass(org.eclipse.emf.ecore.EClassifier clazzifier, java.lang.String feature)
clazz
- feature
-
public java.util.List getAllClassifiersForSourceMetaModel(java.lang.String metaModel)
public java.util.List getAllClassifiersForMetaModel(java.lang.String metaModel)
metaModel
-
public java.util.List getAllClassifiersForPackage(org.eclipse.emf.ecore.EPackage pkg)
pkg
-
public org.eclipse.emf.ecore.EClassifier getClassifierForPackage(org.eclipse.emf.ecore.EPackage pkg, java.lang.String clazzifierName)
pkg
- clazzifierName
-
public java.lang.Object getRealObject(java.lang.Object mightBeProxy)
mightBeProxy
-
public static java.util.Set getAllSuperRules(MOFScriptTransformation transformation)
transformation
-
public static java.util.Set getAllSuperRuleNames(MOFScriptTransformation transformation)
transformation
-
protected void registerExternalResources()
protected void registerUML2Resources()
protected void registerNotationPackages()
protected void registerAnonymousPackage(java.lang.Class toRegister)
toRegister
- protected boolean checkRSAAvailability()
protected org.eclipse.emf.ecore.EObject loadRSAModel(java.io.File srcFile)
modelRef
-
protected MOFScriptTransformation getMofScriptTransformation(java.lang.String fileUri)
public MOFScriptTransformation getMofScript2TextTransformation()
public MOFScriptTransformation getMofScriptAspectTransformation()
public void messageEvent(java.lang.String message)
message
- public void addOutModelTypeMap(java.lang.String outParam, java.lang.String metaModelType)
public void clearModelTypeMap()
public java.util.Collection<org.eclipse.emf.ecore.EObject> getOutputModels()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |