Caplin Trader 5.1.0

Class: module:ct-services/ServiceRegistryLoader


new module:ct-services/ServiceRegistryLoader()

Constructs a ServiceRegistryLoader.

The ServiceRegistryLoader class loads the core set of Services required by an Application. It also provides a mechanism for replacing any implementation of a core service by invoking module:ct-services/ServiceRegistryLoader#setService before module:ct-services/ServiceRegistryLoader#loadServices is called. Note that no services are constructed until loadServices() is invoked.

The core services include:

  • XmlResourceService
  • HtmlResourceService
  • AppService
  • PermissionService
  • Aliases remove the need to use service registry loaders.



Adds a callback that will be called after this ServiceRegistryLoader is ready. If this ServiceRegistryLoader is already ready, the callback will be called immediately.

Name Type Description

the function that should be called when this ServiceRegistryLoader is ready.


Loads the services and registers them with the ServiceRegistry



Sets a set of application properties to be used for the AppService. If there are any existing properties that have been set, they will be merged with the specified set, with any duplicated being overridden by those in the specified set.

Name Type Description
mProperties Map

The properties to set.

setService(sInterface, oImplementation)

Sets the specified service interface to use the specified implementation. If there is already a service due to be registered with this interface name, it will be overridden, and only the service within this invocation will be constructed.

Name Type Description
sInterface String

The service interface to set.

oImplementation Object

The implementation to set.