uk.ac.man.bioinf.module
Class DefaultModuleFactoryInstance

java.lang.Object
  |
  +--uk.ac.man.bioinf.module.DefaultModuleFactoryInstance
All Implemented Interfaces:
ModuleFactoryInstance
Direct Known Subclasses:
CinemaModuleFactoryInstance

public class DefaultModuleFactoryInstance
extends Object
implements ModuleFactoryInstance

DefaultModuleFactoryInstance.java Created: Thu May 11 13:02:22 2000

Version:
$Id: DefaultModuleFactoryInstance.java,v 1.13 2001/04/11 17:04:43 lord Exp $
Author:
J Selley

Constructor Summary
DefaultModuleFactoryInstance()
           
 
Method Summary
 void addIdentifier(ModuleIdentifier identifier)
          Adds an identifier to the factory storage mechanism.
 void addIdentifier(ModuleIdentifier[] identifiers)
          Adds identifiers to the factory storage mechanism.
 void addRequiredModule(ModuleIdentifier identifier, Module reqMod)
           
 void addRequiredModules(ModuleIdentifier identifier, Module[] reqMods)
           
 void destroy()
          Destroy all of the module instances, and remove all the internal data structures of this Factory.
 Object getConfig(ModuleIdentifier identifier)
          Returns the config object a given module
 Module getModule(ModuleIdentifier identifier)
          Returns the module, given the module identifier.
 ModuleList getRequiredModules(ModuleIdentifier identifier)
          Returns the modules required by the given module.
 boolean isModuleAvailable(ModuleIdentifier identifier)
          Returns whether a module is available for use.
 Module load(ModuleIdentifier identifier)
          Loads the module associated with a particular identifier.
 ModuleIdentifier resolveClassName(String classname)
          Resolves a classname of a module into the module identifier.
 ModuleIdentifier resolveModuleName(String moduleName)
          Resolve a module name into a ModuleIdentifier
 void setConcreteIdentifier(ModuleIdentifier abstractIdentifier, ModuleIdentifier concreteIdentifier)
          Set the concrete identifier for a given abstract identifier.
 void setConfig(ModuleIdentifier identifier, Object config)
          Sets the config to a particular module described by an identifier.
 void setModule(ModuleIdentifier identifier, Module module)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultModuleFactoryInstance

public DefaultModuleFactoryInstance()
Method Detail

load

public Module load(ModuleIdentifier identifier)
            throws ModuleException
Description copied from interface: ModuleFactoryInstance
Loads the module associated with a particular identifier. This will include a call to the load method of the module. It should also subsequently check that all requried modules are loaded as well.

Specified by:
load in interface ModuleFactoryInstance
Parameters:
identifier - the identifier
ModuleException

addIdentifier

public void addIdentifier(ModuleIdentifier identifier)
Description copied from interface: ModuleFactoryInstance
Adds an identifier to the factory storage mechanism.

Specified by:
addIdentifier in interface ModuleFactoryInstance
Parameters:
identifier - the identifier

addIdentifier

public void addIdentifier(ModuleIdentifier[] identifiers)
Description copied from interface: ModuleFactoryInstance
Adds identifiers to the factory storage mechanism.

Specified by:
addIdentifier in interface ModuleFactoryInstance
Parameters:
identifiers - an array of identifiers

resolveModuleName

public ModuleIdentifier resolveModuleName(String moduleName)
Description copied from interface: ModuleFactoryInstance
Resolve a module name into a ModuleIdentifier

Specified by:
resolveModuleName in interface ModuleFactoryInstance
Parameters:
moduleName - the name of the module

resolveClassName

public ModuleIdentifier resolveClassName(String classname)
Description copied from interface: ModuleFactoryInstance
Resolves a classname of a module into the module identifier.

Specified by:
resolveClassName in interface ModuleFactoryInstance
Returns:
the module identifier

setModule

public void setModule(ModuleIdentifier identifier,
                      Module module)
               throws ModuleException
ModuleException

getModule

public Module getModule(ModuleIdentifier identifier)
                 throws ModuleException
Description copied from interface: ModuleFactoryInstance
Returns the module, given the module identifier.

Specified by:
getModule in interface ModuleFactoryInstance
Parameters:
identifier - the module identifier
Returns:
the module
ModuleException

addRequiredModules

public void addRequiredModules(ModuleIdentifier identifier,
                               Module[] reqMods)

addRequiredModule

public void addRequiredModule(ModuleIdentifier identifier,
                              Module reqMod)

getRequiredModules

public ModuleList getRequiredModules(ModuleIdentifier identifier)
Description copied from interface: ModuleFactoryInstance
Returns the modules required by the given module.

Specified by:
getRequiredModules in interface ModuleFactoryInstance
Parameters:
identifier - the module identifier of the module of interest
Returns:
the required modules

setConfig

public void setConfig(ModuleIdentifier identifier,
                      Object config)
Description copied from interface: ModuleFactoryInstance
Sets the config to a particular module described by an identifier.

Specified by:
setConfig in interface ModuleFactoryInstance
Parameters:
identifier - the identifier
config - the config

getConfig

public Object getConfig(ModuleIdentifier identifier)
Description copied from interface: ModuleFactoryInstance
Returns the config object a given module

Specified by:
getConfig in interface ModuleFactoryInstance

setConcreteIdentifier

public void setConcreteIdentifier(ModuleIdentifier abstractIdentifier,
                                  ModuleIdentifier concreteIdentifier)
Description copied from interface: ModuleFactoryInstance
Set the concrete identifier for a given abstract identifier.

Specified by:
setConcreteIdentifier in interface ModuleFactoryInstance

isModuleAvailable

public boolean isModuleAvailable(ModuleIdentifier identifier)
Description copied from interface: ModuleFactoryInstance
Returns whether a module is available for use. This allows the use of optional modules.

Specified by:
isModuleAvailable in interface ModuleFactoryInstance
Parameters:
identifier - the module identifier
Returns:
the availability of the target module

destroy

public void destroy()
Description copied from interface: ModuleFactoryInstance
Destroy all of the module instances, and remove all the internal data structures of this Factory.

Specified by:
destroy in interface ModuleFactoryInstance