gnu.expr

Class ModuleManager

public class ModuleManager extends Object

A database of known modules as represented by ModuleInfo.. Current there is only a single global instanceof {@code ModuleManager}; in the future each different "applications" may have their own.
Field Summary
longlastModifiedCacheTime
Number millseconds before we re-check file's modified time.
static longLAST_MODIFIED_CACHE_TIME
Method Summary
voidadd(ModuleInfo info)
voidclear()
Reset the set of known modules.
ModuleInfofind(Compilation comp)
ModuleInfofindWithClassName(String className)
ModuleInfofindWithSourcePath(Path sourceAbsPath, String sourcePath)
ModuleInfofindWithSourcePath(String sourcePath)
ModuleInfofindWithURL(URL url)
ModuleInfofirstModule()
StringgetCompilationDirectory()
static ModuleManagergetInstance()
For now assumes a single global ModuleManager.
voidloadPackageInfo(String packageName)
Search for and if needed load the ModuleSet for a package.
voidregister(String moduleClass, String moduleSource, String moduleUri)
Called by compiler-generated code.
ModuleInfosearchWithClassName(String className)
voidsetCompilationDirectory(String path)

Field Detail

lastModifiedCacheTime

public long lastModifiedCacheTime
Number millseconds before we re-check file's modified time.

LAST_MODIFIED_CACHE_TIME

public static final long LAST_MODIFIED_CACHE_TIME

Method Detail

add

public void add(ModuleInfo info)

clear

public void clear()
Reset the set of known modules.

find

public ModuleInfo find(Compilation comp)

findWithClassName

public ModuleInfo findWithClassName(String className)

findWithSourcePath

public ModuleInfo findWithSourcePath(Path sourceAbsPath, String sourcePath)

findWithSourcePath

public ModuleInfo findWithSourcePath(String sourcePath)

findWithURL

public ModuleInfo findWithURL(URL url)

firstModule

public ModuleInfo firstModule()

getCompilationDirectory

public String getCompilationDirectory()

getInstance

public static ModuleManager getInstance()
For now assumes a single global ModuleManager. Later, might have multiple managers.

loadPackageInfo

public void loadPackageInfo(String packageName)
Search for and if needed load the ModuleSet for a package.

register

public void register(String moduleClass, String moduleSource, String moduleUri)
Called by compiler-generated code. The compiler generates in each package a class that extends ModuleSet, and that contains a register method that calls back to this method. This method then registers the specified module.

searchWithClassName

public ModuleInfo searchWithClassName(String className)

setCompilationDirectory

public void setCompilationDirectory(String path)