gnu.expr

Class ModuleManager


public class ModuleManager
extends java.lang.Object

A database of known modules as represented by ModuleInfo.. Current there is only a single global instanceof ModuleManager; in the future each different "applications" may have their own.

Field Summary

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

Method Summary

void
add(ModuleInfo info)
void
clear()
Reset the set of known modules.
ModuleInfo
find(Compilation comp)
ModuleInfo
findWithClassName(String className)
ModuleInfo
findWithSourcePath(String sourcePath)
ModuleInfo
findWithSourcePath(Path sourceAbsPath, String sourcePath)
ModuleInfo
findWithURL(URL url)
ModuleInfo
firstModule()
String
getCompilationDirectory()
static ModuleManager
getInstance()
For now assumes a single global ModuleManager.
void
loadPackageInfo(String packageName)
Search for and if needed load the ModuleSet for a package.
void
register(String moduleClass, String moduleSource, String moduleUri)
Called by compiler-generated code.
ModuleInfo
searchWithClassName(String className)
void
setCompilationDirectory(String path)

Field Details

LAST_MODIFIED_CACHE_TIME

public static final long LAST_MODIFIED_CACHE_TIME
Field Value:
1000L

lastModifiedCacheTime

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

Method Details

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(String sourcePath)

findWithSourcePath

public ModuleInfo findWithSourcePath(Path sourceAbsPath,
                                     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)
            throws ClassNotFoundException,
                   InstantiationException,
                   IllegalAccessException

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 ModuleSet.register(ModuleManager) 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)