"use strict";
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var pluginRegistry_1 = require("../pluginApi/pluginRegistry");
var datasourcePluginFactory_1 = require("./datasourcePluginFactory");
var DatasourcePluginRegistry = (function (_super) {
__extends(DatasourcePluginRegistry, _super);
function DatasourcePluginRegistry(_store) {
_super.call(this, _store);
this._disposed = false;
}
Object.defineProperty(DatasourcePluginRegistry.prototype, "disposed", {
get: function () {
return this._disposed;
},
enumerable: true,
configurable: true
});
DatasourcePluginRegistry.prototype.createPluginFromModule = function (module) {
console.assert(_.isObject(module.TYPE_INFO), "Missing TYPE_INFO on datasource module. Every module must export TYPE_INFO");
return new datasourcePluginFactory_1.default(module.TYPE_INFO.type, module.Datasource, this.store);
};
DatasourcePluginRegistry.prototype.dispose = function () {
if (!this._disposed) {
this._disposed = true;
clearInterval(this._fetchIntervalRef);
this._fetchIntervalRef = null;
_super.prototype.dispose.call(this);
}
};
return DatasourcePluginRegistry;
}(pluginRegistry_1.default));
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = DatasourcePluginRegistry;
|