Interface that must be implemented by a service that is not immediately ready for use.
This represents an interface, and should not normally be constructed.
This is an example of a service that requires an asynchronous network request before construction to obtain service data, e.g. permission data or HTML/JSON data from the server.
Upon construction the service can trigger an asynchronous request.
When it has received the data it requires and is ready to use then the service must
call serviceIsReady
on the module:ct-core/DelayedReadinessServiceListener
s
that have been added as listeners to the Service via the addDelayedReadinessServiceListener
method.
If the service depends on other DelayedReadinessService
s then it should specify
that by returning them as an array in the
getServiceDependencies
method.
Methods
(static) get Service Dependencies() → {Array}
Returns the list of services that this service requires to be in a ready state before it can be constructed.
Return an empty array otherwise. This method should not be on the prototype but should be a static
method on the service class. Only other DelayedReadinessService
s should
be specified.
Returns:
an array of {String}s listing the services that this service depends on.
- Type
- Array
add Delayed Readiness Service Listener(oDelayed Readiness Service Listener)
Registers a DelayedReadinessServiceListener
object,
which is used to notify when the service is ready to use.
Parameters:
Name | Type | Description |
---|---|---|
oDelayedReadinessServiceListener |
module:ct-core |
The service readiness listener. |