summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2015-10-06 14:14:47 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2015-10-06 14:40:22 +0100
commit2638c1386552016e1874b097ba8330df9311e3f8 (patch)
treec54ef4b38520494ad04f0ab846319298e9203dc6
parentAdd basic support for reading Project2 options from Ice properties (diff)
downloadproject2-2638c1386552016e1874b097ba8330df9311e3f8.tar.bz2
project2-2638c1386552016e1874b097ba8330df9311e3f8.tar.xz
project2-2638c1386552016e1874b097ba8330df9311e3f8.zip
Compat fixes since adhocutil updates to master
-rw-r--r--project2/ice/iceboxDaemon.cpp11
-rw-r--r--project2/ice/unittests/testIceBoxDaemon.cpp2
2 files changed, 7 insertions, 6 deletions
diff --git a/project2/ice/iceboxDaemon.cpp b/project2/ice/iceboxDaemon.cpp
index fa1afd8..ccc69f7 100644
--- a/project2/ice/iceboxDaemon.cpp
+++ b/project2/ice/iceboxDaemon.cpp
@@ -3,6 +3,7 @@
#include <Ice/Communicator.h>
#include <Ice/Logger.h>
#include <optionsSource.h>
+#include <lifeCycle.h>
#include <daemon.h>
#include <thread>
#include <appInstance.h>
@@ -12,22 +13,22 @@ class IceBoxDaemon : public IceBox::Service, public AppInstance {
public:
IceBoxDaemon()
{
- Plugable::onAllComponents(boost::bind(&ComponentLoader::onBegin, _1));
+ LifeCycle::onAllComponents(boost::bind(&LifeCycle::onBegin, _1));
}
~IceBoxDaemon()
{
- Plugable::onAllComponents(boost::bind(&ComponentLoader::onIdle, _1));
+ LifeCycle::onAllComponents(boost::bind(&LifeCycle::onIdle, _1));
}
void start(const std::string &, const Ice::CommunicatorPtr & ic, const Ice::StringSeq &)
{
- OptionsSources::Add("service", new IceBoxOptionsSource(ic));
+ AdHoc::PluginManager::getDefault()->add<OptionsSource>(new IceBoxOptionsSource(ic), "service", __FILE__, __LINE__);
OptionsSource::loadSources([this] { return reqPlatform;} );
int argc = 0;
char ** argv = nullptr;
ic->getLogger()->print("Creating daemon: " + daemonType);
- daemon = DaemonLoader::createNew(daemonType, argc, argv);
+ daemon = DaemonFactory::createNew(daemonType, argc, argv);
daemon->setup();
daemonThread = new std::thread(&Daemon::run, daemon);
}
@@ -68,7 +69,7 @@ extern "C" {
IceBox::Service *
createProject2Daemon(Ice::CommunicatorPtr ic)
{
- OptionsSources::Add("admin", new IceBoxOptionsSource(ic));
+ AdHoc::PluginManager::getDefault()->add<OptionsSource>(new IceBoxOptionsSource(ic), "admin", __FILE__, __LINE__);
return new IceBoxDaemon();
}
}
diff --git a/project2/ice/unittests/testIceBoxDaemon.cpp b/project2/ice/unittests/testIceBoxDaemon.cpp
index a2ba774..6ee8487 100644
--- a/project2/ice/unittests/testIceBoxDaemon.cpp
+++ b/project2/ice/unittests/testIceBoxDaemon.cpp
@@ -51,5 +51,5 @@ class TestDaemon : public Daemon {
private:
mutable bool stop;
};
-DECLARE_COMPONENT_LOADER("TestDaemon", TestDaemon, DaemonLoader);
+NAMEDFACTORY("TestDaemon", TestDaemon, DaemonFactory);