uk.ac.man.bioinf.module
Class ModuleContext

java.lang.Object
  |
  +--uk.ac.man.bioinf.module.ModuleContext
Direct Known Subclasses:
DefaultModuleContext

public abstract class ModuleContext
extends Object

ModuleContext.java Gives context to a module (e.g: configuration information). Created: Tue Apr 18 19:17:55 2000

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

Constructor Summary
ModuleContext()
           
 
Method Summary
abstract  Object getConfig()
          Returns an object representing the configuration of the module.
abstract  ModuleIdentifier getIdentifier()
          Returns the modules identifier.
 Module getModule()
          Returns the associated module for this context.
 Module getModule(ModuleIdentifier identifier)
          Returns a module by interfacing with the ModuleHandlerFactory.
 ModuleFactoryInstance getModuleFactory()
           
 ModuleList getRequiredModules()
           
 boolean isModuleAvailable(ModuleIdentifier identifier)
          Returns whether a module is available for use, given the identifier.
 ModuleIdentifier resolveModuleName(String moduleName)
          This method resolves a module name into a ModuleIdentifier.
 void setModuleFactory(ModuleFactoryInstance moduleFactory)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModuleContext

public ModuleContext()
Method Detail

setModuleFactory

public void setModuleFactory(ModuleFactoryInstance moduleFactory)

getModuleFactory

public ModuleFactoryInstance getModuleFactory()

isModuleAvailable

public boolean isModuleAvailable(ModuleIdentifier identifier)
Returns whether a module is available for use, given the identifier. Allows for optional modules.

Parameters:
identifier - the module identifier for the optional module
Returns:
the availability of the module

getModule

public Module getModule(ModuleIdentifier identifier)
                 throws ModuleException
Returns a module by interfacing with the ModuleHandlerFactory. It is designed to allow use of optional modules.

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

resolveModuleName

public ModuleIdentifier resolveModuleName(String moduleName)
This method resolves a module name into a ModuleIdentifier. Generally speaking this method is not the preferred mechanisms for getting a ModuleIdentifier. If a ModuleIdentifier extends AbstractEnumeratedModuleIdentifier, then they can be directly accessed in a way which is compile time type safe.

Parameters:
moduleName -
Returns:

getModule

public Module getModule()
                 throws ModuleException
Returns the associated module for this context.

Returns:
the module
ModuleException

getRequiredModules

public ModuleList getRequiredModules()

getIdentifier

public abstract ModuleIdentifier getIdentifier()
Returns the modules identifier.

Returns:
the module identifier

getConfig

public abstract Object getConfig()
Returns an object representing the configuration of the module.

Returns:
the configuration