summaryrefslogtreecommitdiff
path: root/project2/ice/iceDaemon.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'project2/ice/iceDaemon.cpp')
-rw-r--r--project2/ice/iceDaemon.cpp26
1 files changed, 16 insertions, 10 deletions
diff --git a/project2/ice/iceDaemon.cpp b/project2/ice/iceDaemon.cpp
index a8fb8c2..7f506d4 100644
--- a/project2/ice/iceDaemon.cpp
+++ b/project2/ice/iceDaemon.cpp
@@ -68,23 +68,24 @@ IceDaemon::shutdown() const
void
IceDaemon::run() const
{
- Logger()->messagebf(LOG_INFO, " %s starting...", __PRETTY_FUNCTION__);
+ Logger()->messagebf(LOG_DEBUG, " %s creating adapter %s [%s]...", __PRETTY_FUNCTION__, adapterName, adapterEndpoint);
Ice::ObjectAdapterPtr adapter = ic->createObjectAdapterWithEndpoints(adapterName, adapterEndpoint);
+
+ Logger()->messagebf(LOG_DEBUG, " %s installing servants...", __PRETTY_FUNCTION__);
std::set<IceDaemonAdapterHandlerPtr> interfaces;
InstanceSet<IceDaemonAdapterHandlerLoader>::OnAll([this, adapter, &interfaces](IceDaemonAdapterHandlerLoader * loader) {
IceDaemonAdapterHandlerPtr interfacePtr = loader->create();
interfacePtr->add(adapter, this, ic);
interfaces.insert(interfacePtr);
});
+
+ Logger()->messagebf(LOG_DEBUG, " %s starting...", __PRETTY_FUNCTION__);
adapter->activate();
+
Logger()->messagebf(LOG_INFO, " %s running...", __PRETTY_FUNCTION__);
- BOOST_FOREACH(const auto & interfacePtr, interfaces) {
- interfacePtr->remove(adapter, ic);
- }
ic->waitForShutdown();
- Logger()->messagebf(LOG_INFO, " %s stopped...", __PRETTY_FUNCTION__);
- Logger()->messagebf(LOG_INFO, "<<< %s", __PRETTY_FUNCTION__);
+ Logger()->messagebf(LOG_INFO, " %s stopped", __PRETTY_FUNCTION__);
}
class IceDaemonViewHost : public virtual CommonObjects, public virtual CheckHost {
@@ -98,7 +99,9 @@ class IceDaemonViewHost : public virtual CommonObjects, public virtual CheckHost
void executeView(RowSetPresenterPtr presenter, ExecContext * ec) const
{
loadScriptComponents();
+ Logger()->messagebf(LOG_DEBUG, "%s: run %d checks", __PRETTY_FUNCTION__, CheckHost::checks.size());
runChecks(ec);
+ Logger()->messagebf(LOG_DEBUG, "%s: execute view", __PRETTY_FUNCTION__);
view->execute(presenter.get(), ec);
// Caches might open transactions
BOOST_FOREACH(const CommonObjects::DataSources::value_type & ds, CommonObjects::datasources) {
@@ -136,22 +139,25 @@ void
IceDaemon::executeView(const std::string & name, Slicer::ModelPartPtr p, const ParamMap & pm) const
{
ScriptNodePtr s = ScriptReader::resolveScript(IceDaemon::viewRoot, name, false)->root();
- IceDaemonViewHost f(s);
+ boost::intrusive_ptr<IceDaemonViewHost> v = new IceDaemonViewHost(s);
IceCallContext icc(pm);
- f.executeView(new IceViewSerializer(p), &icc);
+ v->executeView(new IceViewSerializer(p), &icc);
}
class IceDaemonTaskHost : public TaskHost {
public:
IceDaemonTaskHost(ScriptNodePtr s) :
SourceObject(s),
+ CommonObjects(s),
CheckHost(s),
TaskHost(s)
{
}
void executeTask(ExecContext * ec) const
{
+ Logger()->messagebf(LOG_DEBUG, "%s: run %d checks", __PRETTY_FUNCTION__, CheckHost::checks.size());
runChecks(ec);
+ Logger()->messagebf(LOG_DEBUG, "%s: execute %d tasks", __PRETTY_FUNCTION__, TaskHost::tasks.size());
execute(ec);
}
};
@@ -160,9 +166,9 @@ void
IceDaemon::executeTask(const std::string & name, const ParamMap & pm) const
{
ScriptNodePtr s = ScriptReader::resolveScript(IceDaemon::taskRoot, name, false)->root();
- IceDaemonTaskHost t(s);
+ boost::intrusive_ptr<IceDaemonTaskHost> t = new IceDaemonTaskHost(s);
IceCallContext icc(pm);
- t.executeTask(&icc);
+ t->executeTask(&icc);
}
IceCompile::CPtr