Package jetbrains.mps.classloading
Class ModuleClassLoader
- java.lang.Object
 - 
- java.lang.ClassLoader
 - 
- jetbrains.mps.classloading.MPSModuleClassLoader
 - 
- jetbrains.mps.classloading.ModuleClassLoader
 
 
 
 
- 
public final class ModuleClassLoader extends MPSModuleClassLoader
MPS implementation ofjava.lang.ClassLoaderwhich uses non-standard way of class loading delegation. Its methods #loadClass, #findResources are called by JVM during JVM class loading process and also by an explicit user call of #getClass and #getOwnClass methods inReloadableModuleand inClassLoaderManagerinstance (old deprecated way). Note that these methods yield additional error information in the case of failure. Users of class loading API are supposed to process it on their own behalf. This classloader implementation supports a redeploy of the module classes on the fly For example, all language modules possess an instance of such classloader. 
- 
- 
Nested Class Summary
Nested Classes Modifier and Type Class Description static classModuleClassLoader.ModuleClassLoaderIsDisposedException 
- 
Constructor Summary
Constructors Constructor Description ModuleClassLoader(ModuleClassLoaderSupport support) 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispose()Note: the actual dispose is called asynchronously in the EDT.protected URLfindResource(String name)protected Enumeration<URL>findResources(String name)URLgetResource(String name)Enumeration<URL>getResources(String name)booleanisDisposed()booleanisReloadableClassLoader()protected Class<?>loadClass(String name, boolean resolve)Class<?>loadOwnClass(String name)StringtoString()- 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findClass, findLibrary, findLoadedClass, findResource, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getResourceAsStream, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners 
 - 
 
 - 
 
- 
- 
Constructor Detail
- 
ModuleClassLoader
public ModuleClassLoader(@NotNull ModuleClassLoaderSupport support)
 
 - 
 
- 
Method Detail
- 
isDisposed
public boolean isDisposed()
 
- 
loadOwnClass
@NotNull public Class<?> loadOwnClass(String name) throws ClassNotFoundException
- Throws:
 ClassNotFoundException
 
- 
loadClass
protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException
- Overrides:
 loadClassin classClassLoader- Throws:
 ClassNotFoundException
 
- 
getResource
@Nullable public URL getResource(@NonNls String name)
- Overrides:
 getResourcein classClassLoader
 
- 
getResources
@NotNull public Enumeration<URL> getResources(@NonNls String name) throws IOException
- Overrides:
 getResourcesin classClassLoader- Throws:
 IOException
 
- 
findResource
protected URL findResource(String name)
- Overrides:
 findResourcein classClassLoader
 
- 
findResources
protected Enumeration<URL> findResources(String name)
- Overrides:
 findResourcesin classClassLoader
 
- 
dispose
public void dispose()
Note: the actual dispose is called asynchronously in the EDT. The motive is to allow a ClassLoading client to dispose asynchronously in the Event Dispatch Thread. 
- 
isReloadableClassLoader
public boolean isReloadableClassLoader()
- Specified by:
 isReloadableClassLoaderin classMPSModuleClassLoader- Returns:
 - true if the class loader is managed by MPS for instance, it might be a non-reloadable classloader which delegates directly to IDEA class loading subsystem (which is non-reloadable)
 
 
 - 
 
 -