diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2015-10-01 21:05:13 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2015-10-01 21:05:13 +0100 |
commit | cd467d5978b4e232b66c0fd8041f7c193ead3d5b (patch) | |
tree | 0ef4692257fee9655deaea40bd1f3dbfe115c94d | |
parent | Fix factory type in sqlMerge (diff) | |
download | project2-cd467d5978b4e232b66c0fd8041f7c193ead3d5b.tar.bz2 project2-cd467d5978b4e232b66c0fd8041f7c193ead3d5b.tar.xz project2-cd467d5978b4e232b66c0fd8041f7c193ead3d5b.zip |
Merge Plugable and ComponentLoader into new LifeCycle class
33 files changed, 101 insertions, 128 deletions
diff --git a/project2/basics/caches/memoryCache.cpp b/project2/basics/caches/memoryCache.cpp index 5d58a47..0f3ddf6 100644 --- a/project2/basics/caches/memoryCache.cpp +++ b/project2/basics/caches/memoryCache.cpp @@ -145,7 +145,7 @@ class MemoryCache : public RowSetCache { time_t MemoryCache::CacheLife; MemoryCache::CacheStore MemoryCache::Store; -class CustomMemoryCacheLoader : public RowSetCacheFactory::For<MemoryCache>, public ComponentLoader { +class CustomMemoryCacheLoader : public RowSetCacheFactory::For<MemoryCache>, public LifeCycle { public: void onPeriodic() override { typedef MemoryCache::CacheStore::index<MemoryCache::IndexByTime>::type::iterator iter; diff --git a/project2/basics/options/showHelp.cpp b/project2/basics/options/showHelp.cpp index 81c9150..395baed 100644 --- a/project2/basics/options/showHelp.cpp +++ b/project2/basics/options/showHelp.cpp @@ -29,5 +29,5 @@ ShowHelpComponent::Option() } bool ShowHelpComponent::showHelp; -NAMEDPLUGIN("ShowHelpComponent", ShowHelpComponent, ComponentLoader); +NAMEDPLUGIN("ShowHelpComponent", ShowHelpComponent, LifeCycle); diff --git a/project2/basics/options/showHelp.h b/project2/basics/options/showHelp.h index 75fb4cb..c42a736 100644 --- a/project2/basics/options/showHelp.h +++ b/project2/basics/options/showHelp.h @@ -1,10 +1,10 @@ #ifndef SHOWHELP_H #define SHOWHELP_H -#include <componentLoader.h> #include <options.h> +#include <lifeCycle.h> -class ShowHelpComponent : public ComponentLoader { +class ShowHelpComponent : public LifeCycle { public: void onConfigLoad() override; static Options::TargetPtr Option(); diff --git a/project2/cgi/cgiAppEngine.cpp b/project2/cgi/cgiAppEngine.cpp index a263a38..a69fa9e 100644 --- a/project2/cgi/cgiAppEngine.cpp +++ b/project2/cgi/cgiAppEngine.cpp @@ -15,7 +15,6 @@ #include <boost/lexical_cast.hpp> #include <glibmm/exception.h> #include <cxxabi.h> -#include <plugable.h> #include <glibmm/regex.h> typedef boost::uuids::uuid SIDKey; @@ -319,7 +318,7 @@ CgiApplicationEngine::process(std::ostream & IO, cgicc::CgiInput * cgii, const C boost::function<std::string()> sn = boost::bind(&CgiEnvInput::getenv, &cgienv, "SERVER_NAME"); OptionsSource::loadSources(boost::bind(&CgiApplicationEngine::derivedPlatform, sn)); CgiRequestContext crc(cgii, cgienv); - Plugable::onAllComponents(boost::bind(&ComponentLoader::onBefore, _1)); + LifeCycle::onAllComponents(boost::bind(&LifeCycle::onBefore, _1)); Logger()->messagebf(LOG_DEBUG, "%s: Processing request (%s)", __FUNCTION__, crc.getRedirectURL()); process(IO, &crc); Logger()->messagef(LOG_DEBUG, "%s: Completed request", __FUNCTION__); diff --git a/project2/cgi/cgiProgRouter.cpp b/project2/cgi/cgiProgRouter.cpp index da04be6..2b72652 100644 --- a/project2/cgi/cgiProgRouter.cpp +++ b/project2/cgi/cgiProgRouter.cpp @@ -130,7 +130,7 @@ class RoutingTable { NAMEDFACTORY("route", RoutingTable::Route, RoutingTable::RouteFactory); class ProgRouter; -class ProgRouterFactory : public RouterFactory::For<ProgRouter>, public ComponentLoader { +class ProgRouterFactory : public RouterFactory::For<ProgRouter>, public LifeCycle { public: void onBefore() override { diff --git a/project2/cgi/p2webCgi.cpp b/project2/cgi/p2webCgi.cpp index a59621d..33e1b8b 100644 --- a/project2/cgi/p2webCgi.cpp +++ b/project2/cgi/p2webCgi.cpp @@ -1,6 +1,5 @@ #include "cgiAppEngine.h" #include <boost/bind.hpp> -#include <plugable.h> class GetEnv : public CgiEnvInput { public: @@ -15,12 +14,12 @@ class GetEnv : public CgiEnvInput { int main(void) { - Plugable::onAllComponents(boost::bind(&ComponentLoader::onBegin, _1)); + LifeCycle::onAllComponents(boost::bind(&LifeCycle::onBegin, _1)); CgiApplicationEngine app; GetEnv ge; app.process(std::cout, NULL, ge); - Plugable::onAllComponents(boost::bind(&ComponentLoader::onIteration, _1)); - Plugable::onAllComponents(boost::bind(&ComponentLoader::onPeriodic, _1)); - Plugable::onAllComponents(boost::bind(&ComponentLoader::onIdle, _1)); + LifeCycle::onAllComponents(boost::bind(&LifeCycle::onIteration, _1)); + LifeCycle::onAllComponents(boost::bind(&LifeCycle::onPeriodic, _1)); + LifeCycle::onAllComponents(boost::bind(&LifeCycle::onIdle, _1)); } diff --git a/project2/cgi/p2webFCgi.cpp b/project2/cgi/p2webFCgi.cpp index e31986d..fae6cca 100644 --- a/project2/cgi/p2webFCgi.cpp +++ b/project2/cgi/p2webFCgi.cpp @@ -2,7 +2,6 @@ #include "cgiAppEngine.h" #include <boost/bind.hpp> #include <boost/filesystem/convenience.hpp> -#include <plugable.h> time_t lastPeriodic = 0; time_t periodicDelay = 600; @@ -12,7 +11,7 @@ void p2webPeriodic() { time(&lastPeriodic); - Plugable::onAllComponents(boost::bind(&ComponentLoader::onPeriodic, _1)); + LifeCycle::onAllComponents(boost::bind(&LifeCycle::onPeriodic, _1)); } static @@ -22,7 +21,7 @@ p2webGoingIdle(int) if (time(NULL) > lastPeriodic + periodicDelay) { p2webPeriodic(); } - Plugable::onAllComponents(boost::bind(&ComponentLoader::onIdle, _1)); + LifeCycle::onAllComponents(boost::bind(&LifeCycle::onIdle, _1)); } int @@ -41,7 +40,7 @@ main(void) fprintf(stderr, "Failed to set signal handler\n"); } alarm(60); - Plugable::onAllComponents(boost::bind(&ComponentLoader::onBegin, _1)); + LifeCycle::onAllComponents(boost::bind(&LifeCycle::onBegin, _1)); CgiApplicationEngine app; while (FCGX_Accept_r(&request) == 0) { alarm(0); @@ -49,7 +48,7 @@ main(void) boost::filesystem::current_path(boost::filesystem::initial_path()); app.process(IO, &IO, IO); FCGX_Finish_r(&request); - Plugable::onAllComponents(boost::bind(&ComponentLoader::onIteration, _1)); + LifeCycle::onAllComponents(boost::bind(&LifeCycle::onIteration, _1)); if (time(NULL) > lastPeriodic + periodicDelay) { p2webPeriodic(); } diff --git a/project2/cgi/testCgi.cpp b/project2/cgi/testCgi.cpp index 3c79a77..7f9df28 100644 --- a/project2/cgi/testCgi.cpp +++ b/project2/cgi/testCgi.cpp @@ -8,7 +8,6 @@ #include "cgiRequestContext.h" #include "cgiAppEngine.h" #include <options/showHelp.h> -#include <plugable.h> #define TESTOPT(name, def, desc) \ (name, Options::value(optStore().insert(OptStore::value_type(name, StrPtr(new std::string()))).first->second.get(), def), desc) @@ -52,7 +51,7 @@ class TestInput : public cgicc::CgiInput, public CgiEnvInput { } void run() { - Plugable::onAllComponents(boost::bind(&ComponentLoader::onBegin, _1)); + LifeCycle::onAllComponents(boost::bind(&LifeCycle::onBegin, _1)); CgiApplicationEngine app; boost::function<std::string()> sn = boost::bind(&CgiEnvInput::getenv, this, "SERVER_NAME"); OptionsSource::loadSources(boost::bind(&CgiApplicationEngine::derivedPlatform, sn)); @@ -80,11 +79,11 @@ class TestInput : public cgicc::CgiInput, public CgiEnvInput { optStore()["QUERY_STRING"] = StrPtr(new std::string()); } app.process(std::cout, this, *this); - Plugable::onAllComponents(boost::bind(&ComponentLoader::onIteration, _1)); + LifeCycle::onAllComponents(boost::bind(&LifeCycle::onIteration, _1)); } - Plugable::onAllComponents(boost::bind(&ComponentLoader::onPeriodic, _1)); + LifeCycle::onAllComponents(boost::bind(&LifeCycle::onPeriodic, _1)); } - Plugable::onAllComponents(boost::bind(&ComponentLoader::onIdle, _1)); + LifeCycle::onAllComponents(boost::bind(&LifeCycle::onIdle, _1)); } INITOPTIONS; diff --git a/project2/common/componentLoader.cpp b/project2/common/componentLoader.cpp deleted file mode 100644 index 5506ed2..0000000 --- a/project2/common/componentLoader.cpp +++ /dev/null @@ -1,39 +0,0 @@ -#include "componentLoader.h" -#include <plugins.impl.h> - -ComponentLoader::~ComponentLoader() -{ -} - -void -ComponentLoader::onBegin() -{ -} - -void -ComponentLoader::onBefore() -{ -} - -void -ComponentLoader::onIdle() -{ -} - -void -ComponentLoader::onIteration() -{ -} - -void -ComponentLoader::onPeriodic() -{ -} - -void -ComponentLoader::onConfigLoad() -{ -} - -INSTANTIATEPLUGINOF(ComponentLoader); - diff --git a/project2/common/library.cpp b/project2/common/library.cpp index ce753bd..136e9d4 100644 --- a/project2/common/library.cpp +++ b/project2/common/library.cpp @@ -23,7 +23,7 @@ Library::~Library() } STORAGEOF(Library) libraries; -class LibraryLoader : public ScriptNodeFactory::For<Library>, public ComponentLoader { +class LibraryLoader : public ScriptNodeFactory::For<Library>, public LifeCycle { public: void onIteration() override { diff --git a/project2/common/lifeCycle.cpp b/project2/common/lifeCycle.cpp new file mode 100644 index 0000000..60ed172 --- /dev/null +++ b/project2/common/lifeCycle.cpp @@ -0,0 +1,50 @@ +#include "lifeCycle.h" +#include <boost/function/function_fwd.hpp> +#include <plugins.impl.h> + +LifeCycle::~LifeCycle() +{ +} + +void +LifeCycle::onBegin() +{ +} + +void +LifeCycle::onBefore() +{ +} + +void +LifeCycle::onIdle() +{ +} + +void +LifeCycle::onIteration() +{ +} + +void +LifeCycle::onPeriodic() +{ +} + +void +LifeCycle::onConfigLoad() +{ +} + +void +LifeCycle::onAllComponents(const boost::function<void(LifeCycle *)> & func) +{ + for(auto p : AdHoc::PluginManager::getDefault()->getAll()) { + if (auto c = dynamic_cast<LifeCycle *>(p->implementation())) { + func(c); + } + } +} + +INSTANTIATEPLUGINOF(LifeCycle); + diff --git a/project2/common/componentLoader.h b/project2/common/lifeCycle.h index d3cff99..2a6b5b2 100644 --- a/project2/common/componentLoader.h +++ b/project2/common/lifeCycle.h @@ -1,12 +1,14 @@ -#ifndef COMPONENTLOADER_H -#define COMPONENTLOADER_H +#ifndef LIFECYCLE_H +#define LIFECYCLE_H #include <plugins.h> +#include <boost/function/function_fwd.hpp> /// Helper for loading and maintaining Project2 components -class ComponentLoader : public virtual AdHoc::AbstractPluginImplementation { +class LifeCycle : public virtual AdHoc::AbstractPluginImplementation { public: - virtual ~ComponentLoader() = 0; + virtual ~LifeCycle() = 0; + virtual void onBegin(); // App engine start up (before settings are processed) virtual void onBefore(); // Before the app engine processes a request (after settings are processed) virtual void onIdle(); // When the app engine goes idle @@ -14,8 +16,10 @@ class ComponentLoader : public virtual AdHoc::AbstractPluginImplementation { virtual void onPeriodic(); // When the app engine feels like it virtual void onConfigLoad(); // When the environment reloads the configuration virtual bool cacheable() const { return true; } // The component can be cached for next run + + static void onAllComponents(const boost::function<void(LifeCycle *)> & func); }; -typedef AdHoc::PluginOf<ComponentLoader> LifeCycleComponentPlugin; +typedef AdHoc::PluginOf<LifeCycle> LifeCycleComponentPlugin; #endif diff --git a/project2/common/logger.h b/project2/common/logger.h index cc4409f..9b7d868 100644 --- a/project2/common/logger.h +++ b/project2/common/logger.h @@ -8,9 +8,9 @@ #include <boost/intrusive_ptr.hpp> #include <boost/format.hpp> #include "intrusivePtrBase.h" -#include "componentLoader.h" #include <factory.h> #include <buffer.h> +#include "lifeCycle.h" /// Base class for classes providing a logging facility class LogDriverBase : public virtual IntrusivePtrBase { @@ -69,7 +69,7 @@ class Logger { }; template<typename LoggerType> -class LogDriverFactoryImpl : public LogDriverFactory, public ComponentLoader { +class LogDriverFactoryImpl : public LogDriverFactory, public LifeCycle { public: LogDriverFactoryImpl() : level(LoggerType::level) diff --git a/project2/common/optionsSource.cpp b/project2/common/optionsSource.cpp index f10ff4f..56e983c 100644 --- a/project2/common/optionsSource.cpp +++ b/project2/common/optionsSource.cpp @@ -1,7 +1,6 @@ #include "optionsSource.h" #include "logger.h" #include <plugins.impl.h> -#include <plugable.h> class DefaultConfigConsumer : public ConfigConsumer { public: @@ -43,7 +42,7 @@ OptionsSource::loadSources(const Options::CurrentPlatform & platform) } } } - Plugable::onAllComponents(boost::bind(&ComponentLoader::onConfigLoad, _1)); + LifeCycle::onAllComponents(boost::bind(&LifeCycle::onConfigLoad, _1)); loadedTime = boost::posix_time::microsec_clock::universal_time(); Logger()->messagebf(LOG_DEBUG, "Loaded configuration at %s", loadedTime); @@ -59,7 +58,7 @@ OptionsSource::loadSource(const Options::CurrentPlatform & platform, OptionsSour DefaultConfigConsumer dcc; opts->loadInto(dcc, platform); - Plugable::onAllComponents(boost::bind(&ComponentLoader::onConfigLoad, _1)); + LifeCycle::onAllComponents(boost::bind(&LifeCycle::onConfigLoad, _1)); loadedTime = boost::posix_time::microsec_clock::universal_time(); Logger()->messagebf(LOG_DEBUG, "Loaded configuration at %s", loadedTime); diff --git a/project2/common/plugable.cpp b/project2/common/plugable.cpp deleted file mode 100644 index deb7910..0000000 --- a/project2/common/plugable.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "plugable.h" -#include "componentLoader.h" -#include <plugins.h> - -void -Plugable::onAllComponents(const boost::function<void(ComponentLoader *)> & func) -{ - for(auto p : AdHoc::PluginManager::getDefault()->getAll()) { - if (auto c = dynamic_cast<ComponentLoader *>(p->implementation())) { - func(c); - } - } -} - diff --git a/project2/common/plugable.h b/project2/common/plugable.h deleted file mode 100644 index 8e3889f..0000000 --- a/project2/common/plugable.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef PLUGABLE_H -#define PLUGABLE_H - -#include <boost/function.hpp> - -class ComponentLoader; - -class Plugable { - public: - static void onAllComponents(const boost::function<void(ComponentLoader *)> & func); -}; - -#endif - diff --git a/project2/common/scriptLoader.cpp b/project2/common/scriptLoader.cpp index 17ebd19..e3abd86 100644 --- a/project2/common/scriptLoader.cpp +++ b/project2/common/scriptLoader.cpp @@ -8,9 +8,6 @@ #include "appInstance.h" #include <factory.impl.h> -typedef std::map<std::string, boost::shared_ptr<ScriptNodePtr> > ElementLoaderMap; -typedef std::set<boost::shared_ptr<ComponentLoader> > ComponentLoaderSet; - LoaderBase::LoaderBase() : recursive(true) { diff --git a/project2/common/scriptLoader.h b/project2/common/scriptLoader.h index 032d6c7..fed7cef 100644 --- a/project2/common/scriptLoader.h +++ b/project2/common/scriptLoader.h @@ -12,7 +12,6 @@ #include <map> #include <vector> -class ComponentLoader; class CommonObjects; class Storer; class ScriptReader; diff --git a/project2/common/scriptStorage.h b/project2/common/scriptStorage.h index 9947633..c4155f2 100644 --- a/project2/common/scriptStorage.h +++ b/project2/common/scriptStorage.h @@ -5,6 +5,7 @@ #include "scriptLoader.h" #include "exceptions.h" #include "scripts.h" +#include "lifeCycle.h" #include <set> #include <list> #include <map> @@ -54,7 +55,7 @@ class StorerBase : public Storer { } bool cacheable(ScriptNodePtr p) const { auto f = AdHoc::PluginManager::getDefault()->get<L>(p->get_name()); - if (auto c = dynamic_cast<const ComponentLoader *>(f->implementation())) { + if (auto c = dynamic_cast<const LifeCycle *>(f->implementation())) { return c->cacheable(); } return true; diff --git a/project2/common/scripts.h b/project2/common/scripts.h index e3fab9c..2442558 100644 --- a/project2/common/scripts.h +++ b/project2/common/scripts.h @@ -11,7 +11,6 @@ #include "exceptions.h" #include "variableType.h" #include "options.h" -#include "componentLoader.h" #include <vector> SimpleMessageException(ValueNotFound); diff --git a/project2/compression/decompressStream.cpp b/project2/compression/decompressStream.cpp index 68f8869..7d4023b 100644 --- a/project2/compression/decompressStream.cpp +++ b/project2/compression/decompressStream.cpp @@ -1,5 +1,4 @@ #include "stream.h" -#include "componentLoader.h" #include "decompressor.h" #include "scripts.h" #include "variables.h" diff --git a/project2/console/consoleAppEngine.cpp b/project2/console/consoleAppEngine.cpp index 41bf14c..df7010f 100644 --- a/project2/console/consoleAppEngine.cpp +++ b/project2/console/consoleAppEngine.cpp @@ -12,7 +12,6 @@ #include <boost/bind.hpp> #include <boost/uuid/uuid_generators.hpp> #include <iostream> -#include <plugable.h> StaticMessageException(InvalidScriptName, "Script name should be group/name"); SimpleMessageException(UnknownPlatformAlias); @@ -107,14 +106,14 @@ void ConsoleApplicationEngine::process() { for (const auto & todo : todolist) { - Plugable::onAllComponents(boost::bind(&ComponentLoader::onBefore, _1)); + LifeCycle::onAllComponents(boost::bind(&LifeCycle::onBefore, _1)); Logger()->messagebf(LOG_DEBUG, "%s: Beginning script '%s/%s'", __FUNCTION__, todo.get<0>(), todo.get<1>()); Logger()->messagef(LOG_DEBUG, "%s: Processing file", __FUNCTION__); process(ScriptReader::resolveScript(todo.get<0>(), todo.get<1>(), false)); Logger()->messagef(LOG_DEBUG, "%s: Complete", __FUNCTION__); - Plugable::onAllComponents(boost::bind(&ComponentLoader::onIteration, _1)); + LifeCycle::onAllComponents(boost::bind(&LifeCycle::onIteration, _1)); } } diff --git a/project2/console/p2consoleMain.cpp b/project2/console/p2consoleMain.cpp index 03771f0..3c86600 100644 --- a/project2/console/p2consoleMain.cpp +++ b/project2/console/p2consoleMain.cpp @@ -2,21 +2,20 @@ #include <boost/bind.hpp> #include "claOptions.h" #include "consoleAppEngine.h" -#include <plugable.h> int main(int argc, char ** argv) { AdHoc::PluginManager::getDefault()->add<OptionsSource>( new CommandLineArguments(argc, argv, &ConsoleApplicationEngine::appendScript), "", __FILE__, __LINE__); - Plugable::onAllComponents(boost::bind(&ComponentLoader::onBegin, _1)); + LifeCycle::onAllComponents(boost::bind(&LifeCycle::onBegin, _1)); ConsoleApplicationEngine app; OptionsSource::loadSources([] { return ConsoleApplicationEngine::reqPlatform;} ); app.process(); - Plugable::onAllComponents(boost::bind(&ComponentLoader::onPeriodic, _1)); - Plugable::onAllComponents(boost::bind(&ComponentLoader::onIdle, _1)); + LifeCycle::onAllComponents(boost::bind(&LifeCycle::onPeriodic, _1)); + LifeCycle::onAllComponents(boost::bind(&LifeCycle::onIdle, _1)); } diff --git a/project2/daemon/p2daemonAppEngine.cpp b/project2/daemon/p2daemonAppEngine.cpp index 6d07201..27dff10 100644 --- a/project2/daemon/p2daemonAppEngine.cpp +++ b/project2/daemon/p2daemonAppEngine.cpp @@ -7,7 +7,6 @@ #include <grp.h> #include <options/flagSet.h> #include <options/showHelp.h> -#include <plugable.h> #include "pidfile.h" #include "tempPrivs.h" @@ -124,7 +123,7 @@ bool DaemonAppEngine::periodicCallback() { Logger()->messagebf(LOG_DEBUG, "%s: firing component periodics.", __PRETTY_FUNCTION__); - Plugable::onAllComponents(boost::bind(&ComponentLoader::onPeriodic, _1)); + LifeCycle::onAllComponents(boost::bind(&LifeCycle::onPeriodic, _1)); return true; } diff --git a/project2/daemon/p2daemonMain.cpp b/project2/daemon/p2daemonMain.cpp index e65f941..21eb748 100644 --- a/project2/daemon/p2daemonMain.cpp +++ b/project2/daemon/p2daemonMain.cpp @@ -5,7 +5,6 @@ #include <boost/bind.hpp> #include <options.h> #include <logger.h> -#include <plugable.h> SimpleMessageException(UnsupportedArguments); @@ -45,7 +44,7 @@ daemonize() int main(int argc, char ** argv) { - Plugable::onAllComponents(boost::bind(&ComponentLoader::onBegin, _1)); + LifeCycle::onAllComponents(boost::bind(&LifeCycle::onBegin, _1)); AdHoc::PluginManager::getDefault()->add<OptionsSource>( new CommandLineArguments(argc, argv, [](const char * a) { throw UnsupportedArguments(a); }), "_2", __FILE__, __LINE__); @@ -57,6 +56,6 @@ main(int argc, char ** argv) } dae.process(); - Plugable::onAllComponents(boost::bind(&ComponentLoader::onIdle, _1)); + LifeCycle::onAllComponents(boost::bind(&LifeCycle::onIdle, _1)); } diff --git a/project2/files/presenterCache.cpp b/project2/files/presenterCache.cpp index 87d1223..4066058 100644 --- a/project2/files/presenterCache.cpp +++ b/project2/files/presenterCache.cpp @@ -247,7 +247,7 @@ DECLARE_OPTIONS(FilePresenterCache, "File Presenter Cache options") "The name of the component used to provide a unique request ID") END_OPTIONS(FilePresenterCache) -class FilePresenterCacheLoader : public ComponentLoader { +class FilePresenterCacheLoader : public LifeCycle { public: FilePresenterCacheLoader() { diff --git a/project2/ice/iceDaemon.cpp b/project2/ice/iceDaemon.cpp index cf1c446..e6769b5 100644 --- a/project2/ice/iceDaemon.cpp +++ b/project2/ice/iceDaemon.cpp @@ -24,7 +24,7 @@ std::string IceDaemon::viewRoot; std::string IceDaemon::taskRoot; IceBase::Libs IceDaemon::libs; -class IceDaemonFactory : public DaemonFactory::For<IceDaemon>, public ComponentLoader { +class IceDaemonFactory : public DaemonFactory::For<IceDaemon>, public LifeCycle { public: void onConfigLoad() override { IceBase::FinaliseLoad(IceDaemon::libs); diff --git a/project2/ice/iceDataSource.cpp b/project2/ice/iceDataSource.cpp index 734eedc..8c15173 100644 --- a/project2/ice/iceDataSource.cpp +++ b/project2/ice/iceDataSource.cpp @@ -44,7 +44,7 @@ IceDataSource::ClearSlice() libs.clear(); } -class IceDataSourceLoader : public DataSourceFactory::For<IceDataSource>, public ComponentLoader { +class IceDataSourceLoader : public DataSourceFactory::For<IceDataSource>, public LifeCycle { public: void onConfigLoad() override { IceBase::FinaliseLoad(IceDataSource::libs); diff --git a/project2/sql/rdbmsDataSource.cpp b/project2/sql/rdbmsDataSource.cpp index 9b295d3..aa5bee4 100644 --- a/project2/sql/rdbmsDataSource.cpp +++ b/project2/sql/rdbmsDataSource.cpp @@ -8,7 +8,7 @@ #define LOCK(l) std::lock_guard<std::mutex> _lock##l(l) /// Specialized ElementLoader for instances of RdbmsDataSource; handles persistent DB connections -class RdbmsDataSourceLoader : public ComponentLoader { +class RdbmsDataSourceLoader : public LifeCycle { public: void onIdle() override { diff --git a/project2/sql/sqlCache.cpp b/project2/sql/sqlCache.cpp index 6e5bd20..24a6b80 100644 --- a/project2/sql/sqlCache.cpp +++ b/project2/sql/sqlCache.cpp @@ -264,7 +264,7 @@ std::string SqlCache::DataSource; std::string SqlCache::HeaderTable; time_t SqlCache::CacheLife; -class CustomSqlCacheLoader : public RowSetCacheFactory::For<SqlCache>, public ComponentLoader { +class CustomSqlCacheLoader : public RowSetCacheFactory::For<SqlCache>, public LifeCycle { public: void onIdle() override { diff --git a/project2/xml/sessionXml.cpp b/project2/xml/sessionXml.cpp index c92fe85..403e91a 100644 --- a/project2/xml/sessionXml.cpp +++ b/project2/xml/sessionXml.cpp @@ -10,7 +10,7 @@ #include "options.h" #include "logger.h" -class CustomSessionContainerFactoryXml : public SessionContainerFactory::For<SessionContainerXml>, public ComponentLoader { +class CustomSessionContainerFactoryXml : public SessionContainerFactory::For<SessionContainerXml>, public LifeCycle { public: void onPeriodic() override { diff --git a/project2/xml/xmlCache.cpp b/project2/xml/xmlCache.cpp index 6104730..40adec9 100644 --- a/project2/xml/xmlCache.cpp +++ b/project2/xml/xmlCache.cpp @@ -84,7 +84,7 @@ boost::filesystem::path XmlCache::Store; std::string XmlCache::FileName; time_t XmlCache::CacheLife; -class CustomXmlCacheFactory : public AdHoc::Factory<RowSetCache, ScriptNodePtr>::For<XmlCache>, public ComponentLoader { +class CustomXmlCacheFactory : public AdHoc::Factory<RowSetCache, ScriptNodePtr>::For<XmlCache>, public LifeCycle { public: void onIdle() override { diff --git a/project2/xml/xmlDocumentCache.cpp b/project2/xml/xmlDocumentCache.cpp index f37924d..98e4993 100644 --- a/project2/xml/xmlDocumentCache.cpp +++ b/project2/xml/xmlDocumentCache.cpp @@ -58,7 +58,7 @@ XmlDocumentCache::queue(const Glib::ustring & url, const char *, ExecContext *) } } -class XmlDocumentCacheClearer : public ComponentLoader { +class XmlDocumentCacheClearer : public LifeCycle { public: typedef bool KeyType; @@ -69,5 +69,5 @@ class XmlDocumentCacheClearer : public ComponentLoader { Logger()->messagef(LOG_DEBUG, "%s: Cleared XML document cache", __PRETTY_FUNCTION__); } }; -NAMEDPLUGIN("XmlDocumentCacheClearer", XmlDocumentCacheClearer, ComponentLoader); +NAMEDPLUGIN("XmlDocumentCacheClearer", XmlDocumentCacheClearer, LifeCycle); |