Package jetbrains.mps.smodel.tempmodel
Class TempModule2
- java.lang.Object
 - 
- jetbrains.mps.extapi.module.SModuleBase
 - 
- jetbrains.mps.project.AbstractModule
 - 
- jetbrains.mps.smodel.tempmodel.TempModule2
 
 
 
 
- 
- All Implemented Interfaces:
 EditableSModule,SModule
public class TempModule2 extends AbstractModule
Alternative temporary module, not a subject to classloading (not aReloadableModule). TL;DR We've got global repositories, tests need temporary models living in a repository (editor doesn't tolerate detached models). Each test creates own module and effectively triggers re-calculation of dependency edges for other modules in the repository which slows down test execution. Check https://youtrack.jetbrains.com/issue/MPS-27846 Classloading reacts to any ReloadableModule added to a global repository (ClassLoaderManager.myWatchableCondition which is propagated down to ModuleUpdater) and spends noticeable time in ModuleUpdater#updateAdded -> updateAllEdges.TempModuleisReloadableModule, and there's no other temp module. TransformationTests (like NodesTestCase, EditorTestCase) use modeling facilities only and don't need to load classes for test nodes, however I can't tell for sure other clients of TempModule do not, therefore a change in TempModule would be dangerous. Another alternative is to useReloadableModule.canLoadClasses()()} and corresponding setting in TempModuleOptions, but there's no clear contract for willLoad(), besides, it might get changed with respect to improved module classloading story. Yet another alternative is to use TransientModuleProvider and TransientModelsModule (which is not ReloadableModule as well). Though this seems the most appropriate way forward, it's not viable right now. First, due to single provider instance, second, due to greater changes in the tests.- Since:
 - 2018.2
 
 
- 
- 
Nested Class Summary
- 
Nested classes/interfaces inherited from class jetbrains.mps.project.AbstractModule
AbstractModule.LangAndDevkits 
 - 
 
- 
Field Summary
- 
Fields inherited from class jetbrains.mps.project.AbstractModule
CLASSES, CLASSES_GEN, MODULE_DIR 
- 
Fields inherited from class jetbrains.mps.extapi.module.SModuleBase
MODEL_BY_NAME_COMPARATOR 
 - 
 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcollectMandatoryFacetTypes(Set<String> types)For the time being, MPS enforces certain facets for modules (e.g.ModuleDescriptorgetModuleDescriptor()booleanisPackaged()The module has been imported as a compiled library, not sources.booleanisReadOnly()No updates are permitted- 
Methods inherited from class jetbrains.mps.project.AbstractModule
addDependency, attach, collectLanguagesAndDevkits, dependenciesChanged, dispose, doSetModuleDescriptor, getDeclaredDependencies, getDependencyVersion, getDependencyVersion, getDescriptorFile, getFacet, getFacets, getFileSystem, getModelRoots, getModuleId, getModuleName, getModuleReference, getModuleSourceDir, getModuleVersion, getOutputPath, getScope, getSourcePaths, getUsedLanguages, getUsedLanguageVersion, getUsedLanguageVersion, handleReadProblem, isChanged, loadRoots, onModuleLoad, reloadAfterDescriptorChange, removeDependency, rename, renameModels, save, setChanged, setModuleDescriptor, setModuleDescriptor, setModuleReference, setModuleVersion, setupFacet, toString, updateExternalReferences, updateFacets, updateModelsSet, updatePackagedDescriptor 
- 
Methods inherited from class jetbrains.mps.extapi.module.SModuleBase
addModuleListener, assertCanChange, assertCanRead, fireBeforeModelRenamed, fireChanged, fireModelRenamed, fireModuleRenamed, getModel, getModels, getRepository, registerModel, removeModuleListener, unregisterModel 
- 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait 
- 
Methods inherited from interface org.jetbrains.mps.openapi.module.SModule
addModuleListener, getModel, getModels, getModels, getRepository, removeModuleListener 
 - 
 
 - 
 
- 
- 
Method Detail
- 
getModuleDescriptor
@Nullable public ModuleDescriptor getModuleDescriptor()
- Overrides:
 getModuleDescriptorin classAbstractModule
 
- 
collectMandatoryFacetTypes
protected void collectMandatoryFacetTypes(Set<String> types)
Description copied from class:AbstractModuleFor the time being, MPS enforces certain facets for modules (e.g. Java facet is essential for classloading mechanism). As we move forward with facets story, we likely respect actual facets for the module (e.g. would force Java facet on module creation only) Need to ensure classloading could deal with modules without Java facet, then can drop these mandatory facets altogether- Overrides:
 collectMandatoryFacetTypesin classAbstractModule
 
- 
isPackaged
public boolean isPackaged()
Description copied from interface:SModuleThe module has been imported as a compiled library, not sources. Implies read only.- Specified by:
 isPackagedin interfaceSModule- Overrides:
 isPackagedin classAbstractModule
 
- 
isReadOnly
public boolean isReadOnly()
Description copied from interface:SModuleNo updates are permitted- Specified by:
 isReadOnlyin interfaceSModule- Overrides:
 isReadOnlyin classAbstractModule
 
 - 
 
 -