gnu.expr
Class ModuleManager

java.lang.Object
  extended by gnu.expr.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
 java.lang.ClassLoader defaultClassLoader
           
static long LAST_MODIFIED_CACHE_TIME
           
 long lastModifiedCacheTime
          Number millseconds before we re-check file's modified time.
 
Constructor Summary
ModuleManager()
           
 
Method Summary
 void add(ModuleInfo info)
           
 void clear()
          Reset the set of known modules.
 ModuleInfo find(Compilation comp)
           
 ModuleInfo findWithClassName(java.lang.String className)
           
 ModuleInfo findWithSourcePath(java.lang.String sourcePath)
           
 ModuleInfo findWithURL(java.net.URL url)
           
 ModuleInfo firstModule()
           
 java.lang.String getCompilationDirectory()
           
static ModuleManager getInstance()
          For now assumes a single global ModuleManager.
 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultClassLoader

public java.lang.ClassLoader defaultClassLoader

LAST_MODIFIED_CACHE_TIME

public static final long LAST_MODIFIED_CACHE_TIME
See Also:
Constant Field Values

lastModifiedCacheTime

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

Constructor Detail

ModuleManager

public ModuleManager()
Method Detail

setCompilationDirectory

public void setCompilationDirectory(java.lang.String path)

getCompilationDirectory

public java.lang.String getCompilationDirectory()

getInstance

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


firstModule

public ModuleInfo firstModule()

find

public ModuleInfo find(Compilation comp)

add

public void add(ModuleInfo info)

searchWithClassName

public ModuleInfo searchWithClassName(java.lang.String className)

findWithClassName

public ModuleInfo findWithClassName(java.lang.String className)

findWithSourcePath

public ModuleInfo findWithSourcePath(java.lang.String sourcePath)

findWithURL

public ModuleInfo findWithURL(java.net.URL url)

register

public void register(java.lang.String moduleClass,
                     java.lang.String moduleSource,
                     java.lang.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.


loadPackageInfo

public void loadPackageInfo(java.lang.String packageName)
                     throws java.lang.ClassNotFoundException,
                            java.lang.InstantiationException,
                            java.lang.IllegalAccessException
Search for and if needed load the ModuleSet for a package.

Throws:
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException

clear

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