Modules
A NetKernel module is similar to an application servers WAR files in that they contain resources, Java classes and libraries. However, unlike a
WAR, a module hosts an encapsulated private URI address space. It may also export a public URI address space -
in the examples above, the file: and active:xslt accessors are contained within modules and are exported on the
public interface of their host modules.
A module may import the public address spaces of another module into its internal address space . In this way a
module can be used as a shared library, or equally an application can be partitioned into cleanly separated layers. Importing a
module's public address space does not effect the exported public address space of the importing module - the public and
private address space are decoupled.
Figure2: An example of module encapsulation.
The Kernel takes care of management and isolation of all modules and their virtual URI address spaces. A request made in the address
space of a module will be resolved against the module's internal private address space.
A request may match the public interface of an imported module and enter that module. In order that a library
module need not have pre-knowledge of all address spaces, a module may pass a URI request, which is not matched
by its private internal address space, back up the module call-stack. It may then be resolved against the private
address space of the calling module. This process may apply recursively.
All modules are identified by a URI and have a version number. Modules may specify the minimum and maximum
versions of a module that they will accept for import. By being tightly encapsulated and versionable the
NetKernel abstraction ensures long-term system stability and even enables concurrent execution of
different generations of the same application.
Each module has an associated ClassLoader which provides the same level of isolation for the Java
class space as for the private URI address space, including respect for module version numbers.
In general an application on NetKernel will be composed from more than one module, each of
which will be responsible for a particular functional unit of the application.