Hilbert II - Version 0.03.04

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.12 $

Method Summary
 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.
 QedeqConfig getConfig()
          Get access to configuration parameters.
 String getDescriptiveKernelVersion()
          Get descriptive version information of this kernel.
 String 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.
 String getMaximalRuleVersion()
          Get maximal supported rule version of this kernel.
 ModuleProperties getModuleProperties(String address)
          Get ModuleProperties for an address.
 void init()
          Initialisation of ModuleFactory.
 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.
 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.
 void removeAllModules()
          Remove all modules from memory.
 void shutdown()
          Closes the kernel.
 void startup(ModuleFactory moduleFactory)
          Starts the kernel.
 
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?

startup

public void startup(ModuleFactory moduleFactory)
             throws IOException
Description copied from interface: KernelState
Starts the kernel.

Specified by:
startup in interface KernelState
Parameters:
moduleFactory - Factory for loading QEDEQ modules.
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

init

public 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

removeAllModules

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

Specified by:
removeAllModules in interface ModuleFactory

clearLocalBuffer

public void clearLocalBuffer()
                      throws IOException
Description copied from interface: ModuleFactory
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 QedeqBo loadModule(String address)
                   throws XmlFileExceptionList
Description copied from interface: ModuleFactory
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 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 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.

loadAllModulesFromQedeq

public 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.

getAllLoadedModules

public 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.

getBufferDirectory

public 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 String getGenerationDirectory()
Description copied from interface: ModuleFactory
Get directory for generated files.

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

getModuleProperties

public 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.