com.partnersoft.system
Class ModuleManager

java.lang.Object
  extended by com.partnersoft.system.ModuleManager

public class ModuleManager
extends java.lang.Object

Handles loading and tracking installed modules.

Copyright 2007 Partner Software, Inc.

Version:
$Id: ModuleManager.java 2328 2010-01-06 15:38:22Z paul $
Author:
Brad Gray, Paul Reavis

Constructor Summary
ModuleManager()
           
 
Method Summary
 void bootstrap()
          This method loads, validates, and initializes the modules.
 java.lang.String getJavaLibraryPath()
          Generates a library path (like java.library.path) with all available os/FOO/lib directories from all modules.
 Naming<Module> getModules()
           
 void initializeModules()
          Initializes the list of active modules, in priority order, by calling each module's initialization scripts.
 boolean isBootstrapped()
           
 boolean isWatchingForNewFiles()
           
 java.util.List<Module> listActiveModules()
          Returns the list of active modules, in priority order.
 java.util.List<VfsFile> listAllJars()
          This method returns a list of all jars that will be loaded.
 void loadModules()
          This method loads all modules in ConfigLevel priority order, so that e.g.
 Module moduleNamed(java.lang.String name)
          Returns the named module, or null if it does not exist or is not active.
 void runEventScripts(java.lang.String sourceModule, java.lang.String event, Naming<java.lang.Object> variables)
          Runs event scripts in all active modules.
 void setWatchingForNewFiles(boolean watchingForNewFiles)
           
 void shutdownModules()
          Shuts down the list of active modules, in priority order, by calling each module's shutdwown scripts.
 void startupModules()
          Starts the list of active modules, in priority order, by calling each module's startup scripts.
 void validateModules()
          Validates the loaded modules, generating the set of valid, active modules.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModuleManager

public ModuleManager()
Method Detail

bootstrap

public void bootstrap()
This method loads, validates, and initializes the modules. These are all the steps taken before the ModularClassLoader portion of the launch sequence takes over.


isBootstrapped

public boolean isBootstrapped()

listAllJars

public java.util.List<VfsFile> listAllJars()
This method returns a list of all jars that will be loaded.


loadModules

public void loadModules()
This method loads all modules in ConfigLevel priority order, so that e.g. one in modules/seat overrides one in e.g. modules/customer. It loads the module metadata from its info directory, but does not do any further processing.


validateModules

public void validateModules()
Validates the loaded modules, generating the set of valid, active modules.


initializeModules

public void initializeModules()
Initializes the list of active modules, in priority order, by calling each module's initialization scripts.


startupModules

public void startupModules()
Starts the list of active modules, in priority order, by calling each module's startup scripts.


shutdownModules

public void shutdownModules()
Shuts down the list of active modules, in priority order, by calling each module's shutdwown scripts.


listActiveModules

public java.util.List<Module> listActiveModules()
Returns the list of active modules, in priority order.

Returns:

runEventScripts

public void runEventScripts(java.lang.String sourceModule,
                            java.lang.String event,
                            Naming<java.lang.Object> variables)
Runs event scripts in all active modules. The sourceModule parameter specifies the module defining and originating the event; the name names the event.


moduleNamed

public Module moduleNamed(java.lang.String name)
Returns the named module, or null if it does not exist or is not active.

Returns:

isWatchingForNewFiles

public boolean isWatchingForNewFiles()

setWatchingForNewFiles

public void setWatchingForNewFiles(boolean watchingForNewFiles)

getModules

public Naming<Module> getModules()

getJavaLibraryPath

public java.lang.String getJavaLibraryPath()
Generates a library path (like java.library.path) with all available os/FOO/lib directories from all modules.

Returns: