summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2004-02-20 21:32:15 +0000
committerBenoit Foucher <benoit@zeroc.com>2004-02-20 21:32:15 +0000
commit69a05e28e0702e5fd96ff012c64dcf72847818fa (patch)
treed560b8285964520c820ca29b2dd1f7600d5ea725 /cpp/src
parentmore ami (diff)
downloadice-69a05e28e0702e5fd96ff012c64dcf72847818fa.tar.bz2
ice-69a05e28e0702e5fd96ff012c64dcf72847818fa.tar.xz
ice-69a05e28e0702e5fd96ff012c64dcf72847818fa.zip
Fixed IcePack node bug and IcePack hello demo, added simple demo.
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/IcePack/ServerBuilder.cpp11
-rw-r--r--cpp/src/IcePack/ServerBuilder.h1
-rw-r--r--cpp/src/IcePack/ServerI.cpp9
3 files changed, 19 insertions, 2 deletions
diff --git a/cpp/src/IcePack/ServerBuilder.cpp b/cpp/src/IcePack/ServerBuilder.cpp
index 1b9827f04c3..1d0283daaea 100644
--- a/cpp/src/IcePack/ServerBuilder.cpp
+++ b/cpp/src/IcePack/ServerBuilder.cpp
@@ -19,6 +19,8 @@
#include <IcePack/AdapterFactory.h>
#include <IcePack/ServerFactory.h>
+#include <iterator>
+
using namespace std;
using namespace IcePack;
@@ -381,6 +383,13 @@ IcePack::ServerBuilder::parse(const std::string& descriptor)
}
}
+ if(_kind == ServerKindCppIceBox || _kind == ServerKindJavaIceBox)
+ {
+ ostringstream os;
+ copy(_serviceNames.begin(), _serviceNames.end(), ostream_iterator<string>(os," "));
+ addProperty("IceBox.LoadOrder", os.str());
+ }
+
_description.args.push_back("--Ice.Config=" + _configFile);
}
@@ -600,6 +609,8 @@ IcePack::ServerBuilder::addService(const string& name, const string& descriptor,
TaskPtr t = task;
task->parse(toLocation(descriptor));
_tasks.push_back(t);
+
+ _serviceNames.push_back(name);
}
void
diff --git a/cpp/src/IcePack/ServerBuilder.h b/cpp/src/IcePack/ServerBuilder.h
index ba5723c3128..a82296b451a 100644
--- a/cpp/src/IcePack/ServerBuilder.h
+++ b/cpp/src/IcePack/ServerBuilder.h
@@ -68,6 +68,7 @@ private:
std::string _className;
std::string _libraryPath;
std::vector<std::string> _javaOptions;
+ std::vector<std::string> _serviceNames;
ServerPrx _server;
std::map<std::string, ServerAdapterPrx> _serverAdapters;
diff --git a/cpp/src/IcePack/ServerI.cpp b/cpp/src/IcePack/ServerI.cpp
index 71c90c13028..218c8d5bd88 100644
--- a/cpp/src/IcePack/ServerI.cpp
+++ b/cpp/src/IcePack/ServerI.cpp
@@ -242,16 +242,20 @@ void
IcePack::ServerI::terminated(const Ice::Current&)
{
ServerState newState = Inactive; // Initialize to keep the compiler happy.
-
+ while(true)
{
IceUtil::Monitor< IceUtil::Mutex>::Lock sync(*this);
switch(_state)
{
case Inactive:
- case Activating:
{
assert(false);
}
+ case Activating:
+ {
+ wait(); // TODO: Timeout?
+ continue;
+ }
case Active:
{
_state = Deactivating;
@@ -286,6 +290,7 @@ IcePack::ServerI::terminated(const Ice::Current&)
}
assert(_state == Deactivating || _state == Destroying);
+ break;
}
if(newState != Destroyed)