Module: caf_core/main

Main package module.

Source:

Methods

init(modulesopt, specopt, frameworkFileNameopt, cbopt)

Main initialization function for the framework.

This is typically the last call in your ca_methods.js file.

It recursively loads and instantiates all the components described in framework.json. When all of them are active, it starts listening for requests at an specified port.

Parameters:
Name Type Attributes Description
modules NodeJS.Module | Array.<NodeJS.Module> <optional>

An optional sequence of modules (or just one) to load descriptions and implementations.

spec specDeltaType <optional>

Extra configuration data that will be merged with the framework components description. For example, to override the default name of the top component using spec.name.

frameworkFileName string <optional>

An optional file name containing a description of the framework components. It defaults to framework.json.

cb cbType <optional>

An optional callback that will return an error or the context $ with the created top level component bound by its name.

Source:

joinName(…strings) → {string}

Joins partial names using the standard separator.

Parameters:
Name Type Attributes Description
strings string <repeatable>

A var number of strings.

Source:
Returns:

A joined name with the standard separator.

Type
string

splitName(name, separatoropt) → {Array.<string>}

Splits a compound name into namespace root and local name. The convention is to use the character '-' to separate them.

Parameters:
Name Type Attributes Description
name string

A name to split.

separator string <optional>

Optional separator to override '-'.

Source:
Throws:

Invalid compound name.

Type
Error
Returns:

An array with two elements: namespace root and local name, or three if it also has a map name, or four if fully qualified CA name ,i.e., appPublisher-appLocalName-caOwner-caLocalName.

Type
Array.<string>