summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2006-05-22 19:36:56 +0000
committerBenoit Foucher <benoit@zeroc.com>2006-05-22 19:36:56 +0000
commitb6a76f40823b2dd53a6d755d93c1cd16bd4b725b (patch)
tree27f37bd910c49131d0753742cd91f34e4f32ccce /cpp/src
parentRemoved object descriptor allocatable attribute. (diff)
downloadice-b6a76f40823b2dd53a6d755d93c1cd16bd4b725b.tar.bz2
ice-b6a76f40823b2dd53a6d755d93c1cd16bd4b725b.tar.xz
ice-b6a76f40823b2dd53a6d755d93c1cd16bd4b725b.zip
Bug fixes
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/IceGrid/DescriptorHelper.cpp13
-rw-r--r--cpp/src/IceGrid/DescriptorHelper.h2
-rw-r--r--cpp/src/IceGrid/ServerCache.cpp26
3 files changed, 37 insertions, 4 deletions
diff --git a/cpp/src/IceGrid/DescriptorHelper.cpp b/cpp/src/IceGrid/DescriptorHelper.cpp
index f42f21aa2db..2679c8594cd 100644
--- a/cpp/src/IceGrid/DescriptorHelper.cpp
+++ b/cpp/src/IceGrid/DescriptorHelper.cpp
@@ -280,7 +280,6 @@ Resolver::Resolver(const ApplicationHelper& app) :
_ignore.insert("node.version");
_ignore.insert("node.machine");
_ignore.insert("node.datadir");
- _ignore.insert("session.id");
}
Resolver::Resolver(const Resolver& resolve,
@@ -456,6 +455,12 @@ Resolver::getProperties(const Ice::StringSeq& references) const
}
void
+Resolver::addIgnored(const string& name)
+{
+ _ignore.insert(name);
+}
+
+void
Resolver::exception(const string& reason) const
{
throw DeploymentException(_context + ": " + reason);
@@ -1524,6 +1529,12 @@ ServerInstanceHelper::init(const ServerDescriptorPtr& definition, const Resolver
Resolver svrResolve(resolve, parameterValues, true);
svrResolve.setReserved("server", svrResolve(def->id, "server id", false));
svrResolve.setContext("server `${server}'");
+ if(svrResolve(def->activation, "server activation", true) == "session")
+ {
+ // Ignore undefined session.id variables, it will get defined
+ // when the server is allocated.
+ svrResolve.addIgnored("session.id");
+ }
//
// Instantiate the server instance definition (we use the server
diff --git a/cpp/src/IceGrid/DescriptorHelper.h b/cpp/src/IceGrid/DescriptorHelper.h
index 38430fc8a25..c19aae0be03 100644
--- a/cpp/src/IceGrid/DescriptorHelper.h
+++ b/cpp/src/IceGrid/DescriptorHelper.h
@@ -35,6 +35,8 @@ public:
const PropertySetDescriptor& getPropertySet(const std::string&) const;
PropertyDescriptorSeq getProperties(const Ice::StringSeq&) const;
+ void addIgnored(const std::string&);
+
void exception(const std::string&) const;
TemplateDescriptor getServerTemplate(const std::string&) const;
diff --git a/cpp/src/IceGrid/ServerCache.cpp b/cpp/src/IceGrid/ServerCache.cpp
index 1e3eaa1146e..b328fa5a3b3 100644
--- a/cpp/src/IceGrid/ServerCache.cpp
+++ b/cpp/src/IceGrid/ServerCache.cpp
@@ -766,9 +766,16 @@ ServerEntry::allocated(const SessionIPtr& session)
out << "server `" << _id << "' allocated by `" << session->getId() << "' (" << _count << ")";
}
+ //
+ // If the server has the session activation mode, we re-load the
+ // server on the node as its deployment might have changed (it's
+ // possible to use ${session.*} variable with server with the
+ // session activation mode.
+ //
{
Lock sync(*this);
- if(_loaded.get() || _load.get())
+ if(_loaded.get() && _loaded->descriptor->activation == "session" ||
+ _load.get() && _load->descriptor->activation == "session")
{
_updated = true;
if(!_load.get())
@@ -785,9 +792,18 @@ ServerEntry::allocated(const SessionIPtr& session)
void
ServerEntry::released(const SessionIPtr& session)
{
+ //
+ // If the server has the session activation mode, we re-load the
+ // server on the node as its deployment might have changed (it's
+ // possible to use ${session.*} variable with server with the
+ // session activation mode. Synchronizing the server will also
+ // shutdown the server on the node.
+ //
+ bool syncNow = false;
{
Lock sync(*this);
- if(_loaded.get() || _load.get())
+ if(_loaded.get() && _loaded->descriptor->activation == "session" ||
+ _load.get() && _load->descriptor->activation == "session")
{
_updated = true;
if(!_load.get())
@@ -797,6 +813,7 @@ ServerEntry::released(const SessionIPtr& session)
_proxy = 0;
_adapters.clear();
_session = 0;
+ syncNow = true;
}
}
@@ -807,6 +824,9 @@ ServerEntry::released(const SessionIPtr& session)
out << "server `" << _id << "' released by `" << session->getId() << "' (" << _count << ")";
}
- syncImpl(false); // We sync here to ensure the server will be shutdown.
+ if(syncNow)
+ {
+ syncImpl(false); // We sync here to ensure the server will be shutdown.
+ }
}