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:Virtual Host
Description:Delegate requests into distinct spaces based on identifier
Id:mod.architecture.VirtualHost
Category:accessor prototype

Virtual Host 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 mod.architecture.VirtualHost prototype has the following initialisation parameters:

NameRulesTypingDefaultDescription
configMandatoryIdentifier or XML(none)
specifies virtual hosts and the imports they map to

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

<accessor>
  <prototype>mod.architecture.VirtualHost</prototype>
  <config>specifies virtual hosts and the imports they map to</config>
</accessor>
Import Requirements

To use Virtual Host accessor prototype you must import the module urn:com:ten60:netkernel:mod:architecture:

<import>
  <uri>urn:com:ten60:netkernel:mod:architecture</uri>
</import>

Operation

When a virtual host endpoint is instantiated from the prototype in your application space it creates a set of logical endpoints, one for each host you have defined in the configuration. Each logical endpoint is backed by a space which dynamically imports all the spaces which match the import-type using SimpleImportDiscovery. When a request is matched by the logical endpoint a new request is constructed and delegated into the backing space. This new request is constructed according the a declarative request definition and should contain captured arguments from virtual hosts grammar definition.

Configuration

The virtual host endpoint requires a mandatory config parameter which defines a set of one or more virtual hosts. This configuration document specifies an XML resource which may be specified as a literal within the module definition or referenced as an identifier. The config document must have the following structure:

<config>
  <host>
    <grammar> [grammar definition] </grammar>
    <request> [declarative requests definition] </request>
    <import-type> [type of spaces import] </import-type>
  </host> ...more host definitions...
</config>

Each host definition must contain a: