Hilbert II - Version 0.03.04

org.qedeq.kernel.bo.load
Class DefaultModuleFactory

java.lang.Object
  extended byorg.qedeq.kernel.bo.load.DefaultModuleFactory
All Implemented Interfaces:
ModuleFactory

public class DefaultModuleFactory
extends Object
implements ModuleFactory

This class provides access methods for loading QEDEQ modules.

Version:
$Revision: 1.1 $

Constructor Summary
DefaultModuleFactory(Kernel kernel)
          Constructor.
 
Method Summary
 void autoReloadLastSessionChecked()
          If configured load all QEDEQ modules that where successfully loaded the last time.
 void clearLocalBuffer()
          Clear local file buffer and all loaded QEDEQ modules.
 String[] getAllLoadedModules()
          Get list of all currently loaded QEDEQ modules.
 String getBufferDirectory()
          Get buffer directory for QEDEQ module files.
 String getGenerationDirectory()
          Get directory for generated files.
 String getLocalName(ModuleAddress moduleAddress)
          Transform an URL address into a local file path where the QEDEQ module is buffered.
 ModuleProperties getModuleProperties(String address)
          Get ModuleProperties for an address.
 void init()
          Initialisation of ModuleFactory.
 boolean loadAllModulesFromQedeq()
          Load all QEDEQ modules from project web directory for current kernel.
 QedeqBo loadModule(ModuleAddress moduleAddress)
          Get a certain module.
 QedeqBo loadModule(QedeqBo module, Specification spec)
          Load a certain module.
 QedeqBo loadModule(String address)
          Get a certain module.
 boolean loadPreviouslySuccessfullyLoadedModules()
          Load all previously checked QEDEQ modules.
 void removeAllModules()
          Remove all modules from memory.
 void removeModuleAndDependents(ModuleProperties prop)
          Remove a QEDEQ module from memory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultModuleFactory

public DefaultModuleFactory(Kernel kernel)
Constructor.

Parameters:
kernel - For kernel access.
Method Detail

init

public final void init()
Description copied from interface: ModuleFactory
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?

Specified by:
init in interface ModuleFactory

autoReloadLastSessionChecked

public final void autoReloadLastSessionChecked()
If configured load all QEDEQ modules that where successfully loaded the last time.


removeAllModules

public final void removeAllModules()
Description copied from interface: ModuleFactory
Remove all modules from memory.

Specified by:
removeAllModules in interface ModuleFactory

removeModuleAndDependents

public final void removeModuleAndDependents(ModuleProperties prop)
Remove a QEDEQ module from memory.

Parameters:
prop - Remove module identified by this property.

clearLocalBuffer

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

Specified by:
clearLocalBuffer in interface ModuleFactory
Throws:
IOException - Deletion of all buffered file was not successful.

loadModule

public final QedeqBo loadModule(String address)
                         throws XmlFileExceptionList
Get a certain module.

Specified by:
loadModule in interface ModuleFactory
Parameters:
address - Address of module.
Returns:
Wanted module.
Throws:
XmlFileExceptionList - Module could not be successfully loaded.

loadModule

public final QedeqBo loadModule(ModuleAddress moduleAddress)
                         throws XmlFileExceptionList
Description copied from interface: ModuleFactory
Get a certain module.

Specified by:
loadModule in interface ModuleFactory
Parameters:
moduleAddress - Address of module.
Returns:
Wanted module.
Throws:
XmlFileExceptionList - Module could not be successfully loaded.

loadModule

public final QedeqBo loadModule(QedeqBo module,
                                Specification spec)
                         throws XmlFileExceptionList
Description copied from interface: ModuleFactory
Load a certain module.

Specified by:
loadModule in interface ModuleFactory
Parameters:
module - this is the current module.
spec - specification of wanted module.
Returns:
wanted module
Throws:
XmlFileExceptionList - Module could not be successfully loaded.

getAllLoadedModules

public final String[] getAllLoadedModules()
Description copied from interface: ModuleFactory
Get list of all currently loaded QEDEQ modules.

Specified by:
getAllLoadedModules in interface ModuleFactory
Returns:
All currently loaded QEDEQ modules.

loadPreviouslySuccessfullyLoadedModules

public final boolean loadPreviouslySuccessfullyLoadedModules()
Load all previously checked QEDEQ modules.

Returns:
Successfully reloaded all modules.

loadAllModulesFromQedeq

public final boolean loadAllModulesFromQedeq()
Description copied from interface: ModuleFactory
Load all QEDEQ modules from project web directory for current kernel. LATER mime 20070326: dynamic loading from web page directory

Specified by:
loadAllModulesFromQedeq in interface ModuleFactory
Returns:
Successful loading.

getLocalName

public final String getLocalName(ModuleAddress moduleAddress)
Transform an URL address into a local file path where the QEDEQ module is buffered.

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

getBufferDirectory

public final String getBufferDirectory()
Description copied from interface: ModuleFactory
Get buffer directory for QEDEQ module files.

Specified by:
getBufferDirectory in interface ModuleFactory
Returns:
buffer directory.

getGenerationDirectory

public final String getGenerationDirectory()
Description copied from interface: ModuleFactory
Get directory for generated files.

Specified by:
getGenerationDirectory in interface ModuleFactory
Returns:
Generation directory.

getModuleProperties

public final ModuleProperties getModuleProperties(String address)
Description copied from interface: ModuleFactory
Get ModuleProperties for an address.

Specified by:
getModuleProperties in interface ModuleFactory
Parameters:
address - Look for this address.
Returns:
Existing or new ModuleProperties, if address is maleformed null is returned.

Hilbert II - Version 0.03.04

©left GNU General Public Licence
All Rights Reserved.