Skip to main content
Hitachi Vantara Lumada and Pentaho Documentation

ILocator

pentaho.service. ILocator

The interface of service locator AMD/RequireJS loader plugins.

The service locator allows JavaScript components to declare dependency on other components in terms of the name of a logical service. Other modules that provide such logical service should register as such. See pentaho.service.locator.

AMD Plugin Usage: "pentaho/service!{logical-module-name}?meta&single&ids"

  1. {logical-module-name} — the name of a required logical module.
  2. single — if present, the module resolves as a single value, the first declared dependency.
  3. meta — if present, the module resolves as an array where each member is an object with two properties, moduleId and value.
  4. ids - if present, the module resolves as an array of the identifiers of the registered modules and does not load them; you can also use this module's pentaho.service.ILocator#getRegisteredIds method, to be able to know the registered module ids synchronously.

Logical service type

There are no a priori constraints on the type of value of a logical service. When a logical service has a certain value type, that should be described in its documentation. More often than not, the value type can be precisely defined as an interface or class.

Currently, the plugin mechanism provides no assurances on the type of value of registered service provider modules. However, components requesting a logical module should trust that the provided dependencies respect any documented contract.

Source: doc-js/pentaho/service/ILocator.jsdoc, line 17

See also: pentaho.service.locator

Extends

Methods

Name Description
getRegisteredIds(name) : Array.<<code>string>

Gets the identifiers of modules registered as dependencies of a given logical module.

load(name, require, onLoad, config)

Loads a logical module given its name.

normalize(name, normalize) : string

Normalizes the name of a logical module.

Methods Details

getRegisteredIds(name) : Array.<<code>string>

Gets the identifiers of modules registered as dependencies of a given logical module.

Source: doc-js/pentaho/service/ILocator.jsdoc, line 54

Parameters:
Name Default Value Summary
name : string

The name of the logical module.

Returns:
Name Description
Array.<<code>string>

An array of identifiers, possibly empty.

load(name, require, onLoad, config)

Loads a logical module given its name.

Source: doc-js/pentaho/IAmdLoaderPlugin.jsdoc, line 45

Inherited From: IAmdLoaderPlugin#load

Parameters:
Name Default Value Summary
name : string

The name of the logical module to load.

require : function

The contextual require function of the dependent module, if any, or the global require function, if requested using it.

onLoad : function

Callback function to call with the resolved module, once it is resolved.

config : object

The full AMD/RequireJS config object.

normalize(name, normalize) : string

Normalizes the name of a logical module.

Converts several names that refer to the same logical module to its canonical name, to ensure that the modules are recognized as being the same and are correctly cached.

This is an optional method.

Source: doc-js/pentaho/IAmdLoaderPlugin.jsdoc, line 59

Inherited From: IAmdLoaderPlugin#normalize

Parameters:
Name Default Value Summary
name : string

The name of the logical module to load.

normalize : function

The default normalize function.

Returns:
Name Description
string

The normalized logical module