Package jetbrains.mps.tool.environment
Class EnvironmentBase
- java.lang.Object
 - 
- jetbrains.mps.tool.environment.EnvironmentBase
 
 
- 
- All Implemented Interfaces:
 Environment
- Direct Known Subclasses:
 MpsEnvironment
public abstract class EnvironmentBase extends Object implements Environment
Base class for all environments, represents a caching environment. The contract: only one environment must be alive, it is being stored in the special EnvironmentContainer class. 
- 
- 
Field Summary
Fields Modifier and Type Field Description protected EnvironmentConfigmyConfig 
- 
Constructor Summary
Constructors Constructor Description EnvironmentBase(EnvironmentConfig config) 
- 
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidcheckInitialized()voidcloseProject(Project project)Discards previously opened project.ProjectcreateProject(ProjectStrategy strategy)Creates a project and opens it according to the given strategyprotected ClassLoadercreateRootClassLoader()voiddispose()disposes the environment for real, does not consider ref countsprotected abstract voiddoDispose()protected abstract ProjectdoOpenProject(File projectFile)ProjectgetOpenedProject(File projectFile)Contract: Returns null if there is no opened project with such Fileprotected ClassLoadergetRootClassLoader()Root class loader: 1.protected voidinit(Platform mpsPlatform)static voidinitializeLog4j()protected abstract voidinitLibraries(LibraryInitializer libInitializer)ProjectopenProject(File projectFile)- 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
- 
Methods inherited from interface jetbrains.mps.tool.environment.Environment
createEmptyProject, flushAllEvents, getPlatform 
 - 
 
 - 
 
- 
- 
Field Detail
- 
myConfig
protected final EnvironmentConfig myConfig
 
 - 
 
- 
Constructor Detail
- 
EnvironmentBase
public EnvironmentBase(@NotNull EnvironmentConfig config)
 
 - 
 
- 
Method Detail
- 
initializeLog4j
public static void initializeLog4j()
 
- 
init
protected void init(Platform mpsPlatform)
 
- 
initLibraries
protected abstract void initLibraries(@NotNull LibraryInitializer libInitializer)
 
- 
getRootClassLoader
@Nullable protected final ClassLoader getRootClassLoader()
Root class loader: 1. As a root class loader for libraries in LibraryInitializer 2. As a root class loader for dumb idea plugin facet 
- 
createRootClassLoader
@Nullable protected ClassLoader createRootClassLoader()
 
- 
createProject
@NotNull public Project createProject(@NotNull ProjectStrategy strategy)
Description copied from interface:EnvironmentCreates a project and opens it according to the given strategy- Specified by:
 createProjectin interfaceEnvironment- Returns:
 - newly created Project constructed as the strategy suggests. It is already opened.
 
 
- 
getOpenedProject
@Nullable public final Project getOpenedProject(@NotNull File projectFile)
Contract: Returns null if there is no opened project with such File 
- 
openProject
@NotNull public Project openProject(@NotNull File projectFile)
- Specified by:
 openProjectin interfaceEnvironment
 
- 
closeProject
public void closeProject(@NotNull Project project)
Description copied from interface:EnvironmentDiscards previously opened project. Environment does its best to close the project but may choose to ignore request in certain scenarions (like in-process test execution, when closing an active project may affect user experience)- Specified by:
 closeProjectin interfaceEnvironment- Parameters:
 project- an instance obtained fromEnvironment.openProject(java.io.File)
 
- 
doDispose
protected abstract void doDispose()
 
- 
dispose
public final void dispose()
Description copied from interface:Environmentdisposes the environment for real, does not consider ref counts- Specified by:
 disposein interfaceEnvironment
 
- 
checkInitialized
protected final void checkInitialized()
 
 - 
 
 -