|
||||
This is a short guide to configuring your development environment to develop with NetKernel. Note this concentrates on setting up an IDE for Java development of new Accessors etc. If you are developing an XML application all you need to do is boot the Kernel and edit your XML files in the module of your choice all changes will be detected automatically - you can change the poll interval in "configure global parameters" option in the "control panel". Configuring and Booting the Kernel
For development the Kernel can be booted with System.xml
The Kernel reads it's configuration from the first occurrence of system.xml in the classpath. In the standard
distribution this is Creating and Building a new module
You can use the new module wizard to create a preconfigured module with a stubbed out Accessor. The new
module will be placed in a directory under Step-by-step checklist
This checklist assumes you have installed NetKernel to an install directory refered to as <install> and that you will start developing
modules in
You can add any number of module directories to the modules/ directory. Each new module directory should be added to your IDE classpath. New classes in the module should be built against the kernel and the the libraries you added to your classpath. You must cold restart the Kernel for it to discover the new modules you create. Runtime vs Development-TimeAt development-time new classes are built against the IDE classpath - the settings described above will allow new Accessors to be built. However it is important to make clear that at runtime all modules are dynamically mounted and linked by the Kernel from the moduleDir directories defined in system.xml. Therefore, if you create a module which, for example, uses org.ten60.netkernel.xml.xahelper.XAccessor from the ext_xml-core module, you must ensure the module.xml configuration of your new
module imports XML LibrariesWith JDK1.4.x Sun made XML a core part of the JDK platform. Unfortunately they mixed Apache libraries into the system classpath. The core system classpath always overrides any application mounted classpaths. The upshot is that newer application mounted Apache libraries such as Xalan cannot be accessed without using the JVM endorsed mechanism. Furthermore Sun used the Crimson DOM as their default, which has now been deprecated in favour of the new Xerces DOM. Xerces will be the reference DOM used for JDK1.5 which will hopefully sort this mess out! What this means for NetKernel and XML development.
Debugging/SourcesIf you've set up your development environment as described so far your classes should be OK for interactive debugging in your IDE. You may want to access the source code of any modules you've built against. All source code is provided in each of the compressed modules in the modules/ directory. You can either use the source from the Jar or unzip the module jar file into a new directory and mount it in your IDE classpath. ToolsA number of tools are provided to trace and debug development issues with creating and linking modules. It is very useful to test that a module is configured such that a resource request in a given module is resolved in the correct location. You should now be all set to develop your modules. Advanced: Setting up the System by HandThe NetKernel distribution comes ready configured but for serious development you need a clean slate. This is a rough guide to setting up a clean system. System.xmlCreate a new directory in your NetKernel <install> directory - for illustration lets call this <moduleDir>expt/</moduleDir>
Any modules you create or add to expt/ will now be automatically discovered by the kernel at boot/reboot. NetKernel picks up it's configuration from the first occurrence of system.xml in the classpath. You must have a system.xml with location of your module directories in the classpath. BasepathThe Kernel resolves all relative paths with respect to the basepath specified in the system.xml. So far we've assumed you are using the install directory as the basepath. You can set a new basepath by editing system.xml. Note that all moduleDir declarations are relative to this basepath. Creating a Fulcrum
A Fulcrum is a top most module that imports the other modules that will make up the application. Generally a fulcrum also imports and starts a transport.
For an example of a fulcrum look at For your clean slate you can develop a fulcrum basd on these examples. The Module Guide provides great detail about creating and importing modules.
|
||||
|
© 2003,2004, 1060® Research Limited
1060 registered trademark, NetKernel trademark of 1060 Research Limited
|
||||