summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2007-11-20 12:02:35 +0100
committerBenoit Foucher <benoit@zeroc.com>2007-11-20 12:02:35 +0100
commita021dbce94296f83bc5feb25a2aa99461bab057d (patch)
tree648a3b5632d7e80006345540f0e2c1a1ddb266fe /cpp/src
parentMerge branch 'master' of cvs:/home/git/ice (diff)
downloadice-a021dbce94296f83bc5feb25a2aa99461bab057d.tar.bz2
ice-a021dbce94296f83bc5feb25a2aa99461bab057d.tar.xz
ice-a021dbce94296f83bc5feb25a2aa99461bab057d.zip
Fixed bug 2235, other minor fixes
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Ice/PropertyNames.cpp3
-rw-r--r--cpp/src/Ice/PropertyNames.h2
-rw-r--r--cpp/src/IceGrid/NodeI.cpp28
-rw-r--r--cpp/src/IceGrid/NodeI.h4
-rw-r--r--cpp/src/IceGrid/ServerAdapterI.cpp20
5 files changed, 34 insertions, 23 deletions
diff --git a/cpp/src/Ice/PropertyNames.cpp b/cpp/src/Ice/PropertyNames.cpp
index 8f282dcdb08..f20324c3f4d 100644
--- a/cpp/src/Ice/PropertyNames.cpp
+++ b/cpp/src/Ice/PropertyNames.cpp
@@ -7,7 +7,7 @@
//
// **********************************************************************
//
-// Generated by makeprops.py from file ..\config\PropertyNames.xml, Mon Oct 29 16:59:13 2007
+// Generated by makeprops.py from file ../config/PropertyNames.xml, Tue Nov 20 11:07:30 2007
// IMPORTANT: Do not edit this file -- any edits made here will be lost!
@@ -201,6 +201,7 @@ const IceInternal::Property IceGridPropsData[] =
IceInternal::Property("IceGrid.Node.ThreadPool.SizeWarn", false, 0),
IceInternal::Property("IceGrid.Node.ThreadPool.StackSize", false, 0),
IceInternal::Property("IceGrid.Node.AllowRunningServersAsRoot", false, 0),
+ IceInternal::Property("IceGrid.Node.AllowEndpointsOverride", false, 0),
IceInternal::Property("IceGrid.Node.CollocateRegistry", false, 0),
IceInternal::Property("IceGrid.Node.Data", false, 0),
IceInternal::Property("IceGrid.Node.DisableOnFailure", false, 0),
diff --git a/cpp/src/Ice/PropertyNames.h b/cpp/src/Ice/PropertyNames.h
index 337d21a566f..d9da321ee65 100644
--- a/cpp/src/Ice/PropertyNames.h
+++ b/cpp/src/Ice/PropertyNames.h
@@ -7,7 +7,7 @@
//
// **********************************************************************
//
-// Generated by makeprops.py from file ..\config\PropertyNames.xml, Mon Oct 29 16:59:13 2007
+// Generated by makeprops.py from file ../config/PropertyNames.xml, Tue Nov 20 11:07:30 2007
// IMPORTANT: Do not edit this file -- any edits made here will be lost!
diff --git a/cpp/src/IceGrid/NodeI.cpp b/cpp/src/IceGrid/NodeI.cpp
index 1c0f3d5f1f9..bad4237f63a 100644
--- a/cpp/src/IceGrid/NodeI.cpp
+++ b/cpp/src/IceGrid/NodeI.cpp
@@ -206,49 +206,51 @@ NodeI::NodeI(const Ice::ObjectAdapterPtr& adapter,
_name(name),
_proxy(proxy),
_redirectErrToOut(false),
+ _allowEndpointsOverride(false),
_waitTime(0),
_userAccountMapper(mapper),
_platform("IceGrid.Node", _communicator, _traceLevels),
_fileCache(new FileCache(_communicator)),
_serial(1)
{
- Ice::PropertiesPtr properties = _communicator->getProperties();
+ Ice::PropertiesPtr props = _communicator->getProperties();
const_cast<string&>(_dataDir) = _platform.getDataDir();
const_cast<string&>(_serversDir) = _dataDir + "/servers";
const_cast<string&>(_tmpDir) = _dataDir + "/tmp";
const_cast<string&>(_instanceName) = _communicator->getDefaultLocator()->ice_getIdentity().category;
- const_cast<Ice::Int&>(_waitTime) = properties->getPropertyAsIntWithDefault("IceGrid.Node.WaitTime", 60);
- const_cast<string&>(_outputDir) = properties->getProperty("IceGrid.Node.Output");
- const_cast<bool&>(_redirectErrToOut) = properties->getPropertyAsInt("IceGrid.Node.RedirectErrToOut") > 0;
+ const_cast<Ice::Int&>(_waitTime) = props->getPropertyAsIntWithDefault("IceGrid.Node.WaitTime", 60);
+ const_cast<string&>(_outputDir) = props->getProperty("IceGrid.Node.Output");
+ const_cast<bool&>(_redirectErrToOut) = props->getPropertyAsInt("IceGrid.Node.RedirectErrToOut") > 0;
+ const_cast<bool&>(_allowEndpointsOverride) = props->getPropertyAsInt("IceGrid.Node.AllowEndpointsOverride") > 0;
//
// Parse the properties override property.
//
- string props = properties->getProperty("IceGrid.Node.PropertiesOverride");
+ string overrides = props->getProperty("IceGrid.Node.PropertiesOverride");
Ice::StringSeq propsAsArgs;
- if(!props.empty())
+ if(!overrides.empty())
{
string::size_type end = 0;
while(end != string::npos)
{
const string delim = " \t\r\n";
- string::size_type beg = props.find_first_not_of(delim, end);
+ string::size_type beg = overrides.find_first_not_of(delim, end);
if(beg == string::npos)
{
break;
}
- end = props.find_first_of(delim, beg);
+ end = overrides.find_first_of(delim, beg);
string arg;
if(end == string::npos)
{
- arg = props.substr(beg);
+ arg = overrides.substr(beg);
}
else
{
- arg = props.substr(beg, end - beg);
+ arg = overrides.substr(beg, end - beg);
}
if(arg.find("--") == 0)
@@ -756,6 +758,12 @@ NodeI::getRedirectErrToOut() const
return _redirectErrToOut;
}
+bool
+NodeI::allowEndpointsOverride() const
+{
+ return _allowEndpointsOverride;
+}
+
NodeSessionPrx
NodeI::registerWithRegistry(const InternalRegistryPrx& registry)
{
diff --git a/cpp/src/IceGrid/NodeI.h b/cpp/src/IceGrid/NodeI.h
index 42b132c2f19..6aaab267005 100644
--- a/cpp/src/IceGrid/NodeI.h
+++ b/cpp/src/IceGrid/NodeI.h
@@ -87,7 +87,8 @@ public:
std::string getOutputDir() const;
bool getRedirectErrToOut() const;
-
+ bool allowEndpointsOverride() const;
+
NodeSessionPrx registerWithRegistry(const InternalRegistryPrx&);
void checkConsistency(const NodeSessionPrx&);
NodeSessionPrx getMasterNodeSession() const;
@@ -120,6 +121,7 @@ private:
const NodePrx _proxy;
const std::string _outputDir;
const bool _redirectErrToOut;
+ const bool _allowEndpointsOverride;
const Ice::Int _waitTime;
const std::string _instanceName;
const UserAccountMapperPrx _userAccountMapper;
diff --git a/cpp/src/IceGrid/ServerAdapterI.cpp b/cpp/src/IceGrid/ServerAdapterI.cpp
index b6835e6d90f..4529bf4e8d8 100644
--- a/cpp/src/IceGrid/ServerAdapterI.cpp
+++ b/cpp/src/IceGrid/ServerAdapterI.cpp
@@ -128,16 +128,16 @@ ServerAdapterI::setDirectProxy(const Ice::ObjectPrx& prx, const Ice::Current&)
// We don't allow to override an existing proxy by another non
// null proxy if the server is not inactive.
//
- // TODO: This check would fail with the new refreshPublishedEndpoints() call.
- // Is some protesction still needed though?
- //
- //if(prx && _proxy)
- //{
- // if(_server->getState() == Active)
- // {
- // throw AdapterActiveException();
- // }
- //}
+ if(!_node->allowEndpointsOverride())
+ {
+ if(prx && _proxy)
+ {
+ if(_server->getState() == Active)
+ {
+ throw AdapterActiveException();
+ }
+ }
+ }
bool updated = _proxy != prx;
_proxy = prx;