Class LocalServiceRegistry
The LocalServiceRegistry is responsible for managing Service instances.
Typical usage involves several steps:
-
The service is defined in the Business Manager and configured with necessary credentials.
-
An instance of the service is created and configured in a script:
-
The service is called in order to perform the operation:
Unlike ServiceRegistry, the configured service is local to the current script call, so this deals directly with Service instances rather than the intermediate ServiceDefinition. This means that a cartridge-level initialization script (and the package.json) is no longer needed.
See ServiceCallback for all the callback options, and individual Service classes for customization specific to a service type.
This class does not have a constructor, so you cannot create it directly.
| Method | Description |
|---|---|
| static createService(String, Object) | Constructs and configures a service with a callback. |
assign, create, create, defineProperties, defineProperty, entries, freeze, fromEntries, getOwnPropertyDescriptor, getOwnPropertyNames, getOwnPropertySymbols, getPrototypeOf, hasOwnProperty, is, isExtensible, isFrozen, isPrototypeOf, isSealed, keys, preventExtensions, propertyIsEnumerable, seal, setPrototypeOf, toLocaleString, toString, valueOf, values
- static createService(serviceID: String, configObj: Object): Service
Constructs and configures a service with a callback.
Parameters:
- serviceID - Unique Service ID.
- configObj - Configuration callback. See ServiceCallback for a description of available callback methods.
Returns:
- Associated Service, which can be used for further protocol-specific configuration.