Servlet Guide
System Development Guides
Release Notes
HTTP Transport
Intray Transport
Servlet Guide
CommandLine Mode
License
Change History
NetKernel History
Acknowledgements

Servlet Guide

Using the Embedding NetKernel Servlet

Embedded NetKernel Servlet

Supplied in the <install>/extra/ directory is an embedded NetKernel Servlet which allows NetKernel processes to be called from within a Servlet engine. The embedded servlet can be used directly to invoke a NetKernel process from a servlet-engine/app-server, alternatively it can be used as the basis for a custom servlet for your application.

Note: The NetKernel Servlet is provided as a convenience for pre-existing Servlet installations that would like to execute NetKernel hosted processes. NetKernel is transport and hence Servlet independent and does not require an app-server or servlet engine to create applications.

Setting up the Servlet

The Servlet supplied in the aux/ directory should run out of the box. It will boot NetKernel and use the default Salisbury Fulcrum to receive requests. The following steps can be followed to configure a new Servlet based NetKernel system.

  • NetKernel requires JDK1.4 or higher - your servlet engine/app server must be running on a 1.4+ JVM
  • Place 1060netkernel-2.0.x.jar and 1060netkernel-embedded-1.0.x.jar in the lib/ directory of the NetKernel servlet.
  • Edit the basepath in the <init-param> entry of web.xml (see below) to the basepath of the NetKernel system whose applications you want to use.

    <init-param>
      <param-name>basepath</param-name>
      <param-value>C:\path\to\netkernel\</param-value>
    </init-param>

  • Edit the basepath entry in the Servlet's system.xml NetKernel configuration file located in WEB-INF/classes/
  • Using the manufacturers specific instructions deploy the servlet to your servlet-engine/app-server. (Please take note of the 1060 Public License requirements - if your app server is not OSI certified open-source you may require a commercial NetKernel license)
  • Set-up a fulcrum module to import the internal transport. All requests from the Servlet will be invoked through the internal transport. See below.

Internal Transport

The NetKernel Servlet makes requests to NetKernel using the embedded API. All requests to NetKernel will be made on the Internal Transport and will be handled in the context of the module which imports the Internal Transport. (see embedded API for details). Requests received on the internal transport from the Servlet will be of the form servlet://server/path/resource...

Accessing the Query Data/Servlet-Context within a NetKernel application

Idoc

Like the Jetty HTTP transport, the NetKernel servlet XMLizes URL Query parameters and makes them available in this:param.

Each process invoked from the NetKernel Servlet makes the HttpServletRequest available as a parameter to the NetKernel process. It is accessible with the active URI name servletRequest. For example an idoc that wished to pass the servlet request to an Accessor can reference this as a parameter this:param:servletRequest so an instruction might be

<instr>
  <type>myAccessor</type>
  <operand>this:param:servletRequest</operand>
  <target>var:whatever</target>
</instr>

Accessor

In an Accessor the HttpServletRequest can be obtained by requesting a resource and specifying the IAspectHttpServletRequest representation. As ever the Accessor must have received the servlet request as an argument.


1060® NetKernelTM Documentation
(C) 2003-2004 1060 Research Limited

Send Feedback

© 2003,2004, 1060® Research Limited
1060 registered trademark, NetKernel trademark of 1060 Research Limited