uk.ac.man.bioinf.module
Interface ModuleFactoryInstance

All Known Implementing Classes:
DefaultModuleFactoryInstance, NullModuleFactory

public interface ModuleFactoryInstance

ModuleFactoryInstance.java This interface is designed to provide a means of storing loaded modules and their associated identifiers. It also allows configuration of the module. This is instance is called from the ModuleFactory which simply relays the requests here. Created: Tue May 9 13:53:20 2000

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

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 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 abstractIdentifer, 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.
 

Method Detail

isModuleAvailable

public boolean isModuleAvailable(ModuleIdentifier identifier)
Returns whether a module is available for use. This allows the use of optional modules.

Parameters:
identifier - the module identifier
Returns:
the availability of the target module

getModule

public Module getModule(ModuleIdentifier identifier)
                 throws ModuleException
Returns the module, given the module identifier.

Parameters:
identifier - the module identifier
Returns:
the module
ModuleException

getRequiredModules

public ModuleList getRequiredModules(ModuleIdentifier identifier)
Returns the modules required by the given module.

Parameters:
identifier - the module identifier of the module of interest
Returns:
the required modules

setConfig

public void setConfig(ModuleIdentifier identifier,
                      Object config)
Sets the config to a particular module described by an identifier.

Parameters:
identifier - the identifier
config - the config

getConfig

public Object getConfig(ModuleIdentifier identifier)
Returns the config object a given module


setConcreteIdentifier

public void setConcreteIdentifier(ModuleIdentifier abstractIdentifer,
                                  ModuleIdentifier concreteIdentifier)
Set the concrete identifier for a given abstract identifier.


addIdentifier

public void addIdentifier(ModuleIdentifier identifier)
Adds an identifier to the factory storage mechanism.

Parameters:
identifier - the identifier

addIdentifier

public void addIdentifier(ModuleIdentifier[] identifiers)
Adds identifiers to the factory storage mechanism.

Parameters:
identifiers - an array of identifiers

resolveModuleName

public ModuleIdentifier resolveModuleName(String moduleName)
Resolve a module name into a ModuleIdentifier

Parameters:
moduleName - the name of the module

resolveClassName

public ModuleIdentifier resolveClassName(String className)
Resolves a classname of a module into the module identifier.

Returns:
the module identifier

load

public Module load(ModuleIdentifier identifier)
            throws ModuleException
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.

Parameters:
identifier - the identifier
ModuleException

destroy

public void destroy()
Destroy all of the module instances, and remove all the internal data structures of this Factory.