Package jetbrains.mps.generator
Class TransientModelsProvider
- java.lang.Object
 - 
- jetbrains.mps.generator.TransientModelsProvider
 
 
- 
public class TransientModelsProvider extends Object
 
- 
- 
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceTransientModelsProvider.TransientSwapOwnerstatic interfaceTransientModelsProvider.TransientSwapSpace 
- 
Constructor Summary
Constructors Constructor Description TransientModelsProvider(SRepository repository, TransientModelsProvider.TransientSwapOwner swapOwner) 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidassociate(GeneratorTask task, TransientModelsModule transientModule)Record module that keeps transient models for the given task.booleancanKeepOneMore()protected voidclearAll(boolean dropCheckpoint)TransientModelsModulecreateModule(String moduleName)Instantiate new transient, free-floating module with givenmoduleNameaugmented with implementation-specific stereotype.voiddecreaseKeptModels()TransientModelsModulegetCheckpointsModule()TransientModelsModulegetModule(GeneratorTask task)XXX perhaps, GeneratorTask shall answer getTransientModule():SModule itself.Iterable<TransientModelsModule>getModules()SRepositorygetRepository()GenerationTracegetTrace(SModelReference model)TransientModelsProvider.TransientSwapSpacegetTransientSwapSpace()voidinitCheckpointModule()Requires model write to register checkpoint module with a repository.voidpublishAll()Requires write lock for associated repositoryvoidremoveAllTransient()voidremoveAllTransients(boolean includeCheckpoints)voidstartGeneration(int numberOfModelsToKeep) 
 - 
 
- 
- 
Constructor Detail
- 
TransientModelsProvider
public TransientModelsProvider(@NotNull SRepository repository, @Nullable TransientModelsProvider.TransientSwapOwner swapOwner)
 
 - 
 
- 
Method Detail
- 
getRepository
public SRepository getRepository()
- Returns:
 - repository where transient modules reside
 
 
- 
clearAll
protected void clearAll(boolean dropCheckpoint)
 
- 
publishAll
public void publishAll()
Requires write lock for associated repository 
- 
createModule
@NotNull public TransientModelsModule createModule(@NotNull String moduleName)
Instantiate new transient, free-floating module with givenmoduleNameaugmented with implementation-specific stereotype. The module is NOT registered with any repository (including associated one). Transient modules get registered in the associated repository whenpublishAll()is requested. Thus, only publish activity would require write lock, while the transformation process is ok with a read on source model's repository. It's not final, though. If we manage to maintain distinct repository for transients, we still may lock it for write during transformation process (transitively locking source model's one for read) and there'd be no reason to be minimalistic about write lock then.- Parameters:
 moduleName- name for a new transient module, without stereotype- Returns:
 - new module instance
 
 
- 
associate
public void associate(@NotNull GeneratorTask task, @NotNull TransientModelsModule transientModule)
Record module that keeps transient models for the given task. Module originates fromcreateModule(String). This association is utilized bygetModule(GeneratorTask). Silently overwrites existing association, if any.- Parameters:
 task- transformation activitytransientModule- module to keep transient models at
 
- 
getModule
public TransientModelsModule getModule(GeneratorTask task)
XXX perhaps, GeneratorTask shall answer getTransientModule():SModule itself.- Parameters:
 task- notnull- Returns:
 - module to keep transients models of the task at
 
 
- 
getCheckpointsModule
public TransientModelsModule getCheckpointsModule()
 
- 
initCheckpointModule
public void initCheckpointModule()
Requires model write to register checkpoint module with a repository. 
- 
canKeepOneMore
public boolean canKeepOneMore()
 
- 
decreaseKeptModels
public void decreaseKeptModels()
 
- 
getTransientSwapSpace
@Nullable public TransientModelsProvider.TransientSwapSpace getTransientSwapSpace()
 
- 
removeAllTransient
public void removeAllTransient()
 
- 
removeAllTransients
public void removeAllTransients(boolean includeCheckpoints)
 
- 
getModules
public Iterable<TransientModelsModule> getModules()
 
- 
getTrace
@Nullable public GenerationTrace getTrace(@NotNull SModelReference model)
 
- 
startGeneration
public void startGeneration(int numberOfModelsToKeep)
 
 - 
 
 -