Provides most of configuration services for plugins, except per-database configuration in databases.conf
| 446 | // Provides most of configuration services for plugins, |
| 447 | // except per-database configuration in databases.conf |
| 448 | class ConfiguredPlugin final : |
| 449 | public RefCntIface<ITimerImpl<ConfiguredPlugin, CheckStatusWrapper> > |
| 450 | { |
| 451 | public: |
| 452 | ConfiguredPlugin(RefPtr<PluginModule> pmodule, unsigned int preg, |
| 453 | RefPtr<ConfigFile> pconfig, const PathName& pconfName, |
| 454 | const PathName& pplugName) |
| 455 | : module(pmodule), regPlugin(preg), pluginLoaderConfig(pconfig), |
| 456 | confName(getPool(), pconfName), plugName(getPool(), pplugName), |
| 457 | processingDelayedDelete(false), delay(DEFAULT_DELAY) |
| 458 | { |
| 459 | if (pluginLoaderConfig.hasData()) |
| 460 | { |
| 461 | const ConfigFile::Parameter* p = pluginLoaderConfig->findParameter("ConfigFile"); |
| 462 | if (p && p->value.hasData()) |
| 463 | { |
| 464 | confName = p->value.ToPathName(); |
| 465 | } |
| 466 | } |
| 467 | if (module != builtin) |
| 468 | { |
| 469 | byTypeCounters->get(module->getPlugin(regPlugin).type).counter++; |
| 470 | } |
| 471 | #ifdef DEBUG_PLUGINS |
| 472 | RegisteredPlugin& r(module->getPlugin(regPlugin)); |
| 473 | fprintf(stderr, " ConfiguredPlugin %s module %s registered as %s type %d order %d\n", |
| 474 | plugName.c_str(), module->getName(), r.name.c_str(), r.type, regPlugin); |
| 475 | #endif |
| 476 | } |
| 477 | |
| 478 | const char* getConfigFileName() |
| 479 | { |
| 480 | return confName.c_str(); |
| 481 | } |
| 482 | |
| 483 | IConfig* getDefaultConfig() |
| 484 | { |
| 485 | return findPluginConfig(pluginLoaderConfig, confName); |
| 486 | } |
| 487 | |
| 488 | const PluginModule* getPluggedModule() const throw() |
| 489 | { |
| 490 | return module; |
| 491 | } |
| 492 | |
| 493 | IPluginBase* factory(IFirebirdConf *iFirebirdConf); |
| 494 | |
| 495 | const char* getPlugName() |
| 496 | { |
| 497 | return plugName.c_str(); |
| 498 | } |
| 499 | |
| 500 | void setReleaseDelay(ISC_UINT64 microSeconds) throw() |
| 501 | { |
| 502 | #ifdef DEBUG_PLUGINS |
| 503 | fprintf(stderr, "Set delay for ConfiguredPlugin %s:%p\n", plugName.c_str(), this); |
| 504 | #endif |
| 505 | delay = microSeconds > DEFAULT_DELAY ? microSeconds : DEFAULT_DELAY; |
no outgoing calls
no test coverage detected