code.loader
Class LoadManager

java.lang.Object
  extended by code.loader.LoadManager

public class LoadManager
extends java.lang.Object

LoadManager loads a module and its imported modules on demand.

This class is responsible for

  1. Loading a curry module on demand. The user pecifies the name of the module to load.

Since:
Aug 7, 2004 Modified by Sunita Marathe on Jul 15, 2005
Author:
Pravin Damle

Field Summary
private static java.lang.String currentModuleName
          The name of the currently loaded module.
private static java.lang.String defaultCurrentModuleName
          This is the name of the default module.
 
Constructor Summary
private LoadManager()
          prevent instance creation.
 
Method Summary
static java.lang.String getCurrentModuleName()
          A method to get the currentModuleName
static CurryModule load_r(java.lang.String moduleName)
          Load the specified module if not already loaded and then recursively load all its imported modules.
static void load(java.lang.String moduleName)
          Load the specified module from the CurryModulePath.
static void reload()
          Reload the current module.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultCurrentModuleName

private static final java.lang.String defaultCurrentModuleName
This is the name of the default module. It is loaded when no other module is loaded. This could happen initially or when a load fails.

See Also:
Constant Field Values

currentModuleName

private static java.lang.String currentModuleName
The name of the currently loaded module.

Constructor Detail

LoadManager

private LoadManager()
prevent instance creation.

Method Detail

getCurrentModuleName

public static java.lang.String getCurrentModuleName()
A method to get the currentModuleName

Returns:
String currentModuleName

reload

public static void reload()
Reload the current module.


load

public static void load(java.lang.String moduleName)
Load the specified module from the CurryModulePath. The moduleName is just the name of the module. It neither specifies the module file's path not its extension.

This method will be called in response to a "load" command from the load-eval-print loop.

Parameters:
moduleName - The name of the module to be loaded.

load_r

public static CurryModule load_r(java.lang.String moduleName)
                          throws java.lang.Exception
Load the specified module if not already loaded and then recursively load all its imported modules.

Parameters:
moduleName - name of the module to be loaded.
Returns:
CurryModule
Throws:
java.lang.Exception