public class ModuleManager
extends java.lang.Object
ModuleInfo
.
Currently there is only a single global instance of ModuleManager
;
in the future each different "application" may have their own.Modifier and Type | Field and Description |
---|---|
java.lang.String |
evalClassPrefix |
static java.lang.String |
interactiveClassPrefix |
static long |
LAST_MODIFIED_CACHE_TIME |
long |
lastModifiedCacheTime
Number of milliseconds before we re-check file's modified time.
|
Constructor and Description |
---|
ModuleManager() |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Reset the set of known modules.
|
ModuleInfo |
createWithClassName(java.lang.String className) |
ModuleInfo |
find(Compilation comp) |
static ModuleInfo |
findWithClass(java.lang.Class clas) |
ModuleInfo |
findWithClassName(java.lang.String className) |
ModuleInfo |
findWithSourcePath(gnu.kawa.io.Path sourceAbsPath,
java.lang.String sourcePath) |
ModuleInfo |
findWithSourcePath(java.lang.String sourcePath) |
ModuleInfo |
findWithURL(java.net.URL url) |
java.lang.String |
getCompilationDirectory() |
static ModuleManager |
getInstance()
For now assumes a single global ModuleManager.
|
ModuleInfo |
getModule(int index) |
java.lang.String |
getNewEvalName()
Used to generate unique class names for other evals.
|
java.lang.String |
getNewInteractiveName()
Used to generate unique class names for interactive REPLs and loads.
|
void |
loadPackageInfo(java.lang.String packageName)
Search for and if needed load the
ModuleSet for a package. |
void |
register(java.lang.String moduleClass,
java.lang.String moduleSource,
java.lang.String moduleUri)
Called by compiler-generated code.
|
ModuleInfo |
searchWithClassName(java.lang.String className) |
void |
setCompilationDirectory(java.lang.String path) |
public static final java.lang.String interactiveClassPrefix
public java.lang.String evalClassPrefix
public static final long LAST_MODIFIED_CACHE_TIME
public long lastModifiedCacheTime
public void setCompilationDirectory(java.lang.String path)
public java.lang.String getCompilationDirectory()
public static ModuleManager getInstance()
public java.lang.String getNewInteractiveName()
Compilation.usedClass(gnu.bytecode.Type)
.
They're also desirable for debugging.public java.lang.String getNewEvalName()
public ModuleInfo getModule(int index)
public ModuleInfo find(Compilation comp)
public ModuleInfo createWithClassName(java.lang.String className)
public ModuleInfo searchWithClassName(java.lang.String className)
public static ModuleInfo findWithClass(java.lang.Class clas)
public ModuleInfo findWithClassName(java.lang.String className)
public ModuleInfo findWithSourcePath(gnu.kawa.io.Path sourceAbsPath, java.lang.String sourcePath)
public ModuleInfo findWithSourcePath(java.lang.String sourcePath)
public ModuleInfo findWithURL(java.net.URL url)
public void register(java.lang.String moduleClass, java.lang.String moduleSource, java.lang.String moduleUri)
ModuleSet
, and that contains a
ModuleSet.register(ModuleManager)
method that calls
back to this method. This method then registers the specified module.public void loadPackageInfo(java.lang.String packageName) throws java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessException
ModuleSet
for a package.java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
public void clear()