Package gnu.expr
Class ModuleManager
java.lang.Object
gnu.expr.ModuleManager
A database of known modules as represented by
ModuleInfo
.
Currently there is only a single global instance of ModuleManager
;
in the future each different "application" may have their own.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final long
long
Number of milliseconds before we re-check file's modified time. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Reset the set of known modules.createWithClassName
(String className) find
(Compilation comp) static ModuleInfo
findWithClass
(Class clas) findWithClassName
(String className) findWithSourcePath
(gnu.kawa.io.Path sourceAbsPath, String sourcePath) findWithSourcePath
(String sourcePath) findWithURL
(URL url) static ModuleManager
For now assumes a single global ModuleManager.getModule
(int index) Used to generate unique class names for other evals.Used to generate unique class names for interactive REPLs and loads.void
loadPackageInfo
(String packageName) Search for and if needed load theModuleSet
for a package.void
Called by compiler-generated code.searchWithClassName
(String className) void
-
Field Details
-
interactiveClassPrefix
- See Also:
-
evalClassPrefix
-
LAST_MODIFIED_CACHE_TIME
public static final long LAST_MODIFIED_CACHE_TIME- See Also:
-
lastModifiedCacheTime
public long lastModifiedCacheTimeNumber of milliseconds before we re-check file's modified time.
-
-
Constructor Details
-
ModuleManager
public ModuleManager()
-
-
Method Details
-
setCompilationDirectory
-
getCompilationDirectory
-
getInstance
For now assumes a single global ModuleManager. Later, might have multiple managers. -
getNewInteractiveName
Used to generate unique class names for interactive REPLs and loads. This is incremented from Shell.run. Unique class names are essential forCompilation.usedClass(gnu.bytecode.Type)
. They're also desirable for debugging. -
getNewEvalName
Used to generate unique class names for other evals. Equivalent in functionality to getNewInteractiveName, but with a different prefix, for better user-friendliness. -
getModule
-
find
-
createWithClassName
-
searchWithClassName
-
findWithClass
-
findWithClassName
-
findWithSourcePath
-
findWithSourcePath
-
findWithURL
-
register
Called by compiler-generated code. The compiler generates in each package a class that extendsModuleSet
, and that contains aModuleSet.register(ModuleManager)
method that calls back to this method. This method then registers the specified module. -
loadPackageInfo
public void loadPackageInfo(String packageName) throws ClassNotFoundException, InstantiationException, IllegalAccessException Search for and if needed load theModuleSet
for a package. -
clear
public void clear()Reset the set of known modules.
-