summaryrefslogtreecommitdiff
path: root/cpp/src/IceGrid
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2006-12-18 17:06:44 +0000
committerDwayne Boone <dwayne@zeroc.com>2006-12-18 17:06:44 +0000
commitd07fdae285690f699a70f97f36232e516dcad2bc (patch)
treec239def689c5e6cc53ac76dbe3e60ec11c306964 /cpp/src/IceGrid
parentFixed tryLock() comment (diff)
downloadice-d07fdae285690f699a70f97f36232e516dcad2bc.tar.bz2
ice-d07fdae285690f699a70f97f36232e516dcad2bc.tar.xz
ice-d07fdae285690f699a70f97f36232e516dcad2bc.zip
Object adapter properties now prefixed by "Ice.OA."
Diffstat (limited to 'cpp/src/IceGrid')
-rw-r--r--cpp/src/IceGrid/DescriptorBuilder.cpp17
-rw-r--r--cpp/src/IceGrid/DescriptorHelper.cpp25
-rw-r--r--cpp/src/IceGrid/IceGridNode.cpp39
-rw-r--r--cpp/src/IceGrid/PlatformInfo.cpp36
-rw-r--r--cpp/src/IceGrid/RegistryI.cpp63
-rw-r--r--cpp/src/IceGrid/ServerI.cpp6
6 files changed, 148 insertions, 38 deletions
diff --git a/cpp/src/IceGrid/DescriptorBuilder.cpp b/cpp/src/IceGrid/DescriptorBuilder.cpp
index 611966a6672..f99092e1062 100644
--- a/cpp/src/IceGrid/DescriptorBuilder.cpp
+++ b/cpp/src/IceGrid/DescriptorBuilder.cpp
@@ -681,6 +681,10 @@ CommunicatorDescriptorBuilder::addAdapter(const XmlAttributesHelper& attrs)
desc.serverLifetime = attrs.asBool("server-lifetime", true);
_descriptor->adapters.push_back(desc);
+ //
+ // DEPRECATED PROPERTY: Remove extra code in future release.
+ //
+ addProperty(_hiddenProperties, "Ice.OA." + desc.name + ".Endpoints", attrs("endpoints", "default"));
addProperty(_hiddenProperties, desc.name + ".Endpoints", attrs("endpoints", "default"));
}
@@ -904,8 +908,13 @@ IceBoxDescriptorBuilder::init(const IceBoxDescriptorPtr& desc, const XmlAttribut
ServerDescriptorBuilder::init(desc, attrs);
_descriptor = desc;
+ //
+ // DEPRECATED PROPERTY: Remove extra code in future release.
+ //
addProperty(_hiddenProperties, "IceBox.InstanceName", "${server}");
+ addProperty(_hiddenProperties, "Ice.OA.IceBox.ServiceManager.Endpoints", "tcp -h 127.0.0.1");
addProperty(_hiddenProperties, "IceBox.ServiceManager.Endpoints", "tcp -h 127.0.0.1");
+ addProperty(_hiddenProperties, "Ice.OA.IceBox.ServiceManager.RegisterProcess", "1");
addProperty(_hiddenProperties, "IceBox.ServiceManager.RegisterProcess", "1");
}
@@ -932,7 +941,13 @@ IceBoxDescriptorBuilder::addAdapter(const XmlAttributesHelper& attrs)
PropertyDescriptorSeq::iterator p = _hiddenProperties.begin();
while(p != _hiddenProperties.end())
{
- if(p->name == "IceBox.ServiceManager.Endpoints" || p->name == "IceBox.ServiceManager.RegisterProcess")
+ //
+ // DEPRECATED PROPERTY: Remove extra code in future release
+ //
+ if(p->name == "Ice.OA.IceBox.ServiceManager.Endpoints" ||
+ p->name == "IceBox.ServiceManager.Endpoints" ||
+ p->name == "Ice.OA.IceBox.ServiceManager.RegisterProcess" ||
+ p->name == "IceBox.ServiceManager.RegisterProcess")
{
p = _hiddenProperties.erase(p);
}
diff --git a/cpp/src/IceGrid/DescriptorHelper.cpp b/cpp/src/IceGrid/DescriptorHelper.cpp
index 68138d8a469..dcc2c00ce76 100644
--- a/cpp/src/IceGrid/DescriptorHelper.cpp
+++ b/cpp/src/IceGrid/DescriptorHelper.cpp
@@ -962,8 +962,10 @@ CommunicatorHelper::instantiateImpl(const CommunicatorDescriptorPtr& instance, c
//
// Make sure the endpoints are defined.
//
- string endpoints = IceGrid::getProperty(instance->propertySet.properties, adapter.name + ".Endpoints");
- if(endpoints.empty())
+ // DEPRECATED PROPERY: Remove extra code in future release.
+ //
+ if(IceGrid::getProperty(instance->propertySet.properties, "Ice.OA." + adapter.name + ".Endpoints").empty() &&
+ IceGrid::getProperty(instance->propertySet.properties, adapter.name + ".Endpoints").empty())
{
resolve.exception("invalid endpoints for adapter `" + adapter.name + "': empty string");
}
@@ -1065,7 +1067,14 @@ CommunicatorHelper::printObjectAdapter(Output& out, const AdapterDescriptor& ada
{
out << nl << "priority = `" << adapter.priority << "'";
}
- string endpoints = getProperty(adapter.name + ".Endpoints");
+ //
+ // DEPRECATED PROPERTY: Remove extra code in future release.
+ //
+ string endpoints = getProperty("Ice.OA." + adapter.name + ".Endpoints");
+ if(endpoints.empty())
+ {
+ endpoints = getProperty(adapter.name + ".Endpoints");
+ }
if(!endpoints.empty())
{
out << nl << "endpoints = `" << endpoints << "'";
@@ -1485,7 +1494,15 @@ IceBoxHelper::print(Output& out, const ServerInfo& info) const
{
out << "icebox `" + _desc->id + "'";
out << sb;
- out << nl << "service manager endpoints = `" << getProperty("IceBox.ServiceManager.Endpoints") << "'";
+ //
+ // DEPRECATED PROPERTY: Remove extra code in future release.
+ //
+ string endpoints = getProperty("Ice.OA.IceBox.ServiceManager.Endpoints");
+ if(endpoints.empty())
+ {
+ endpoints = getProperty("IceBox.ServiceManager.Endpoints");
+ }
+ out << nl << "service manager endpoints = `" << endpoints << "'";
printImpl(out, info);
for(vector<ServiceInstanceHelper>::const_iterator p = _services.begin(); p != _services.end(); ++p)
{
diff --git a/cpp/src/IceGrid/IceGridNode.cpp b/cpp/src/IceGrid/IceGridNode.cpp
index c23e68edc10..b90bdf0c210 100644
--- a/cpp/src/IceGrid/IceGridNode.cpp
+++ b/cpp/src/IceGrid/IceGridNode.cpp
@@ -227,13 +227,22 @@ NodeService::start(int argc, char* argv[])
out << "you should set individual adapter thread pools instead.";
}
- int size = properties->getPropertyAsIntWithDefault("IceGrid.Node.ThreadPool.Size", 0);
+ //
+ // DEPRECATED PROPERTY: Remove extra code in future release
+ //
+ int size = properties->getPropertyAsIntWithDefault("Ice.OA.IceGrid.Node.ThreadPool.Size",
+ properties->getPropertyAsIntWithDefault("IceGrid.Node.ThreadPool.Size", 0));
if(size <= 0)
{
- properties->setProperty("IceGrid.Node.ThreadPool.Size", "1");
+ properties->setProperty("Ice.OA.IceGrid.Node.ThreadPool.Size", "1");
size = 1;
}
- int sizeMax = properties->getPropertyAsIntWithDefault("IceGrid.Node.ThreadPool.SizeMax", 0);
+
+ //
+ // DEPRECATED PROPERTY: Remove extra code in future release
+ //
+ int sizeMax = properties->getPropertyAsIntWithDefault("Ice.OA.IceGrid.Node.ThreadPool.SizeMax",
+ properties->getPropertyAsIntWithDefault("IceGrid.Node.ThreadPool.SizeMax", 0));
if(sizeMax <= 0)
{
if(size >= sizeMax)
@@ -243,7 +252,7 @@ NodeService::start(int argc, char* argv[])
ostringstream os;
os << sizeMax;
- properties->setProperty("IceGrid.Node.ThreadPool.SizeMax", os.str());
+ properties->setProperty("Ice.OA.IceGrid.Node.ThreadPool.SizeMax", os.str());
}
size = properties->getPropertyAsIntWithDefault("Ice.ThreadPool.Client.Size", 0);
@@ -296,8 +305,13 @@ NodeService::start(int argc, char* argv[])
Identity locatorId;
locatorId.category = properties->getPropertyWithDefault("IceGrid.InstanceName", "IceGrid");
locatorId.name = "Locator";
- string locatorPrx = "\"" + communicator()->identityToString(locatorId) + "\" :" +
- properties->getProperty("IceGrid.Registry.Client.Endpoints");
+ //
+ // DEPRECATED PROPERTY: Remove extra code in future release
+ //
+ string endpoints =
+ properties->getPropertyWithDefault("Ice.OA.IceGrid.Registry.Client.Endpoints",
+ properties->getProperty("IceGrid.Registry.Client.Endpoints"));
+ string locatorPrx = "\"" + communicator()->identityToString(locatorId) + "\" :" + endpoints;
communicator()->setDefaultLocator(LocatorPrx::uncheckedCast(communicator()->stringToProxy(locatorPrx)));
properties->setProperty("Ice.Default.Locator", locatorPrx);
}
@@ -362,9 +376,12 @@ NodeService::start(int argc, char* argv[])
//
// Check that required properties are set and valid.
//
- if(properties->getProperty("IceGrid.Node.Endpoints").empty())
+ // DEPRECATED PROPERTY: Remove extra code in future release
+ //
+ if(properties->getProperty("Ice.OA.IceGrid.Node.Endpoints").empty() &&
+ properties->getProperty("IceGrid.Node.Endpoints").empty())
{
- error("property `IceGrid.Node.Endpoints' is not set");
+ error("property `Ice.OA.IceGrid.Node.Endpoints' is not set");
return false;
}
@@ -384,7 +401,11 @@ NodeService::start(int argc, char* argv[])
//
// Create the node object adapter.
//
- properties->setProperty("IceGrid.Node.RegisterProcess", "0");
+ // DEPRECATED PROPERTIES: Remove extra code in future release.
+ //
+ properties->setProperty("Ice.OA.IceGrid.Node.RegisterProcess", "0");
+ properties->setProperty("IceGrid.Node.RegisterProcess", "");
+ properties->setProperty("Ice.OA.IceGrid.Node.AdapterId", "");
properties->setProperty("IceGrid.Node.AdapterId", "");
_adapter = communicator()->createObjectAdapter("IceGrid.Node");
diff --git a/cpp/src/IceGrid/PlatformInfo.cpp b/cpp/src/IceGrid/PlatformInfo.cpp
index c5fc269efc6..188d5d68910 100644
--- a/cpp/src/IceGrid/PlatformInfo.cpp
+++ b/cpp/src/IceGrid/PlatformInfo.cpp
@@ -175,20 +175,46 @@ PlatformInfo::PlatformInfo(const string& prefix,
_machine = utsinfo.machine;
#endif
+ //
+ // DEPRECATED PROPERTIES: Remove extra code in future release.
+ //
Ice::PropertiesPtr properties = communicator->getProperties();
+ string endpointsPrefix;
+ string oldEndpointsPrefix;
if(prefix == "IceGrid.Registry")
{
_name = properties->getPropertyWithDefault("IceGrid.Registry.ReplicaName", "Master");
- const string endpointsPrefix = prefix + ".Client";
- _endpoints = properties->getPropertyWithDefault(
- endpointsPrefix + ".PublishedEndpoints", properties->getProperty(endpointsPrefix + ".Endpoints"));
+ endpointsPrefix = "Ice.OA." + prefix + ".Client";
+ oldEndpointsPrefix = prefix + ".Client";
}
else
{
_name = properties->getProperty(prefix + ".Name");
- _endpoints = properties->getPropertyWithDefault(
- prefix + ".PublishedEndpoints", properties->getProperty(prefix + ".Endpoints"));
+ endpointsPrefix = prefix;
+ oldEndpointsPrefix = prefix;
+ }
+
+ Ice::PropertyDict props = properties->getPropertiesForPrefix(endpointsPrefix);
+ Ice::PropertyDict::const_iterator p = props.find(endpointsPrefix + ".PublishedEndpoints");
+ if(p != props.end())
+ {
+ _endpoints = p->second;
}
+ else
+ {
+ Ice::PropertyDict oldProps = properties->getPropertiesForPrefix(oldEndpointsPrefix);
+ p = props.find(oldEndpointsPrefix + ".PublishedEndpoints");
+ if(p != props.end())
+ {
+ _endpoints = p->second;
+ }
+ else
+ {
+ _endpoints = properties->getPropertyWithDefault(
+ endpointsPrefix + ".Endpoints", properties->getProperty(oldEndpointsPrefix + ".Endpoints"));
+ }
+ }
+
_dataDir = properties->getProperty(prefix + ".Data");
if(!IcePatch2::isAbsolute(_dataDir))
{
diff --git a/cpp/src/IceGrid/RegistryI.cpp b/cpp/src/IceGrid/RegistryI.cpp
index dc4b09ce6e8..cc07c398ee2 100644
--- a/cpp/src/IceGrid/RegistryI.cpp
+++ b/cpp/src/IceGrid/RegistryI.cpp
@@ -160,48 +160,63 @@ RegistryI::start(bool nowarn)
//
// Check that required properties are set and valid.
//
- if(properties->getProperty("IceGrid.Registry.Client.Endpoints").empty())
+ // DEPRECATED PROPERTY: Remove extra code in future release
+ //
+ if(properties->getProperty("Ice.OA.IceGrid.Registry.Client.Endpoints").empty() &&
+ properties->getProperty("IceGrid.Registry.Client.Endpoints").empty())
{
Error out(_communicator->getLogger());
- out << "property `IceGrid.Registry.Client.Endpoints' is not set";
+ out << "property `Ice.OA.IceGrid.Registry.Client.Endpoints' is not set";
return false;
}
- if(properties->getProperty("IceGrid.Registry.Server.Endpoints").empty())
+ //
+ // DEPRECATED PROPERTY: Remove extra code in future release
+ //
+ if(properties->getProperty("Ice.OA.IceGrid.Registry.Server.Endpoints").empty() &&
+ properties->getProperty("IceGrid.Registry.Server.Endpoints").empty())
{
Error out(_communicator->getLogger());
- out << "property `IceGrid.Registry.Server.Endpoints' is not set";
+ out << "property `Ice.OA.IceGrid.Registry.Server.Endpoints' is not set";
return false;
}
- if(properties->getProperty("IceGrid.Registry.Internal.Endpoints").empty())
+ //
+ // DEPRECATED PROPERTY: Remove extra code in future release
+ //
+ if(properties->getProperty("Ice.OA.IceGrid.Registry.Internal.Endpoints").empty() &&
+ properties->getProperty("IceGrid.Registry.Internal.Endpoints").empty())
{
Error out(_communicator->getLogger());
- out << "property `IceGrid.Registry.Internal.Endpoints' is not set";
+ out << "property `Ice.OA.IceGrid.Registry.Internal.Endpoints' is not set";
return false;
}
- if(!properties->getProperty("IceGrid.Registry.SessionManager.Endpoints").empty())
+ //
+ // DEPRECATED PROPERTY: Remove extra code in future release
+ //
+ if(!properties->getProperty("Ice.OA.IceGrid.Registry.SessionManager.Endpoints").empty() ||
+ !properties->getProperty("IceGrid.Registry.SessionManager.Endpoints").empty())
{
if(!nowarn)
{
Warning out(_communicator->getLogger());
- out << "session manager endpoints `IceGrid.Registry.SessionManager.Endpoints' enabled";
+ out << "session manager endpoints `Ice.OA.IceGrid.Registry.SessionManager.Endpoints' enabled";
}
}
properties->setProperty("Ice.PrintProcessId", "0");
properties->setProperty("Ice.ServerIdleTime", "0");
- properties->setProperty("IceGrid.Registry.Client.AdapterId", "");
- properties->setProperty("IceGrid.Registry.Server.AdapterId", "");
- properties->setProperty("IceGrid.Registry.SessionManager.AdapterId", "");
- properties->setProperty("IceGrid.Registry.Internal.AdapterId", "");
+ properties->setProperty("Ice.OA.IceGrid.Registry.Client.AdapterId", "");
+ properties->setProperty("Ice.OA.IceGrid.Registry.Server.AdapterId", "");
+ properties->setProperty("Ice.OA.IceGrid.Registry.SessionManager.AdapterId", "");
+ properties->setProperty("Ice.OA.IceGrid.Registry.Internal.AdapterId", "");
setupThreadPool(properties, "Ice.ThreadPool.Client", 1, 100);
- setupThreadPool(properties, "IceGrid.Registry.Client.ThreadPool", 1, 10);
- setupThreadPool(properties, "IceGrid.Registry.Server.ThreadPool", 1, 10);
- setupThreadPool(properties, "IceGrid.Registry.SessionManager.ThreadPool", 1, 10);
- setupThreadPool(properties, "IceGrid.Registry.Internal.ThreadPool", 1, 100);
+ setupThreadPool(properties, "Ice.OA.IceGrid.Registry.Client.ThreadPool", 1, 10);
+ setupThreadPool(properties, "Ice.OA.IceGrid.Registry.Server.ThreadPool", 1, 10);
+ setupThreadPool(properties, "Ice.OA.IceGrid.Registry.SessionManager.ThreadPool", 1, 10);
+ setupThreadPool(properties, "Ice.OA.IceGrid.Registry.Internal.ThreadPool", 1, 100);
_replicaName = properties->getPropertyWithDefault("IceGrid.Registry.ReplicaName", "Master");
_master = _replicaName == "Master";
@@ -244,12 +259,18 @@ RegistryI::start(bool nowarn)
//
try
{
- string strPrx = _instanceName + "/Locator:" + properties->getProperty("IceGrid.Registry.Client.Endpoints");
+ //
+ // DEPRECATED PROPERTY: Remove extra code in future release
+ //
+ string endpoints =
+ properties->getPropertyWithDefault("Ice.OA.IceGrid.Registry.Client.Endpoints",
+ properties->getProperty("IceGrid.Registry.Client.Endpoints"));
+ string strPrx = _instanceName + "/Locator:" + endpoints;
_communicator->stringToProxy(strPrx)->ice_timeout(5000)->ice_ping();
Error out(_communicator->getLogger());
out << "an IceGrid registry is already running and listening on\n";
- out << "the client endpoints `" << properties->getProperty("IceGrid.Registry.Client.Endpoints") << "'";
+ out << "the client endpoints `" << endpoints << "'";
return false;
}
catch(const Ice::LocalException&)
@@ -333,7 +354,11 @@ RegistryI::start(bool nowarn)
ObjectAdapterPtr serverAdapter = _communicator->createObjectAdapter("IceGrid.Registry.Server");
_clientAdapter = _communicator->createObjectAdapter("IceGrid.Registry.Client");
ObjectAdapterPtr sessionManagerAdapter;
- if(!properties->getProperty("IceGrid.Registry.SessionManager.Endpoints").empty())
+ //
+ // DEPRECATED PROPERTY: Remove extra code in future release
+ //
+ if(!properties->getProperty("Ice.OA.IceGrid.Registry.SessionManager.Endpoints").empty() ||
+ !properties->getProperty("IceGrid.Registry.SessionManager.Endpoints").empty())
{
sessionManagerAdapter = _communicator->createObjectAdapter("IceGrid.Registry.SessionManager");
}
diff --git a/cpp/src/IceGrid/ServerI.cpp b/cpp/src/IceGrid/ServerI.cpp
index 51ecb0013b1..2ed1d397e65 100644
--- a/cpp/src/IceGrid/ServerI.cpp
+++ b/cpp/src/IceGrid/ServerI.cpp
@@ -2534,17 +2534,23 @@ ServerI::updateConfigFile(const string& serverDir, const CommunicatorDescriptorP
{
if(!q->id.empty() || q->registerProcess)
{
+ //
+ // DEPREACTED PROPERTIES: Removed extra code in future release
+ //
props.push_back(createProperty("# Object adapter " + q->name));
if(!q->id.empty())
{
+ props.push_back(createProperty("Ice.OA." + q->name + ".AdapterId", q->id));
props.push_back(createProperty(q->name + ".AdapterId", q->id));
if(!q->replicaGroupId.empty())
{
+ props.push_back(createProperty("Ice.OA." + q->name + ".ReplicaGroupId", q->replicaGroupId));
props.push_back(createProperty(q->name + ".ReplicaGroupId", q->replicaGroupId));
}
}
if(q->registerProcess)
{
+ props.push_back(createProperty("Ice.OA." + q->name + ".RegisterProcess", "1"));
props.push_back(createProperty(q->name + ".RegisterProcess", "1"));
}
}