Class EMFTVMLauncher
- java.lang.Object
-
- org.eclipse.m2m.atl.emftvm.launcher.compat.EMFTVMLauncher
-
- All Implemented Interfaces:
ILauncher
- Direct Known Subclasses:
EMFTVMUILauncher
public class EMFTVMLauncher extends java.lang.Object implements ILauncher
The EMFVM implementation of theILauncherinterface.
-
-
Field Summary
Fields Modifier and Type Field Description protected ExecEnvexecEnvprotected java.util.Map<java.lang.String,Module>librariesstatic java.lang.StringMODEL_FACTORY_NAMEThe Default model factory name to use.protected java.util.Map<java.lang.String,IModel>modelsprotected ModuleResolvermoduleResolverprotected org.eclipse.emf.ecore.resource.ResourceSetmoduleResourceSetprotected org.eclipse.emf.ecore.resource.ResourceSetoutputResourceSetprotected TimingDatatimingData-
Fields inherited from interface org.eclipse.m2m.atl.core.launch.ILauncher
DEBUG_MODE, RUN_MODE
-
-
Constructor Summary
Constructors Constructor Description EMFTVMLauncher()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddInModel(IModel model, java.lang.String name, java.lang.String referenceModelName)Adds an input model to the transformation context.voidaddInOutModel(IModel model, java.lang.String name, java.lang.String referenceModelName)Adds an input/output model to the transformation context.voidaddLibrary(java.lang.String name, java.lang.Object library)Adds a preloaded library module to the transformation, or anInputStream.protected ModeladdModel(IModel model, java.lang.String name, java.lang.String referenceModelName)Adds any model to the local map.voidaddOutModel(IModel model, java.lang.String name, java.lang.String referenceModelName)Adds an output model to the transformation context.java.lang.StringgetDefaultModelFactoryName()Returns the default ModelFactory name.java.lang.ObjectgetLibrary(java.lang.String libraryName)Returns a previously added library with the given name.IModelgetModel(java.lang.String modelName)Returns a previously added model with the given name.java.lang.String[]getModes()Returns the supported modes.protected ModulegetModuleFromObject(java.lang.Object module)Load a module if necessary.java.lang.StringgetName()Returns theILaunchername.voidinitialize(java.util.Map<java.lang.String,java.lang.Object> parameters)Initialize the launcher.protected java.lang.ObjectinternalLaunch(VMMonitor tool, org.eclipse.core.runtime.IProgressMonitor monitor, java.util.Map<java.lang.String,java.lang.Object> options, java.lang.Object... modules)Launches the transformation with preloaded modules.java.lang.Objectlaunch(java.lang.String mode, org.eclipse.core.runtime.IProgressMonitor monitor, java.util.Map<java.lang.String,java.lang.Object> options, java.lang.Object... modules)Launches the transformation using the given parameters and the given set of preloaded modules, orInputStream.ModuleloadModule(java.io.InputStream inputStream)Loads a transformation module from anInputStream.
-
-
-
Field Detail
-
MODEL_FACTORY_NAME
public static final java.lang.String MODEL_FACTORY_NAME
The Default model factory name to use.- See Also:
- Constant Field Values
-
models
protected java.util.Map<java.lang.String,IModel> models
-
libraries
protected java.util.Map<java.lang.String,Module> libraries
-
moduleResourceSet
protected org.eclipse.emf.ecore.resource.ResourceSet moduleResourceSet
-
moduleResolver
protected ModuleResolver moduleResolver
-
execEnv
protected ExecEnv execEnv
-
outputResourceSet
protected org.eclipse.emf.ecore.resource.ResourceSet outputResourceSet
-
timingData
protected TimingData timingData
-
-
Method Detail
-
getName
public java.lang.String getName()
Returns theILaunchername.
-
addModel
protected Model addModel(IModel model, java.lang.String name, java.lang.String referenceModelName)
Adds any model to the local map.
-
addInModel
public void addInModel(IModel model, java.lang.String name, java.lang.String referenceModelName)
Adds an input model to the transformation context. This method is also used to load the metamodels used in this transformation.- Specified by:
addInModelin interfaceILauncher- Parameters:
model- the loaded modelname- the name of the model as described in the main modulereferenceModelName- the name of the metamodel as described in the main module- See Also:
ILauncher.addInModel(org.eclipse.m2m.atl.core.IModel, java.lang.String, java.lang.String)
-
addInOutModel
public void addInOutModel(IModel model, java.lang.String name, java.lang.String referenceModelName)
Adds an input/output model to the transformation context.- Specified by:
addInOutModelin interfaceILauncher- Parameters:
model- the loaded modelname- the name of the model as described in the main modulereferenceModelName- the name of the metamodel as described in the main module- See Also:
ILauncher.addInOutModel(org.eclipse.m2m.atl.core.IModel, java.lang.String, java.lang.String)
-
addOutModel
public void addOutModel(IModel model, java.lang.String name, java.lang.String referenceModelName)
Adds an output model to the transformation context.- Specified by:
addOutModelin interfaceILauncher- Parameters:
model- the loaded modelname- the name of the model as described in the main modulereferenceModelName- the name of the metamodel as described in the main module- See Also:
ILauncher.addOutModel(org.eclipse.m2m.atl.core.IModel, java.lang.String, java.lang.String)
-
addLibrary
public void addLibrary(java.lang.String name, java.lang.Object library)Adds a preloaded library module to the transformation, or anInputStream.- Specified by:
addLibraryin interfaceILauncher- Parameters:
name- the name of the library as described in the main modulelibrary- the loaded library- See Also:
ILauncher.addLibrary(java.lang.String, java.lang.Object)
-
initialize
public void initialize(java.util.Map<java.lang.String,java.lang.Object> parameters)
Initialize the launcher.- Specified by:
initializein interfaceILauncher- Parameters:
parameters- initialization options- See Also:
ILauncher.initialize(java.util.Map)
-
launch
public java.lang.Object launch(java.lang.String mode, org.eclipse.core.runtime.IProgressMonitor monitor, java.util.Map<java.lang.String,java.lang.Object> options, java.lang.Object... modules)Launches the transformation using the given parameters and the given set of preloaded modules, orInputStream.- Specified by:
launchin interfaceILauncher- Parameters:
mode- the launching modemonitor- the progress monitoroptions- vm optionsmodules- single module/ordered module set. A module set is used for superimposition, where the first module of the set is override by the next ones. A module can be passed as an InputStream or directly a module loaded by the loadModule method.- Returns:
- the transformation return result
- See Also:
ILauncher.launch(java.lang.String, org.eclipse.core.runtime.IProgressMonitor, java.util.Map, java.lang.Object[])
-
internalLaunch
protected java.lang.Object internalLaunch(VMMonitor tool, org.eclipse.core.runtime.IProgressMonitor monitor, java.util.Map<java.lang.String,java.lang.Object> options, java.lang.Object... modules)
Launches the transformation with preloaded modules.- Parameters:
tool- the execution toolmonitor- the progression monitoroptions- the launching optionsmodules- the transformation modules- Returns:
- the execution result
-
loadModule
public Module loadModule(java.io.InputStream inputStream)
Loads a transformation module from anInputStream.- Specified by:
loadModulein interfaceILauncher- Parameters:
inputStream- the input stream to load- Returns:
- the loaded module
- See Also:
ILauncher.loadModule(java.io.InputStream)
-
getModuleFromObject
protected Module getModuleFromObject(java.lang.Object module)
Load a module if necessary.
-
getModel
public IModel getModel(java.lang.String modelName)
Returns a previously added model with the given name.- Specified by:
getModelin interfaceILauncher- Parameters:
modelName- the model name- Returns:
- a previously added model with the given name
- See Also:
ILauncher.getModel(java.lang.String)
-
getLibrary
public java.lang.Object getLibrary(java.lang.String libraryName)
Returns a previously added library with the given name.- Specified by:
getLibraryin interfaceILauncher- Parameters:
libraryName- the library name- Returns:
- a previously added library with the given name
- See Also:
ILauncher.getLibrary(java.lang.String)
-
getDefaultModelFactoryName
public java.lang.String getDefaultModelFactoryName()
Returns the default ModelFactory name.- Specified by:
getDefaultModelFactoryNamein interfaceILauncher- Returns:
- the default ModelFactory name
- See Also:
ILauncher.getDefaultModelFactoryName()
-
getModes
public java.lang.String[] getModes()
Returns the supported modes.- Specified by:
getModesin interfaceILauncher- Returns:
- the supported modes
- See Also:
ILauncher.getModes()
-
-