harmonic.mz.manager
Class ModuleManager

java.lang.Object
  |
  +--harmonic.mz.manager.ModuleManager

public class ModuleManager
extends java.lang.Object

Manages the loading and unloading of extension modules


Field Summary
static java.util.Hashtable classNamesTable
          Table of all class names of all loaded modules
 
Constructor Summary
ModuleManager()
           
 
Method Summary
 Module _loadModule_(java.lang.String moduleClass, boolean bInitFiles)
          Load module, given fully qualified class name of module intializer.
 void addModuleListener(ModuleListener l)
          Add a module listener
 void addModuleStub(harmonic.mz.docnode.ModuleStub stub)
          Add a module stub to stubs list
 Module creatingModule(ModelNode node)
          Return the instance of the module that created the node.
 Module definingModule(java.lang.Object object)
          Return the instance of the module that defines the type of the node.
 java.util.Vector definingModules(java.util.Vector nodes)
          Return a list of extension modules owning the nodes.
 FunctionStarter fn(java.lang.String fn)
           
 FunctionStarter getFunction(java.lang.String functionName)
          Returns the registered function by trying all loaded modules.
 java.util.Vector getLoadedModules()
          Returns list of all loaded extension modules
 Module getModule(java.lang.String modulePackage)
          Return reference to loaded module
 java.util.Vector getModuleStubs()
          Return list of known module stubs.
 void initModule(Module mod)
          Initialized already instantiated module object in context of framework.
 void initModule(Module mod, java.lang.String moduleClass, boolean bInitFiles)
           
 Module loadModule(java.lang.String moduleClass)
           
 Module loadModule(java.lang.String moduleClass, boolean bInitFiles)
          Load module, add its functions, and read its settings file, given fully qualified class name of module intializer, which should extend Module.
 java.lang.String modulePackage(Module mod)
           
 void removeModuleListener(ModuleListener l)
          Remove a module listener
 void runMacro(java.lang.String moduleClass)
          This creates the macro, which is a Module like any large application module, and run Module.execute().
 void unloadAll()
          Unloads all modules!
 boolean unloadModule(java.lang.String moduleClass)
          Remove all of the module's actions and user interface from the system.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

classNamesTable

public static java.util.Hashtable classNamesTable
Table of all class names of all loaded modules

Constructor Detail

ModuleManager

public ModuleManager()
Method Detail

addModuleListener

public void addModuleListener(ModuleListener l)
Add a module listener


removeModuleListener

public void removeModuleListener(ModuleListener l)
Remove a module listener


getModuleStubs

public java.util.Vector getModuleStubs()
Return list of known module stubs. These show what modules are avalible


addModuleStub

public void addModuleStub(harmonic.mz.docnode.ModuleStub stub)
Add a module stub to stubs list


runMacro

public void runMacro(java.lang.String moduleClass)
This creates the macro, which is a Module like any large application module, and run Module.execute().


loadModule

public Module loadModule(java.lang.String moduleClass)

loadModule

public Module loadModule(java.lang.String moduleClass,
                         boolean bInitFiles)
Load module, add its functions, and read its settings file, given fully qualified class name of module intializer, which should extend Module.


_loadModule_

public Module _loadModule_(java.lang.String moduleClass,
                           boolean bInitFiles)
Load module, given fully qualified class name of module intializer. This function calls Module.addFunctions(), Module.readSettings(), Module.addGUI().
This function calls initModule(), so there should be no need to call it separately.


initModule

public void initModule(Module mod)
Initialized already instantiated module object in context of framework.


initModule

public void initModule(Module mod,
                       java.lang.String moduleClass,
                       boolean bInitFiles)

unloadAll

public void unloadAll()
Unloads all modules!


unloadModule

public boolean unloadModule(java.lang.String moduleClass)
Remove all of the module's actions and user interface from the system. Check that no open files depends on the proposed module to unload.


getModule

public Module getModule(java.lang.String modulePackage)
Return reference to loaded module


getLoadedModules

public java.util.Vector getLoadedModules()
Returns list of all loaded extension modules


modulePackage

public java.lang.String modulePackage(Module mod)

definingModules

public java.util.Vector definingModules(java.util.Vector nodes)
Return a list of extension modules owning the nodes. This relies on the first package name of node being the start of the module initialization class.


definingModule

public Module definingModule(java.lang.Object object)
Return the instance of the module that defines the type of the node. This looks at the package name of the node's class.


creatingModule

public Module creatingModule(ModelNode node)
Return the instance of the module that created the node.


fn

public FunctionStarter fn(java.lang.String fn)

getFunction

public FunctionStarter getFunction(java.lang.String functionName)
Returns the registered function by trying all loaded modules.