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:Golden Thread Accessor
Description:Attach and cut golden threads
Id:layer1.GoldenThread
Category:accessor
Identifier Syntax

Golden Thread Accessor is an accessor using Active URI syntax with the following base identifiers:

Base
active:attachGoldenThread
active:cutGoldenThread

and the following arguments: (for more details on argument passing details see here)

ArgumentRulesTypingDescription
id
0 ... infinity
Identifieridentifier(s) for virtual resource
Request Verbs

The following verbs are supported:

Verbs
SOURCEEXISTS
Response

The response representation of this accessor for SOURCE requests is unknown.

This accessor throws no documented exceptions.

Import Requirements

To use Golden Thread Accessor accessor you must import the module urn:com:1060research:www3:

<import>
  <uri>urn:com:1060research:www3uri>
import>

The Golden Thread accessor supports the creation of virtual resources which can be made a dependency of other resources. When a virtual resource is made invalid then all resources that had been made dependent become invalid and are removed from the cache.

SOURCE

active:attachGoldenThread

When a request with the SOURCE verb is issued to active:attachGoldenThread the specified virtual resource is located, or created if it does not exist, and the response of the calling endpoint becomes dependent upon the virtual resource.

In the following example a query result from a database is associated with the virtual resource customer

request = context.createRequest("active:sqlQuery");
request.addArgument("operand", "res:/resources/sql/customerlist.sql");
queryResult = context.issueRequest(request);

request = context.createRequest("active:attachGoldenThread");
request.addAgument("id", "customer");
context.issueRequest(request);

response = context.createResponseFrom(queryResult);

active:cutGoldenThread

When a request with the SOURCE verb is issued to active:cutGoldenThread the specified virtual resource is located if it exists and then it is set to be expired. All depdendent resources will immediately become expired also. If subsequent calls to active:attachGoldenThread are made, a new un-expired virtual resource will be created.

In the following example a database request updates the customer table; it must also invalidate the virtual resource customer in order to invalidate all cached query results from the customer table.

request = context.createRequest("active:sqlUpdate");
request.addArgument("operand", "res:/resources/sql/customerupdate.sql");
context.issueRequest(request);

request = context.createRequest("active:cutGoldenThread");
request.addAgument("id", "customer");
context.issueRequest(request);