summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Glacier2/Glacier2Router.cpp8
-rw-r--r--cpp/src/Glacier2/SessionRouterI.cpp8
-rw-r--r--cpp/src/IceBox/Admin.cpp8
-rw-r--r--cpp/src/IceBox/ServiceManagerI.cpp6
-rw-r--r--cpp/src/IceGrid/Client.cpp9
-rw-r--r--cpp/src/IceGrid/IceGridNode.cpp8
-rw-r--r--cpp/src/IceGrid/RegistryI.cpp56
-rwxr-xr-xcpp/src/IcePatch2/ClientUtil.cpp13
-rw-r--r--cpp/src/IcePatch2/Server.cpp8
-rw-r--r--cpp/src/IceStorm/Service.cpp7
10 files changed, 83 insertions, 48 deletions
diff --git a/cpp/src/Glacier2/Glacier2Router.cpp b/cpp/src/Glacier2/Glacier2Router.cpp
index 3a9318f5207..348fe697c80 100644
--- a/cpp/src/Glacier2/Glacier2Router.cpp
+++ b/cpp/src/Glacier2/Glacier2Router.cpp
@@ -269,10 +269,10 @@ Glacier2::RouterService::start(int argc, char* argv[])
//
if(adminAdapter)
{
- const string instanceNameProperty = "Glacier2.InstanceName";
- string adminId = properties->getPropertyWithDefault(instanceNameProperty, "Glacier2") + "/admin";
- Identity id = communicator()->stringToIdentity(adminId);
- adminAdapter->add(new AdminI(communicator()), id);
+ Identity adminId;
+ adminId.category = properties->getPropertyWithDefault("Glacier2.InstanceName", "Glacier2");
+ adminId.name = "admin";
+ adminAdapter->add(new AdminI(communicator()), adminId);
}
//
diff --git a/cpp/src/Glacier2/SessionRouterI.cpp b/cpp/src/Glacier2/SessionRouterI.cpp
index 5b692a52b68..a32c9c6abe1 100644
--- a/cpp/src/Glacier2/SessionRouterI.cpp
+++ b/cpp/src/Glacier2/SessionRouterI.cpp
@@ -264,10 +264,10 @@ Glacier2::SessionRouterI::SessionRouterI(const ObjectAdapterPtr& clientAdapter,
// This session router is used directly as servant for the main
// Glacier2 router Ice object.
//
- const string instanceNameProperty = "Glacier2.InstanceName";
- string routerId = _properties->getPropertyWithDefault(instanceNameProperty, "Glacier2") + "/router";
- Identity id = clientAdapter->getCommunicator()->stringToIdentity(routerId);
- _clientAdapter->add(this, id);
+ Identity routerId;
+ routerId.category = _properties->getPropertyWithDefault("Glacier2.InstanceName", "Glacier2");
+ routerId.name = "router";
+ _clientAdapter->add(this, routerId);
//
// All other calls on the client object adapter are dispatched to
diff --git a/cpp/src/IceBox/Admin.cpp b/cpp/src/IceBox/Admin.cpp
index 21309d22beb..0ecc1024fca 100644
--- a/cpp/src/IceBox/Admin.cpp
+++ b/cpp/src/IceBox/Admin.cpp
@@ -83,7 +83,9 @@ Client::run(int argc, char* argv[])
}
PropertiesPtr properties = communicator()->getProperties();
- string managerIdentity = properties->getPropertyWithDefault("IceBox.InstanceName", "IceBox") + "/ServiceManager";
+ Identity managerIdentity;
+ managerIdentity.category = properties->getPropertyWithDefault("IceBox.InstanceName", "IceBox");
+ managerIdentity.name = "ServiceManager";
string managerProxy;
if(properties->getProperty("Ice.Default.Locator").empty())
@@ -95,7 +97,7 @@ Client::run(int argc, char* argv[])
return EXIT_FAILURE;
}
- managerProxy = managerIdentity + ":" + managerEndpoints;
+ managerProxy = "\"" + communicator()->identityToString(managerIdentity) + "\" :" + managerEndpoints;
}
else
{
@@ -106,7 +108,7 @@ Client::run(int argc, char* argv[])
return EXIT_FAILURE;
}
- managerProxy = managerIdentity + "@" + managerAdapterId;
+ managerProxy = "\"" + communicator()->identityToString(managerIdentity) + "\" @" + managerAdapterId;
}
ObjectPrx base = communicator()->stringToProxy(managerProxy);
diff --git a/cpp/src/IceBox/ServiceManagerI.cpp b/cpp/src/IceBox/ServiceManagerI.cpp
index c6d8023f04b..ee010e18f05 100644
--- a/cpp/src/IceBox/ServiceManagerI.cpp
+++ b/cpp/src/IceBox/ServiceManagerI.cpp
@@ -62,8 +62,10 @@ IceBox::ServiceManagerI::start()
ObjectAdapterPtr adapter = _communicator->createObjectAdapter("IceBox.ServiceManager");
PropertiesPtr properties = _communicator->getProperties();
- string identity = properties->getPropertyWithDefault("IceBox.InstanceName", "IceBox") + "/ServiceManager";
- adapter->add(obj, _communicator->stringToIdentity(identity));
+ Identity identity;
+ identity.category = properties->getPropertyWithDefault("IceBox.InstanceName", "IceBox");
+ identity.name = "ServiceManager";
+ adapter->add(obj, identity);
//
// Parse the IceBox.LoadOrder property.
diff --git a/cpp/src/IceGrid/Client.cpp b/cpp/src/IceGrid/Client.cpp
index 29b98aec2d2..c9d9d6b122b 100644
--- a/cpp/src/IceGrid/Client.cpp
+++ b/cpp/src/IceGrid/Client.cpp
@@ -313,16 +313,19 @@ Client::run(int argc, char* argv[])
}
else
{
- string registryStr = instanceName + "/Registry";
+ Identity registryId;
+ registryId.category = instanceName;
+ registryId.name = "Registry";
if(!replica.empty() && replica != "Master")
{
- registryStr += "-" + replica;
+ registryId.name += "-" + replica;
}
RegistryPrx registry;
try
{
- registry = RegistryPrx::checkedCast(communicator()->stringToProxy(registryStr));
+ registry = RegistryPrx::checkedCast(
+ communicator()->stringToProxy("\"" + communicator()->identityToString(registryId) + "\""));
if(!registry)
{
cerr << argv[0] << ": could not contact registry" << endl;
diff --git a/cpp/src/IceGrid/IceGridNode.cpp b/cpp/src/IceGrid/IceGridNode.cpp
index bf38d3affb2..0299c266ea0 100644
--- a/cpp/src/IceGrid/IceGridNode.cpp
+++ b/cpp/src/IceGrid/IceGridNode.cpp
@@ -268,9 +268,11 @@ NodeService::start(int argc, char* argv[])
//
if(properties->getProperty("Ice.Default.Locator").empty())
{
- const string instanceNameProperty = "IceGrid.InstanceName";
- const string locatorId = properties->getPropertyWithDefault(instanceNameProperty, "IceGrid") + "/Locator";
- string locatorPrx = locatorId + ":" + properties->getProperty("IceGrid.Registry.Client.Endpoints");
+ Identity locatorId;
+ locatorId.category = properties->getPropertyWithDefault("IceGrid.InstanceName", "IceGrid");
+ locatorId.name = "Locator";
+ string locatorPrx = "\"" + communicator()->identityToString(locatorId) + "\" :" +
+ properties->getProperty("IceGrid.Registry.Client.Endpoints");
communicator()->setDefaultLocator(LocatorPrx::uncheckedCast(communicator()->stringToProxy(locatorPrx)));
properties->setProperty("Ice.Default.Locator", locatorPrx);
}
diff --git a/cpp/src/IceGrid/RegistryI.cpp b/cpp/src/IceGrid/RegistryI.cpp
index 07d2001c05a..6359083694d 100644
--- a/cpp/src/IceGrid/RegistryI.cpp
+++ b/cpp/src/IceGrid/RegistryI.cpp
@@ -229,8 +229,7 @@ RegistryI::start(bool nowarn)
//
if(_master)
{
- const string instanceNameProperty = "IceGrid.InstanceName";
- _instanceName = properties->getPropertyWithDefault(instanceNameProperty, "IceGrid");
+ _instanceName = properties->getPropertyWithDefault("IceGrid.InstanceName", "IceGrid");
}
else
{
@@ -252,11 +251,14 @@ RegistryI::start(bool nowarn)
//
// Create the internal IceStorm service.
//
+ Identity registryTopicManagerId;
+ registryTopicManagerId.category = _instanceName;
+ registryTopicManagerId.name = "RegistryTopicManager";
_iceStorm = IceStorm::Service::create(_communicator,
registryAdapter,
registryAdapter,
"IceGrid.Registry",
- _communicator->stringToIdentity(_instanceName + "/RegistryTopicManager"),
+ registryTopicManagerId,
"Registry");
int timeout = properties->getPropertyAsIntWithDefault("IceGrid.Registry.NodeSessionTimeout", 10);
@@ -350,10 +352,14 @@ RegistryI::setupLocator(const Ice::ObjectAdapterPtr& clientAdapter,
// Create the locator registry and locator interfaces.
//
bool dynamicReg = _communicator->getProperties()->getPropertyAsInt("IceGrid.Registry.DynamicRegistration") > 0;
- Identity locatorRegistryId = _communicator->stringToIdentity(_instanceName + "/" + IceUtil::generateUUID());
+ Identity locatorRegistryId;
+ locatorRegistryId.category = _instanceName;
+ locatorRegistryId.name = IceUtil::generateUUID();
ObjectPrx regPrx = serverAdapter->add(new LocatorRegistryI(_database, dynamicReg), locatorRegistryId);
- Identity locatorId = _communicator->stringToIdentity(_instanceName + "/Locator");
+ Identity locatorId;
+ locatorId.category = _instanceName;
+ locatorId.name = "Locator";
clientAdapter->add(new LocatorI(_communicator, _database, LocatorRegistryPrx::uncheckedCast(regPrx)), locatorId);
return LocatorPrx::uncheckedCast(registryAdapter->addWithUUID(
@@ -365,14 +371,18 @@ RegistryI::setupLocator(const Ice::ObjectAdapterPtr& clientAdapter,
void
RegistryI::setupQuery(const Ice::ObjectAdapterPtr& clientAdapter)
{
- Identity queryId = _communicator->stringToIdentity(_instanceName + "/Query");
+ Identity queryId;
+ queryId.category = _instanceName;
+ queryId.name = "Query";
clientAdapter->add(new QueryI(_communicator, _database), queryId);
}
void
RegistryI::setupRegistry(const Ice::ObjectAdapterPtr& clientAdapter)
{
- Identity registryId = _communicator->stringToIdentity(_instanceName + "/Registry");
+ Identity registryId;
+ registryId.category = _instanceName;
+ registryId.name = "Registry";
if(!_master)
{
registryId.name += "-" + _replicaName;
@@ -384,7 +394,9 @@ RegistryI::setupRegistry(const Ice::ObjectAdapterPtr& clientAdapter)
InternalRegistryPrx
RegistryI::setupInternalRegistry(const Ice::ObjectAdapterPtr& registryAdapter)
{
- Identity internalRegistryId = _communicator->stringToIdentity(_instanceName + "/InternalRegistry-" + _replicaName);
+ Identity internalRegistryId;
+ internalRegistryId.category = _instanceName;
+ internalRegistryId.name = "InternalRegistry-" + _replicaName;
assert(_reaper);
ObjectPtr internalRegistry = new InternalRegistryI(this, _database, _reaper, _wellKnownObjects, _session);
Ice::ObjectPrx proxy = registryAdapter->add(internalRegistry, internalRegistryId);
@@ -395,11 +407,15 @@ RegistryI::setupInternalRegistry(const Ice::ObjectAdapterPtr& registryAdapter)
void
RegistryI::setupNullPermissionsVerifier(const Ice::ObjectAdapterPtr& registryAdapter)
{
- Identity nullPermVerifId = _communicator->stringToIdentity(_instanceName + "/NullPermissionsVerifier");
+ Identity nullPermVerifId;
+ nullPermVerifId.category = _instanceName;
+ nullPermVerifId.name = "NullPermissionsVerifier";
_nullPermissionsVerifier = Glacier2::PermissionsVerifierPrx::uncheckedCast(
registryAdapter->add(new NullPermissionsVerifierI(), nullPermVerifId)->ice_collocationOptimized(true));
- Identity nullSSLPermVerifId = _communicator->stringToIdentity(_instanceName + "/NullSSLPermissionsVerifier");
+ Identity nullSSLPermVerifId;
+ nullSSLPermVerifId.category = _instanceName;
+ nullSSLPermVerifId.name = "NullSSLPermissionsVerifier";
_nullSSLPermissionsVerifier = Glacier2::SSLPermissionsVerifierPrx::uncheckedCast(
registryAdapter->add(new NullSSLPermissionsVerifierI(), nullSSLPermVerifId)->ice_collocationOptimized(true));
}
@@ -417,7 +433,9 @@ RegistryI::setupUserAccountMapper(const Ice::ObjectAdapterPtr& registryAdapter)
{
try
{
- Identity mapperId = _communicator->stringToIdentity(_instanceName + "/RegistryUserAccountMapper");
+ Identity mapperId;
+ mapperId.category = _instanceName;
+ mapperId.name = "RegistryUserAccountMapper";
if(!_master)
{
mapperId.name += "-" + _replicaName;
@@ -449,8 +467,12 @@ RegistryI::setupClientSessionFactory(const Ice::ObjectAdapterPtr& registryAdapte
if(sessionManagerAdapter && _master) // Slaves don't support client session manager objects.
{
- Identity clientSessionMgrId = _communicator->stringToIdentity(_instanceName + "/SessionManager");
- Identity sslClientSessionMgrId = _communicator->stringToIdentity(_instanceName + "/SSLSessionManager");
+ Identity clientSessionMgrId;
+ clientSessionMgrId.category = _instanceName;
+ clientSessionMgrId.name = "SessionManager";
+ Identity sslClientSessionMgrId;
+ sslClientSessionMgrId.category = _instanceName;
+ sslClientSessionMgrId.name = "SSLSessionManager";
sessionManagerAdapter->add(new ClientSessionManagerI(_clientSessionFactory), clientSessionMgrId);
sessionManagerAdapter->add(new ClientSSLSessionManagerI(_clientSessionFactory), sslClientSessionMgrId);
@@ -486,8 +508,12 @@ RegistryI::setupAdminSessionFactory(const Ice::ObjectAdapterPtr& registryAdapter
if(sessionManagerAdapter)
{
- Identity adminSessionMgrId = _communicator->stringToIdentity(_instanceName + "/AdminSessionManager");
- Identity sslAdmSessionMgrId = _communicator->stringToIdentity(_instanceName + "/AdminSSLSessionManager");
+ Identity adminSessionMgrId;
+ adminSessionMgrId.category = _instanceName;
+ adminSessionMgrId.name = "AdminSessionManager";
+ Identity sslAdmSessionMgrId;
+ sslAdmSessionMgrId.category = _instanceName;
+ sslAdmSessionMgrId.name = "AdminSSLSessionManager";
if(!_master)
{
adminSessionMgrId.name += "-" + _replicaName;
diff --git a/cpp/src/IcePatch2/ClientUtil.cpp b/cpp/src/IcePatch2/ClientUtil.cpp
index 2c6f736f436..08460af418e 100755
--- a/cpp/src/IcePatch2/ClientUtil.cpp
+++ b/cpp/src/IcePatch2/ClientUtil.cpp
@@ -163,16 +163,11 @@ IcePatch2::Patcher::Patcher(const CommunicatorPtr& communicator, const PatcherFe
throw string("property `") + endpointsProperty + "' is not set";
}
- const char* idProperty = "IcePatch2.Identity";
- string idStr = properties->getProperty(idProperty);
- if(idStr.empty())
- {
- const char* instanceProperty = "IcePatch2.InstanceName";
- idStr = properties->getPropertyWithDefault(instanceProperty, "IcePatch2") + "/server";
- }
- const Identity id = communicator->stringToIdentity(idStr);
+ Identity id;
+ id.category = properties->getPropertyWithDefault("IcePatch2.InstanceName", "IcePatch2");
+ id.name = "server";
- ObjectPrx serverBase = communicator->stringToProxy(communicator->identityToString(id) + ':' + endpoints);
+ ObjectPrx serverBase = communicator->stringToProxy("\"" + communicator->identityToString(id) + "\" :" + endpoints);
FileServerPrx server = FileServerPrx::checkedCast(serverBase);
if(!server)
{
diff --git a/cpp/src/IcePatch2/Server.cpp b/cpp/src/IcePatch2/Server.cpp
index f983479aad8..ed1e102c400 100644
--- a/cpp/src/IcePatch2/Server.cpp
+++ b/cpp/src/IcePatch2/Server.cpp
@@ -159,12 +159,16 @@ IcePatch2::PatcherService::start(int argc, char* argv[])
const string instanceNameProperty = "IcePatch2.InstanceName";
string instanceName = properties->getPropertyWithDefault(instanceNameProperty, "IcePatch2");
- Identity id = communicator()->stringToIdentity(instanceName + "/server");
+ Identity id;
+ id.category = instanceName;
+ id.name = "server";
adapter->add(new FileServerI(dataDir, infoSeq), id);
if(adminAdapter)
{
- Identity adminId = communicator()->stringToIdentity(instanceName + "/admin");
+ Identity adminId;
+ adminId.category = instanceName;
+ adminId.name = "admin";
adminAdapter->add(new AdminI(communicator()), adminId);
}
diff --git a/cpp/src/IceStorm/Service.cpp b/cpp/src/IceStorm/Service.cpp
index 99210191015..0abd7201134 100644
--- a/cpp/src/IceStorm/Service.cpp
+++ b/cpp/src/IceStorm/Service.cpp
@@ -100,10 +100,11 @@ IceStorm::ServiceI::start(const string& name,
//
// We use the name of the service for the name of the database environment.
//
- string topicManagerId = properties->getPropertyWithDefault(name + ".InstanceName", "IceStorm") + "/TopicManager";
- Ice::Identity id = communicator->stringToIdentity(topicManagerId);
+ Identity topicManagerId;
+ topicManagerId.category = properties->getPropertyWithDefault(name + ".InstanceName", "IceStorm");
+ topicManagerId.name = "TopicManager";
_manager = new TopicManagerI(communicator, _topicAdapter, _publishAdapter, traceLevels, name, "topics");
- _managerProxy = TopicManagerPrx::uncheckedCast(_topicAdapter->add(_manager, id));
+ _managerProxy = TopicManagerPrx::uncheckedCast(_topicAdapter->add(_manager, topicManagerId));
_topicAdapter->activate();
_publishAdapter->activate();