org.qedeq.kernel.bo
Class KernelContext

java.lang.Object
  extended by org.qedeq.kernel.bo.KernelContext
All Implemented Interfaces:
KernelProperties, KernelServices

public final class KernelContext
extends java.lang.Object
implements KernelProperties, KernelServices

This class provides static access methods for the kernel.

Author:
Michael Meyling

Method Summary
 boolean checkFormallyProved(ModuleAddress address)
          Check if all propositions of this and all required modules have correct formal proofs.
 boolean checkWellFormedness(ModuleAddress address)
          Check if all formulas of a QEDEQ module and its required modules are well formed.
 void clearAllPluginResults(ModuleAddress address)
          Clear all plugin warnings and errors for given module.
 boolean clearLocalBuffer()
          Clear local buffer and all loaded QEDEQ modules.
 java.lang.Object executePlugin(java.lang.String pluginName, ModuleAddress address, java.lang.Object data)
          Execute plugin on given QEDEQ module.
 ModuleAddress[] getAllLoadedModules()
          Get list of all currently loaded QEDEQ modules.
 java.lang.String getBuildId()
          Get build information.
 QedeqConfig getConfig()
           
 java.lang.String getDedication()
          Get dedication for this kernel.
 java.lang.String getDescriptiveKernelVersion()
          Get descriptive version information of this kernel.
static KernelContext getInstance()
          Get instance of kernel context.
 java.lang.String getKernelCodeName()
          Get code name of this kernel.
 java.lang.String getKernelVersion()
          Get version of this kernel.
 java.lang.String getKernelVersionDirectory()
          Get relative version directory of this kernel.
 java.lang.String getMaximalRuleVersion()
          Get maximal supported rule version of this kernel.
 ModuleAddress getModuleAddress(java.io.File file)
          Get module address from URL.
 ModuleAddress getModuleAddress(java.lang.String url)
          Get module address from URL.
 ModuleAddress getModuleAddress(java.net.URL url)
          Get module address from URL.
 ModuleService[] getPlugins()
          Get all installed plugins.
 QedeqBo getQedeqBo(ModuleAddress address)
          Get QedeqBo for an address.
 ServiceJob[] getRunningServiceProcesses()
          Get all running service processes.
 ServiceJob[] getServiceProcesses()
          Get information about all service processes.
 java.lang.String getSource(ModuleAddress address)
          Get source of an QEDEQ module.
 void init(QedeqConfig config, Kernel moduleServices)
          Init the kernel.
 boolean isRuleVersionSupported(java.lang.String ruleVersion)
          Is a given rule version supported?
 boolean isSetConnectionTimeOutSupported()
          Does URLConnection support the method setConnectionTimeOut in the currently running JVM.
 boolean isSetReadTimeoutSupported()
          Does URLConnection support the method setReadTimeOut in the currently running JVM.
 boolean loadAllModulesFromQedeq()
          Load all QEDEQ modules from project web directory for current kernel.
 QedeqBo loadModule(ModuleAddress address)
          Get a certain module.
 boolean loadRequiredModules(ModuleAddress address)
          Get required modules of given module.
 boolean removeAllModules()
          Remove all modules from memory.
 void removeModule(ModuleAddress address)
          Remove a QEDEQ module from memory.
 void shutdown()
          Shutdown the kernel.
 void startup()
          Startup the kernel.
 void terminateAllServiceProcesses()
          Stop all currently running service executions.
 
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.

getBuildId

public java.lang.String getBuildId()
Description copied from interface: KernelProperties
Get build information.

Specified by:
getBuildId in interface KernelProperties
Returns:
Implementation-version.

getKernelVersion

public final java.lang.String getKernelVersion()
Description copied from interface: KernelProperties
Get version of this kernel.

Specified by:
getKernelVersion in interface KernelProperties
Returns:
Kernel version.

getKernelCodeName

public final java.lang.String getKernelCodeName()
Description copied from interface: KernelProperties
Get code name of this kernel.

Specified by:
getKernelCodeName in interface KernelProperties
Returns:
Kernel code name.

getKernelVersionDirectory

public final java.lang.String getKernelVersionDirectory()
Description copied from interface: KernelProperties
Get relative version directory of this kernel.

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

getDescriptiveKernelVersion

public final java.lang.String getDescriptiveKernelVersion()
Description copied from interface: KernelProperties
Get descriptive version information of this kernel.

Specified by:
getDescriptiveKernelVersion in interface KernelProperties
Returns:
Version Information.

getDedication

public final java.lang.String getDedication()
Description copied from interface: KernelProperties
Get dedication for this kernel.

Specified by:
getDedication in interface KernelProperties
Returns:
Kernel code dedication.

getMaximalRuleVersion

public final java.lang.String getMaximalRuleVersion()
Description copied from interface: KernelProperties
Get maximal supported rule version of this kernel.

Specified by:
getMaximalRuleVersion in interface KernelProperties
Returns:
Maximal supported rule version.

isRuleVersionSupported

public final boolean isRuleVersionSupported(java.lang.String ruleVersion)
Description copied from interface: KernelProperties
Is a given rule version supported?

Specified by:
isRuleVersionSupported in interface KernelProperties
Parameters:
ruleVersion - Check this one.
Returns:
Is the given rule version supported?

isSetConnectionTimeOutSupported

public boolean isSetConnectionTimeOutSupported()
Description copied from interface: KernelProperties
Does URLConnection support the method setConnectionTimeOut in the currently running JVM. This should be true since version 1.5 but false for 1.4.2.

Specified by:
isSetConnectionTimeOutSupported in interface KernelProperties
Returns:
Method is supported?

isSetReadTimeoutSupported

public boolean isSetReadTimeoutSupported()
Description copied from interface: KernelProperties
Does URLConnection support the method setReadTimeOut in the currently running JVM. This should be true since version 1.5 but false for 1.4.2.

Specified by:
isSetReadTimeoutSupported in interface KernelProperties
Returns:
Method is supported?

getConfig

public QedeqConfig getConfig()

init

public void init(QedeqConfig config,
                 Kernel moduleServices)
          throws java.io.IOException
Init the kernel.

Parameters:
config - Configuration access. Must not be null.
moduleServices - Services for the kernel. Must not be null.
Throws:
java.lang.IllegalStateException - Kernel is already initialized.
java.io.IOException - Initialization failure.

startup

public void startup()
Startup the kernel.


shutdown

public void shutdown()
Shutdown the kernel.


removeAllModules

public boolean removeAllModules()
Description copied from interface: KernelServices
Remove all modules from memory.

Specified by:
removeAllModules in interface KernelServices
Returns:
Was removal successful?

removeModule

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

Specified by:
removeModule in interface KernelServices
Parameters:
address - Remove module identified by this address.

clearLocalBuffer

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

Specified by:
clearLocalBuffer in interface KernelServices
Returns:
Was deletion successful?

loadModule

public QedeqBo loadModule(ModuleAddress address)
Description copied from interface: KernelServices
Get a certain module. You can check the status to know if the loading was successful.

Specified by:
loadModule in interface KernelServices
Parameters:
address - Address of module.
Returns:
Wanted module.

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 boolean loadRequiredModules(ModuleAddress address)
Description copied from interface: KernelServices
Get required modules of given module. You can check the status to know if the loading was successful.

Specified by:
loadRequiredModules in interface KernelServices
Parameters:
address - Address of module.
Returns:
Successful loading.

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.

getModuleAddress

public ModuleAddress getModuleAddress(java.net.URL url)
                               throws java.io.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:
java.io.IOException - URL has not the correct format for referencing a QEDEQ module.

getModuleAddress

public ModuleAddress getModuleAddress(java.lang.String url)
                               throws java.io.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:
java.io.IOException - URL has not the correct format for referencing a QEDEQ module.

getModuleAddress

public ModuleAddress getModuleAddress(java.io.File file)
                               throws java.io.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:
java.io.IOException - URL has not the correct format for referencing a QEDEQ module.

getSource

public java.lang.String getSource(ModuleAddress address)
                           throws java.io.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:
java.io.IOException - Loading failed.

checkWellFormedness

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

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

checkFormallyProved

public boolean checkFormallyProved(ModuleAddress address)
Description copied from interface: KernelServices
Check if all propositions of this and all required modules have correct formal proofs.

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

getPlugins

public ModuleService[] getPlugins()
Description copied from interface: KernelServices
Get all installed plugins.

Specified by:
getPlugins in interface KernelServices
Returns:
Installed plugins.

executePlugin

public java.lang.Object executePlugin(java.lang.String pluginName,
                                      ModuleAddress address,
                                      java.lang.Object data)
                               throws InterruptException
Description copied from interface: KernelServices
Execute plugin on given QEDEQ module.

Specified by:
executePlugin in interface KernelServices
Parameters:
pluginName - Plugin id.
address - QEDEQ module address.
data - Process data. Additional data beside module.
Returns:
Plugin specific resulting object. Might be null.
Throws:
InterruptException - User canceled further processing.

clearAllPluginResults

public void clearAllPluginResults(ModuleAddress address)
Description copied from interface: KernelServices
Clear all plugin warnings and errors for given module.

Specified by:
clearAllPluginResults in interface KernelServices
Parameters:
address - QEDEQ module address.

getServiceProcesses

public ServiceJob[] getServiceProcesses()
Description copied from interface: KernelServices
Get information about all service processes.

Specified by:
getServiceProcesses in interface KernelServices
Returns:
Result.

getRunningServiceProcesses

public ServiceJob[] getRunningServiceProcesses()
Description copied from interface: KernelServices
Get all running service processes. But remember a running process might currently be blocked.

Specified by:
getRunningServiceProcesses in interface KernelServices
Returns:
All service running processes.

terminateAllServiceProcesses

public void terminateAllServiceProcesses()
Description copied from interface: KernelServices
Stop all currently running service executions.

Specified by:
terminateAllServiceProcesses in interface KernelServices


Copyright © 2014. All Rights Reserved.