Class ServiceRegistry

The ServiceRegistry is responsible for managing Service definitions and their instances.

Typical usage involves several steps:

  1. The service is defined in the Business Manager and configured with necessary credentials.

  2. The service callback is configured once during cartridge initialization:

  3. A new service instance is created and called in order to perform the operation:

See ServiceCallback for all the callback options, and individual ServiceDefinition classes for customization specific to a service type.

Deprecated:

It is recommended to use the LocalServiceRegistry instead of this class.

API Version:

No longer available as of version 19.10.

This class does not have a constructor, so you cannot create it directly.

MethodDescription
static configure(String, Object)Configure the given serviceId with a callback.
static get(String)Constructs a new instance of the given service.
static getDefinition(String)Gets a Service Definition.
static isConfigured(String)Returns the status of whether the given service has been configured 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 configure(serviceID: String, configObj: Object): ServiceDefinition

Configure the given serviceId with a callback.

If the service is already configured, the given callback will replace any existing one.

Parameters:

  • serviceID - Unique Service ID.
  • configObj - Configuration callback. See ServiceCallback for a description of available callback methods.

Returns:

  • Associated ServiceDefinition, which can be used for further protocol-specific configuration.

static get(serviceID: String): Service

Constructs a new instance of the given service.

Parameters:

  • serviceID - Unique Service ID.

Returns:

  • Service instance.

static getDefinition(serviceID: String): ServiceDefinition

Gets a Service Definition.

This Service Definition is shared across all Service instances returned by get(String).

Parameters:

  • serviceID - Unique Service ID.

Returns:

  • ServiceDefinition

static isConfigured(serviceID: String): Boolean

Returns the status of whether the given service has been configured with a callback.

Parameters:

  • serviceID - Unique Service ID.

Returns:

  • true if configure has already been called, false otherwise.