Defines a dependency between a dependent and an extension object.
An array of objects of this type is passed to the ExtensionManager's methods by the infrastructure during the extension lifecycle.
The basic format of the dependency is defined by the ExtensionDependencyFormat module.
However the keys defined and described there are only the mandatory keys which every dependency to an extension must possess. Each individual extension can define its own "API" -- e.g. set of keys in the dependency definition it understands. The implementation of the corresponding ExtensionManager is then responsible for reading those keys from the passed dependency object and adapt its behaviour accordingly.
- Version:
- 16.3.1
- Source:
Example
CurrentTimeExtensionManager.prototype.initialise = function (dependencies) {
var timeZones = ['utc']; //default timezone (if noone specifies time zone explicitly in the dependency).
(dependencies || []).forEach(function(dependency) {
var timeZone = dependency.getDefinition().timeZone;
if(timeZone) {
timeZones.push(timeZone);
}
});
timeZones.forEach(function(timeZone) {
sharedObjectRegistry.unregister('com.company.abcs.extensions.currentTime.' + timeZone, new CurrentTime(timeZone));
});
return Promise.resolve();
};
Methods
getDefinition() → {Object}
stable API
Gets definition of a dependency to an extension.
The keys of the dependency description are defined in ExtensionDependencyFormat
- Version:
- 16.3.1
- Source:
- See:
Returns:
- Type
- Object
Example
{
sourceType: 'application',
sourceId: 'myApplication-1.0',
extensionId: 'com.mycompany.abcs.extensions.myTwitterBOP'
}