wtanaka.praya.module
Class ModuleManager

java.lang.Object
  |
  +--wtanaka.praya.module.ModuleManager

public class ModuleManager
extends java.lang.Object

An ordered list of modules, along with methods to start new modules and manage the list.

Return to Sourceforge or the Praya Homepage

Version:
$Name: $ $Date: 2001/10/10 09:41:42 $
Author:
$Author: wtanaka $

Field Summary
static int MODULE_TABLE_SIZE
           
private  Module[] modules
           
(package private)  int modulesAllocIndex
           
 
Constructor Summary
ModuleManager()
           
 
Method Summary
private  int assignModuleID(Module module)
           
 Module getModule(int index)
          Returns the given module.
 int loadModule(java.lang.Class moduleClass, Protocol[] prots)
          Loads a module and starts it.
 void removeModule(int index)
          Removes a module, stopping it first.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

MODULE_TABLE_SIZE

public static final int MODULE_TABLE_SIZE

modules

private Module[] modules

modulesAllocIndex

int modulesAllocIndex
Constructor Detail

ModuleManager

public ModuleManager()
Method Detail

assignModuleID

private int assignModuleID(Module module)
                    throws FailedLoadException
Returns:
the id allocated for the given module.

loadModule

public int loadModule(java.lang.Class moduleClass,
                      Protocol[] prots)
               throws FailedLoadException
Loads a module and starts it.
Returns:
the ID for the module.
Throws:
FailedLoadException - if any of the reflection on the module class failed.

removeModule

public void removeModule(int index)
Removes a module, stopping it first.

getModule

public Module getModule(int index)
Returns the given module.