Accessor Development
A guide to creating universal resource accessors
Index > Books > Advanced Developer Guide and Reference > Component Dev > Accessor Development

Rate this page:
Really useful
Satisfactory
Not helpful
Confusing
Incorrect
Unsure
Extra comments:


Accessor Development

This guide covers development of Universal Resource Accessors. Accessors are software components which implement URI service endpoints which process URI requests. The mechanism by which requests are mapped to accessors is described in the Module Development section.

It is helpful to distinguish Accessors into two categories:

  • Data Accessors generally handle the full complement of NetKernel request types: SOURCE, SINK, EXISTS, NEW and DELETE. Data Accessors usually provide an implementation of a complete URI scheme - examples are http:, file: or data:
  • Active Accessors usually provide an implementation of a transformation function or service which receives URIs and/or resources and processes them in some way to produce a resource. It is usually only necessary to handle SOURCE requests with active accessors.
Fundamentally Accessors handle NetKernel requests and may optionally issue new NetKernel Requests as part of their operation. Their implementation can be very flexible though this broad categorisation aids understanding.

Implementing an Accessor

All accessors must implement the com.ten60.netkernel.urii.IURAccessor interface. This interface is part of the kernel's Universal Resource Infrastructure abstraction.

Shipped with NetKernel Standard Edition there are three implementing base classes which have differing characteristics:

  • org.ten60.netkernel.layer1.accessor.AccessorImpl is exported from the ext_layer1 module. This base class is suitable for the development of both data accessors and active accessors that require low-level interaction with the kernel.
  • org.ten60.netkernel.layer1.nkf.impl.NKFAccessorImpl is exported from the layer1 module. This base class is part of the NetKernel Foundation API and provides a fully-featured high-level abstraction which manages the complexity of direct interaction with the kernel. It is a 90-10 solution which suits the majority of application level cases.
  • Deprecated org.ten60.netkernel.xml.xahelper.XAccessor is exported from the ext_xml-core module. This base class provides high-level functionality and is suitable for the development of synchronous active accessors. It's an 80-20 solution which suits the majority of application level cases. Deprecated This API has been deprecated in favour of the NKF accessor. The documentation and API is retained for reference and compatibility purposes only.
It is possible to develop accessors without using these base classes; this is an advanced topic which is not discussed other than to say that analysis of the source code for the existing implementations will provide insight.

Scripting Accessors

Scripting provides a good compromise between flexibility of use and performance. Scripting is very useful as it provides all the raw power of the scripting languages combined with seamless integration as a NetKernel service and the modularity and infrastructure to back you up.

For more information see the Scripting Guide.

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