WARNING: This server provides a static reference view of the NetKernel documentation. Links to dynamic content do not work. For the best experience we recommend you install NetKernel and view the documentation in the live system .

Endpoint
Name:SimpleImportDiscovery
Description:build a DynamicImport configuration which locates spaces which push exports
Id:layer1.Endpoint.SimpleImportDiscovery
Category:accessor prototype

SimpleImportDiscovery is an accessor that must be instantiated from a prototype. You must instantiate the prototype in your module to create an accessor that can receive requests.

Parameters

The layer1.Endpoint.SimpleImportDiscovery prototype has the following initialisation parameters:

NameRulesTypingDefaultDescription
grammarMandatoryXML(none)
An identifier grammar definition.
idOptionalStringnull
An identifier for created logical endpoint, if omitted a unique auto-generated value it will be used.
privateOptionalBooleanfalse
If included this parameter will mark the endpoint as private and it will not be exposed outside module.
typeMandatoryString(none)
the type of the import
uriOptionalStringres:/etc/system/SimpleDynamicImportHook.xml
identifier of export definition resource
metaOptionalXMLnull(no description available)

Here is an auto-generated example of how to instantiate an instance of SimpleImportDiscovery:

<accessor>
  <prototype>layer1.Endpoint.SimpleImportDiscovery</prototype>
  <grammar>an identifier grammar definition</grammar>
  <type>the type of the import</type>
</accessor>
Import Requirements

To use SimpleImportDiscovery accessor prototype you must import the module urn:org:netkernel:ext:layer1:

<import>
  <uri>urn:org:netkernel:ext:layer1</uri>
</import>

The SimpleImportDiscovery accessor implements a pattern of import discovery is used to find all modules which wish to expose functionality. It generates a DynamicImport configuration. This inverts the usual space import relationship. In this situation, modules may be added to a NetKernel system that push themselves into an importing space without requiring the spaces module.xml file to be edited for each addition or removal.

For example, the Frontend Fulcrum uses the dynamic import endpoint to define the dynamic import type HTTPFulcrum:

<space>
  < !-- instantiate the an import discovery endpoint to look for spaces of type "HTTPFulcrum" -->
  <endpoint>
    <prototype>SimpleImportDiscovery</prototype>
    <grammar>active:SimpleImportDiscovery</grammar>
    <type>HTTPFulcrum</type>
  </endpoint>
  < !-- instantiate the dynamic import referencing the import discovery service -->
  <endpoint>
    <prototype>DynamicImport</prototype>
    <config>active:SimpleImportDiscovery</config>
  </endpoint>
</space>

Spaces that then wish to be imported into the Frontend Fulcrum must expose the resource res:/etc/system/SimpleDynamicImportHook.xml which contains a connection specification:

<connection>
  <type>HTTPFulcrum</type>
</connection>

Dynamic importation of spaces occurs when NetKernel initializes or when a module and its spaces are commissioned. This accessor uses the spaceAggregateHDS accessor to locate the SimpleDynamicImportHook.xml.

Priority

By default all discovered imports are imported in an undefined order. However it is possible to specify an import priority. This is useful and possibility necessary if some of the imports mask or override resources in other imports. To specify an import priority using the priority tag containing a float. The default priority is 1.0, specifying a higher priority will force the import to occur earlier. A lower value will force the import to appear later.

<connection>
  <type>HTTPFulcrum</type>
  <priority>2.0</priority>
</connection>