Hilbert II - Version 0.03.08

org.qedeq.kernel.bo.module
Interface ModuleFactory

All Known Subinterfaces:
Kernel, KernelState
All Known Implementing Classes:
DefaultModuleFactory, KernelContext

public interface ModuleFactory

Access to QEDEQ modules.

Version:
$Revision: 1.7 $

Method Summary
 void clearLocalBuffer()
          Clear local buffer and all loaded QEDEQ modules.
 ModuleAddress[] getAllLoadedModules()
          Get list of all currently loaded QEDEQ modules.
 File getBufferDirectory()
          Get buffer directory for QEDEQ module files.
 File getGenerationDirectory()
          Get directory for generated files.
 File getLocalFilePath(ModuleAddress address)
          Transform an URL address into a local file path where the QEDEQ module is buffered.
 ModuleAddress getModuleAddress(File file)
          Get module address from URL.
 ModuleAddress getModuleAddress(String url)
          Get module address from URL.
 ModuleAddress getModuleAddress(URL url)
          Get module address from URL.
 ModuleProperties getModuleProperties(ModuleAddress address)
          Get ModuleProperties for an address.
 boolean loadAllModulesFromQedeq()
          Load all QEDEQ modules from project web directory for current kernel.
 ModuleProperties loadModule(ModuleAddress address)
          Get a certain module.
 ModuleProperties loadModule(QedeqBo module, Specification spec)
          Load a certain module.
 void loadRequiredModules(ModuleAddress address)
          Get a certain module.
 void removeAllModules()
          Remove all modules from memory.
 void removeModule(ModuleAddress address)
          Remove a certain module.
 void startup()
          Initialisation of ModuleFactory.
 

Method Detail

startup

public void startup()
Initialisation of ModuleFactory. This method should be called from the Kernel directly after switching into ready state. Calling this method in ready state is not supported. TODO mime 20070411: what about an appropriate closing method?


removeAllModules

public void removeAllModules()
Remove all modules from memory.


clearLocalBuffer

public void clearLocalBuffer()
                      throws IOException
Clear local buffer and all loaded QEDEQ modules.

Throws:
IOException - Deletion of all buffered file was not successful.

loadModule

public ModuleProperties loadModule(ModuleAddress address)
                            throws SourceFileExceptionList
Get a certain module.

Parameters:
address - Address of module.
Returns:
Wanted module.
Throws:
SourceFileExceptionList - Module could not be successfully loaded.

loadModule

public ModuleProperties loadModule(QedeqBo module,
                                   Specification spec)
                            throws SourceFileExceptionList
Load a certain module.

Parameters:
module - This is the current module.
spec - Specification of wanted module.
Returns:
Wanted module properties.
Throws:
SourceFileExceptionList - Module could not be successfully loaded.

loadRequiredModules

public void loadRequiredModules(ModuleAddress address)
                         throws SourceFileExceptionList
Get a certain module.

Parameters:
address - Address of module.
Throws:
SourceFileExceptionList - Required modules could not be successfully loaded. This can also happen if the required modules references form a circle.

loadAllModulesFromQedeq

public boolean loadAllModulesFromQedeq()
Load all QEDEQ modules from project web directory for current kernel.

Returns:
Successful loading.

removeModule

public void removeModule(ModuleAddress address)
                  throws IOException
Remove a certain module.

Parameters:
address - Address of module.
Throws:
IOException - Module could not be successfully removed.

getAllLoadedModules

public ModuleAddress[] getAllLoadedModules()
Get list of all currently loaded QEDEQ modules.

Returns:
All currently loaded QEDEQ modules.

getBufferDirectory

public File getBufferDirectory()
Get buffer directory for QEDEQ module files.

Returns:
buffer directory.

getGenerationDirectory

public File getGenerationDirectory()
Get directory for generated files.

Returns:
Generation directory.

getModuleProperties

public ModuleProperties getModuleProperties(ModuleAddress address)
Get ModuleProperties for an address.

Parameters:
address - Look for this address.
Returns:
Existing or new ModuleProperties, if address is maleformed null is returned.

getLocalFilePath

public File getLocalFilePath(ModuleAddress address)
Transform an URL address into a local file path where the QEDEQ module is buffered. If the module is not buffered null is returned.

Parameters:
address - Get local address for this QEDEQ module address.
Returns:
Local file path for that address.

getModuleAddress

public ModuleAddress getModuleAddress(URL url)
                               throws IOException
Get module address from URL.

Parameters:
url - URL for QEDEQ module.
Returns:
Module address.
Throws:
IOException - URL has not the correct format for referencing a QEDEQ module.

getModuleAddress

public ModuleAddress getModuleAddress(String url)
                               throws IOException
Get module address from URL.

Parameters:
url - URL for QEDEQ module.
Returns:
Module address.
Throws:
IOException - URL has not the correct format for referencing a QEDEQ module.

getModuleAddress

public ModuleAddress getModuleAddress(File file)
                               throws IOException
Get module address from URL.

Parameters:
file - Local QEDEQ module.
Returns:
Module address.
Throws:
IOException - URL has not the correct format for referencing a QEDEQ module.

Hilbert II - Version 0.03.08

©left GNU General Public Licence
All Rights Reserved.