Hilbert II - Version 0.03.08

org.qedeq.kernel.context
Class KernelContext

java.lang.Object
  extended byorg.qedeq.kernel.context.KernelContext
All Implemented Interfaces:
Kernel, KernelState, ModuleFactory

public final class KernelContext
extends Object
implements Kernel

This class provides static access methods for basic informations.

Version:
$Revision: 1.17 $

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.
 QedeqConfig getConfig()
          Get access to configuration parameters.
 String getDescriptiveKernelVersion()
          Get descriptive version information of this kernel.
 File getGenerationDirectory()
          Get directory for generated files.
static KernelContext getInstance()
          Get instance of kernel context.
 String getKernelVersion()
          Get version of this kernel.
 String getKernelVersionDirectory()
          Get relative version directory of this kernel.
 File getLocalFilePath(ModuleAddress address)
          Transform an URL address into a local file path where the QEDEQ module is buffered.
 String getMaximalRuleVersion()
          Get maximal supported rule version of this kernel.
 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.
 void init(ModuleFactory moduleFactory, QedeqConfig qedeqConfig)
          Kernel initialization.
 boolean isReady()
          Is the kernel ready to perform its main tasks.
 boolean isRuleVersionSupported(String ruleVersion)
          Is a given rule version supported?
 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 shutdown()
          Closes the kernel.
 void startup()
          Start all kernel activity now.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static final KernelContext getInstance()
Get instance of kernel context.

Returns:
Singleton, which is responsible for the kernel access.

getKernelVersion

public final String getKernelVersion()
Get version of this kernel.

Returns:
Kernel version.

getKernelVersionDirectory

public final String getKernelVersionDirectory()
Get relative version directory of this kernel.

Specified by:
getKernelVersionDirectory in interface Kernel
Returns:
Version sub directory.

getDescriptiveKernelVersion

public final String getDescriptiveKernelVersion()
Get descriptive version information of this kernel.

Returns:
Version Information.

getMaximalRuleVersion

public final String getMaximalRuleVersion()
Get maximal supported rule version of this kernel.

Returns:
Maximal supported rule version.

isRuleVersionSupported

public final boolean isRuleVersionSupported(String ruleVersion)
Is a given rule version supported?

Parameters:
ruleVersion - Check this one.
Returns:
Is the given rule version supported?

init

public void init(ModuleFactory moduleFactory,
                 QedeqConfig qedeqConfig)
          throws IOException
Description copied from interface: KernelState
Kernel initialization.

Specified by:
init in interface KernelState
Parameters:
moduleFactory - Factory for loading QEDEQ modules.
qedeqConfig - TODO
Throws:
IOException - Initialization failed.

isReady

public boolean isReady()
Description copied from interface: KernelState
Is the kernel ready to perform its main tasks.

Specified by:
isReady in interface KernelState
Returns:
Is the kernel ready?

getConfig

public QedeqConfig getConfig()
Description copied from interface: KernelState
Get access to configuration parameters.

Specified by:
getConfig in interface KernelState
Returns:
Configuration access.

shutdown

public void shutdown()
Description copied from interface: KernelState
Closes the kernel.

Specified by:
shutdown in interface KernelState

startup

public void startup()
Description copied from interface: KernelState
Start all kernel activity now.

Specified by:
startup in interface KernelState

removeAllModules

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

Specified by:
removeAllModules in interface ModuleFactory

removeModule

public void removeModule(ModuleAddress address)
                  throws IOException
Description copied from interface: ModuleFactory
Remove a certain module.

Specified by:
removeModule in interface ModuleFactory
Parameters:
address - Address of module.
Throws:
IOException - Module could not be successfully removed.

clearLocalBuffer

public void clearLocalBuffer()
                      throws IOException
Description copied from interface: ModuleFactory
Clear local buffer and all loaded QEDEQ modules.

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

loadModule

public ModuleProperties loadModule(ModuleAddress address)
                            throws SourceFileExceptionList
Description copied from interface: ModuleFactory
Get a certain module.

Specified by:
loadModule in interface ModuleFactory
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
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 properties.
Throws:
SourceFileExceptionList - Module could not be successfully loaded.

loadAllModulesFromQedeq

public boolean loadAllModulesFromQedeq()
Description copied from interface: ModuleFactory
Load all QEDEQ modules from project web directory for current kernel.

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

loadRequiredModules

public void loadRequiredModules(ModuleAddress address)
                         throws SourceFileExceptionList
Description copied from interface: ModuleFactory
Get a certain module.

Specified by:
loadRequiredModules in interface ModuleFactory
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.

getAllLoadedModules

public ModuleAddress[] 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.

getBufferDirectory

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

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

getGenerationDirectory

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

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

getModuleProperties

public ModuleProperties getModuleProperties(ModuleAddress 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.

getModuleAddress

public ModuleAddress getModuleAddress(URL url)
                               throws IOException
Description copied from interface: ModuleFactory
Get module address from URL.

Specified by:
getModuleAddress in interface ModuleFactory
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
Description copied from interface: ModuleFactory
Get module address from URL.

Specified by:
getModuleAddress in interface ModuleFactory
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
Description copied from interface: ModuleFactory
Get module address from URL.

Specified by:
getModuleAddress in interface ModuleFactory
Parameters:
file - Local QEDEQ module.
Returns:
Module address.
Throws:
IOException - URL has not the correct format for referencing a QEDEQ module.

getLocalFilePath

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

Specified by:
getLocalFilePath in interface ModuleFactory
Parameters:
address - Get local address for this QEDEQ module address.
Returns:
Local file path for that address.

Hilbert II - Version 0.03.08

©left GNU General Public Licence
All Rights Reserved.