Hilbert II - Version 0.03.09

org.qedeq.kernel.context
Class KernelContext

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

public final class KernelContext
extends Object
implements KernelProperties, KernelState, KernelServices

This class provides static access methods for basic informations.

Version:
$Revision: 1.18 $

Method Summary
 boolean checkModule(ModuleAddress address)
          Checks if all formulas of a QEDEQ module and its required modules are well formed.
 void clearLocalBuffer()
          Clear local buffer and all loaded QEDEQ modules.
 ModuleAddress[] getAllLoadedModules()
          Get list of all currently loaded QEDEQ modules.
 QedeqConfig getConfig()
          Get access to configuration parameters.
 String getDescriptiveKernelVersion()
          Get descriptive version information of this kernel.
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.
 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.
 QedeqBo getQedeqBo(ModuleAddress address)
          Get QedeqBo for an address.
 String getSource(ModuleAddress address)
          Get source of an QEDEQ module.
 String[] getSourceFileExceptionList(ModuleAddress address)
          Get description of source file exception list.
 void init(InternalKernelServices moduleFactory, QedeqConfig qedeqConfig)
          Kernel initialisation.
 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 address)
          Get 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 KernelProperties
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?

getConfig

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

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

init

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

Specified by:
init in interface KernelState
Parameters:
moduleFactory - Factory for loading QEDEQ modules.
qedeqConfig - Configuration to work with.
Throws:
IOException - Initialisation 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?

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: KernelServices
Remove all modules from memory.

Specified by:
removeAllModules in interface KernelServices

removeModule

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

Specified by:
removeModule in interface KernelServices
Parameters:
address - Address of module.

clearLocalBuffer

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

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

loadModule

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

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

loadAllModulesFromQedeq

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

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

loadRequiredModules

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

Specified by:
loadRequiredModules in interface KernelServices
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: KernelServices
Get list of all currently loaded QEDEQ modules.

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

getQedeqBo

public QedeqBo getQedeqBo(ModuleAddress address)
Description copied from interface: KernelServices
Get QedeqBo for an address.

Specified by:
getQedeqBo in interface KernelServices
Parameters:
address - Look for this address.
Returns:
Existing or new QedeqBo, if address is maleformed null is returned.

getModuleAddress

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

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

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

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

getSource

public String getSource(ModuleAddress address)
                 throws IOException
Description copied from interface: KernelServices
Get source of an QEDEQ module. If the module was not yet not buffered null is returned.

Specified by:
getSource in interface KernelServices
Parameters:
address - Address for QEDEQ module address.
Returns:
Contents of locally buffered QEDEQ module.
Throws:
IOException - Loading failed.

checkModule

public boolean checkModule(ModuleAddress address)
Description copied from interface: KernelServices
Checks if all formulas of a QEDEQ module and its required modules are well formed.

Specified by:
checkModule in interface KernelServices
Parameters:
address - Module to check.
Returns:
Was check successful?

getSourceFileExceptionList

public String[] getSourceFileExceptionList(ModuleAddress address)
Description copied from interface: KernelServices
Get description of source file exception list.

Specified by:
getSourceFileExceptionList in interface KernelServices
Parameters:
address - Get description for this module exceptions.
Returns:
Error description and location.

Hilbert II - Version 0.03.09

©left GNU General Public Licence
All Rights Reserved.