org.objectweb.jonathan.libs.kernel
Class KKernel
java.lang.Object
org.objectweb.jonathan.libs.kernel.KKernel
public final class KKernel
extends java.lang.Object
Bootstrap class of the jonathan configuration mechanism.
Provides the runtime configuration file mechanism by using
XML decoders and loads the java system properties.
Must be provided in the application's compiled configuration
by specifying the
bootstrap attribute of the root
context in the XML configuration file to be compiled. KKernel
is loaded in the java code of the compiled configuration file.
jonathan's example of KKernel use:
- the compiled configuration file is Kernel.java; it is
obtained from its XML source Kernel.kcf by the
Kcf2java
tool. Its class name (Kernel) is provided in the XML source
by the generated attribute of the root context.
- the runtime configuration file is jonathan.xml; its is
provided as the property named
"/jonathan/KKernel/runtime_configuration_file" in the
Kernel.kcf.
- the runtime configuration file is decoded by an
implementation of the interface
File2Configuration
(in fact
an OpenXMLDecoder
) whose configuration is provided in
Kernel.kcf.
as an assemblage named /jonathan/KKernel/xml_decoder.
The decoder is instanciated by the configuration bootstrap class
KKernel
.
- the whole mechanism is triggered by the org.objectweb.david.libs.binding.orbs.ORBClass
setParameters()
method, which calls the static
Kernel.newConfiguration() method and returns jonathan's
whole runtime configuration.
newConfiguration
public static Context newConfiguration(Context _context,
Class _c)
The jonathan Kernel's runtime bootstrap mechanism.
This method
- loads its context parameter's
/jonathan/KKernel/xml_decoder value; it must be an
implementation of
File2Configuration
- loads its context parameter's
/jonathan/KKernel/runtime_configuration_file String
property and decodes the corresponding runtime configuration
file with the previously loaded decoder; the decoded components
are imported in a duplicata of the given Context parameter.
- loads its context parameter's
/jonathan/KKernel/properties_decoder (it must be an
implementation of
Properties2Configuration
) and uses
it to import the java System properties
_context
- the compiled configuration to bootstrap on_c
-
- the application's complete runtime configuration