Package org.eclipse.m2m.atl.core.ui.vm
Class RegularVMLauncher
- java.lang.Object
-
- org.eclipse.m2m.atl.core.ui.vm.RegularVMLauncher
-
- All Implemented Interfaces:
ILauncher
- Direct Known Subclasses:
ProfilerLauncher
public class RegularVMLauncher extends java.lang.Object implements ILauncher
The RegularVM implementation of theILauncher
.
-
-
Field Summary
-
Fields inherited from interface org.eclipse.m2m.atl.core.launch.ILauncher
DEBUG_MODE, RUN_MODE
-
-
Constructor Summary
Constructors Constructor Description RegularVMLauncher()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addInModel(IModel model, java.lang.String name, java.lang.String referenceModelName)
Adds an input model to the transformation context.void
addInOutModel(IModel model, java.lang.String name, java.lang.String referenceModelName)
Adds an input/output model to the transformation context.void
addLibrary(java.lang.String name, java.lang.Object library)
Adds a preloaded library module to the transformation, or anInputStream
.void
addOutModel(IModel model, java.lang.String name, java.lang.String referenceModelName)
Adds an output model to the transformation context.java.lang.String
getDefaultModelFactoryName()
Returns the default ModelFactory name.java.lang.Object
getLibrary(java.lang.String libraryName)
Returns a previously added library with the given name.IModel
getModel(java.lang.String modelName)
Returns a previously added model with the given name.java.lang.String[]
getModes()
Returns the supported modes.java.lang.String
getName()
Returns theILauncher
name.void
initialize(java.util.Map<java.lang.String,java.lang.Object> options)
Initialize the launcher.protected java.lang.Object
internalLaunch(Debugger debugger, java.util.Map<java.lang.String,java.lang.Object> options, java.lang.Object[] modules)
Launches the transformation using the specified debugger.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
.java.lang.Object
loadModule(java.io.InputStream inputStream)
Loads a transformation module from anInputStream
.
-
-
-
Method Detail
-
getName
public java.lang.String getName()
Description copied from interface:ILauncher
Returns theILauncher
name.
-
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:
addInModel
in 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:
addInOutModel
in 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:
addOutModel
in 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:
addLibrary
in 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> options)
Initialize the launcher.- Specified by:
initialize
in interfaceILauncher
- Parameters:
options
- initialization options- See Also:
ILauncher.initialize(java.util.Map)
-
getDefaultModelFactoryName
public java.lang.String getDefaultModelFactoryName()
Returns the default ModelFactory name.- Specified by:
getDefaultModelFactoryName
in interfaceILauncher
- Returns:
- the default ModelFactory name
- See Also:
ILauncher.getDefaultModelFactoryName()
-
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:
launch
in 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:
org.eclipse.m2m.atl.core.launch.ILauncher#launch(java.lang.String, org.eclipse.core.runtime.IProgressMonitor, java.util.Map, java.io.InputStream[])
-
internalLaunch
protected java.lang.Object internalLaunch(Debugger debugger, java.util.Map<java.lang.String,java.lang.Object> options, java.lang.Object[] modules) throws AtlSuperimposeModule.AtlSuperimposeModuleException
Launches the transformation using the specified debugger.- Parameters:
debugger
- the debuggeroptions
- the launch optionsmodules
- the transformation modules- Returns:
- the transformation return value
- Throws:
AtlSuperimposeModule.AtlSuperimposeModuleException
-
loadModule
public java.lang.Object loadModule(java.io.InputStream inputStream)
Loads a transformation module from anInputStream
.- Specified by:
loadModule
in interfaceILauncher
- Parameters:
inputStream
- the input stream to load- Returns:
- the loaded module
- See Also:
ILauncher.loadModule(java.io.InputStream)
-
getModel
public IModel getModel(java.lang.String modelName)
Returns a previously added model with the given name.- Specified by:
getModel
in 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:
getLibrary
in interfaceILauncher
- Parameters:
libraryName
- the library name- Returns:
- a previously added library with the given name
- See Also:
ILauncher.getLibrary(java.lang.String)
-
getModes
public java.lang.String[] getModes()
Returns the supported modes.- Specified by:
getModes
in interfaceILauncher
- Returns:
- the supported modes
- See Also:
ILauncher.getModes()
-
-