com.voytechs.util
Interface Module

All Known Implementing Classes:
TestModule, TestModule2

public interface Module

Interface for external JAVA code modules. Modules are a collection of classes that can be dynamically loaded at run time. This is usefull in extending your software and making it modular where each module can be loaded as needed locally or over the network. Modules are loaded and returned by ModuleLoader object.


Field Summary
static boolean INITIALIZED
           
static int MODULE_LOAD_FROM_FILESYSTEM
           
static int MODULE_LOAD_FROM_NETWORK
           
static boolean NOT_INITIALIZED
           
 
Method Summary
 void initOnLoad(java.lang.Object environment)
          Initialization routine for the module.
 void initPostLoad(java.lang.Object environment)
          Initialization routine for the module.
 boolean isInitialized()
          Returns if this module has already went through its initialization process.
 

Field Detail

MODULE_LOAD_FROM_NETWORK

static final int MODULE_LOAD_FROM_NETWORK
See Also:
Constant Field Values

MODULE_LOAD_FROM_FILESYSTEM

static final int MODULE_LOAD_FROM_FILESYSTEM
See Also:
Constant Field Values

NOT_INITIALIZED

static final boolean NOT_INITIALIZED
See Also:
Constant Field Values

INITIALIZED

static final boolean INITIALIZED
See Also:
Constant Field Values
Method Detail

initOnLoad

void initOnLoad(java.lang.Object environment)
Initialization routine for the module. This method is called right after this module is loaded by ModuleLoader but before all other modules have been loaded. If there is a dependency on another module, there is no guarrantee that dependency module has bee already loaded.


initPostLoad

void initPostLoad(java.lang.Object environment)
Initialization routine for the module. This method is called after all the modules have been loaded by the ModuleLoader. This method can be used to finalize module initialization especially when there is a dependency on another module. This ensures that the depency module has been loaded before this call.

Parameters:
environment - An object that can be used to help initialize the module.

isInitialized

boolean isInitialized()
Returns if this module has already went through its initialization process. Both initOnLoad() and initPostLoad() must have been handled.

Returns:
true if both its initialization routines have been called.