public IPlugin Install(Config c) { this.c = c; mgr.MonitorLicenses(c); mgr.MonitorHeartbeat(c); // Ensure our cache is appropriately invalidated cache = null; mgr.AddLicenseChangeHandler(this, (me, manager) => me.cache = null); // And repopulated, so that errors show up. if (Result == null) { throw new ApplicationException("Failed to populate license result"); } c.Plugins.add_plugin(this); return(this); }
public IPlugin Install(Config config) { c = config; // Ensure the LicenseManager can respond to heartbeats and license/licensee plugin additions for the config mgr.MonitorLicenses(c); mgr.MonitorHeartbeat(c); // Ensure our cache is appropriately invalidated when new licenses arrive, or when new licensed plugins are installed cachedResult = null; mgr.AddLicenseChangeHandler(this, (me, manager) => me.cachedResult = null); // And repopulated, so that errors show up. if (Result == null) { throw new ApplicationException("Failed to populate license result"); } c.Plugins.add_plugin(this); // And don't forget a cache-breaker c.Pipeline.PostRewrite += Pipeline_PostRewrite; return(this); }