diff options
author | Benoit Foucher <benoit@zeroc.com> | 2005-06-02 10:37:18 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2005-06-02 10:37:18 +0000 |
commit | b9ad5ee2d7f29cf02251b02e568772ed2312ccfb (patch) | |
tree | 1c5b1b54c4f17e280797fa14b06be65ea921fdb6 /cpp/src | |
parent | Bug 346. (diff) | |
download | ice-b9ad5ee2d7f29cf02251b02e568772ed2312ccfb.tar.bz2 ice-b9ad5ee2d7f29cf02251b02e568772ed2312ccfb.tar.xz ice-b9ad5ee2d7f29cf02251b02e568772ed2312ccfb.zip |
Fixed bug 258, 347, 352
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Ice/PropertyNames.cpp | 5 | ||||
-rw-r--r-- | cpp/src/Ice/PropertyNames.h | 2 | ||||
-rw-r--r-- | cpp/src/IcePack/Client.cpp | 10 | ||||
-rw-r--r-- | cpp/src/IcePack/IcePackNode.cpp | 4 | ||||
-rw-r--r-- | cpp/src/IcePack/Registry.cpp | 23 | ||||
-rw-r--r-- | cpp/src/IceStorm/OnewayProxy.cpp | 2 | ||||
-rw-r--r-- | cpp/src/IceStorm/TopicI.cpp | 36 | ||||
-rw-r--r-- | cpp/src/IceStorm/TwowayProxy.cpp | 4 |
8 files changed, 53 insertions, 33 deletions
diff --git a/cpp/src/Ice/PropertyNames.cpp b/cpp/src/Ice/PropertyNames.cpp index 779f3554ac0..981b9b90aec 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.def', Wed May 11 17:54:26 2005 +// Generated by makeprops.py from file `../config/PropertyNames.def', Thu Jun 2 12:34:35 2005 // IMPORTANT: Do not edit this file -- any edits made here will be lost! @@ -111,6 +111,7 @@ const char* IceInternal::PropertyNames::IcePackProps[] = "IcePack.Node.Trace.Server", "IcePack.Node.WaitTime", "IcePack.Node.BackgroundRegistration", + "IcePack.Registry.AdminIdentity", "IcePack.Registry.Admin.AdapterId", "IcePack.Registry.Admin.Endpoints", "IcePack.Registry.Admin.PublishedEndpoints", @@ -134,6 +135,7 @@ const char* IceInternal::PropertyNames::IcePackProps[] = "IcePack.Registry.Internal.ThreadPool.SizeMax", "IcePack.Registry.Internal.ThreadPool.SizeWarn", "IcePack.Registry.Internal.ThreadPool.StackSize", + "IcePack.Registry.LocatorIdentity", "IcePack.Registry.Server.AdapterId", "IcePack.Registry.Server.Endpoints", "IcePack.Registry.Server.PublishedEndpoints", @@ -145,6 +147,7 @@ const char* IceInternal::PropertyNames::IcePackProps[] = "IcePack.Registry.Trace.NodeRegistry", "IcePack.Registry.Trace.ObjectRegistry", "IcePack.Registry.Trace.ServerRegistry", + "IcePack.Registry.QueryIdentity", 0 }; diff --git a/cpp/src/Ice/PropertyNames.h b/cpp/src/Ice/PropertyNames.h index 1cf4232159f..21a8142ed5c 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.def', Tue Apr 26 23:12:47 2005 +// Generated by makeprops.py from file `../config/PropertyNames.def', Thu Jun 2 12:34:35 2005 // IMPORTANT: Do not edit this file -- any edits made here will be lost! diff --git a/cpp/src/IcePack/Client.cpp b/cpp/src/IcePack/Client.cpp index 3438fa77653..dfe386130ea 100644 --- a/cpp/src/IcePack/Client.cpp +++ b/cpp/src/IcePack/Client.cpp @@ -128,14 +128,20 @@ Client::run(int argc, char* argv[]) return EXIT_FAILURE; } - AdminPrx admin = AdminPrx::checkedCast(communicator()->stringToProxy("IcePack/Admin")); + PropertiesPtr properties = communicator()->getProperties(); + + const string adminIdProperty = "IcePack.Registry.AdminIdentity"; + string adminId = properties->getPropertyWithDefault(adminIdProperty, "IcePack/Admin"); + AdminPrx admin = AdminPrx::checkedCast(communicator()->stringToProxy(adminId)); if(!admin) { cerr << appName() << ": no valid administrative interface" << endl; return EXIT_FAILURE; } - QueryPrx query = QueryPrx::checkedCast(communicator()->stringToProxy("IcePack/Query")); + const string queryIdProperty = "IcePack.Registry.QueryIdentity"; + string queryId = properties->getPropertyWithDefault(queryIdProperty, "IcePack/Query"); + QueryPrx query = QueryPrx::checkedCast(communicator()->stringToProxy(queryId)); if(!query) { cerr << appName() << ": no valid query interface" << endl; diff --git a/cpp/src/IcePack/IcePackNode.cpp b/cpp/src/IcePack/IcePackNode.cpp index d51ffc9a99f..3628fd5c45f 100644 --- a/cpp/src/IcePack/IcePackNode.cpp +++ b/cpp/src/IcePack/IcePackNode.cpp @@ -245,7 +245,9 @@ IcePack::NodeService::start(int argc, char* argv[]) // collocated locator (this property is passed by the // activator to each activated server). // - string locatorPrx = "IcePack/Locator:" + properties->getProperty("IcePack.Registry.Client.Endpoints"); + const string locatorIdProperty = "IcePack.Registry.LocatorIdentity"; + string locatorId = properties->getPropertyWithDefault(locatorIdProperty, "IcePack/Locator"); + string locatorPrx = locatorId + ":" + properties->getProperty("IcePack.Registry.Client.Endpoints"); properties->setProperty("Ice.Default.Locator", locatorPrx); } else if(properties->getProperty("Ice.Default.Locator").empty()) diff --git a/cpp/src/IcePack/Registry.cpp b/cpp/src/IcePack/Registry.cpp index 0ac4689fdfe..88fb7fa6489 100644 --- a/cpp/src/IcePack/Registry.cpp +++ b/cpp/src/IcePack/Registry.cpp @@ -243,14 +243,18 @@ Registry::start(bool nowarn) ObjectPrx obj = serverAdapter->add(locatorRegistry, stringToIdentity("IcePack/" + IceUtil::generateUUID())); LocatorRegistryPrx locatorRegistryPrx = LocatorRegistryPrx::uncheckedCast(obj->ice_collocationOptimization(false)); ObjectPtr locator = new LocatorI(adapterRegistry, objectRegistry, locatorRegistryPrx); - clientAdapter->add(locator, stringToIdentity("IcePack/Locator")); + const string locatorIdProperty = "IcePack.Registry.LocatorIdentity"; + Identity locatorId = stringToIdentity(properties->getPropertyWithDefault(locatorIdProperty, "IcePack/Locator")); + clientAdapter->add(locator, locatorId); // // Create the query interface and register it with the object registry. // QueryPtr query = new QueryI(_communicator, objectRegistry); - clientAdapter->add(query, stringToIdentity("IcePack/Query")); - ObjectPrx queryPrx = clientAdapter->createDirectProxy(stringToIdentity("IcePack/Query")); + const string queryIdProperty = "IcePack.Registry.QueryIdentity"; + Identity queryId = stringToIdentity(properties->getPropertyWithDefault(queryIdProperty, "IcePack/Query")); + clientAdapter->add(query, queryId); + ObjectPrx queryPrx = clientAdapter->createDirectProxy(queryId); try { objectRegistry->remove(queryPrx->ice_getIdentity()); @@ -266,10 +270,11 @@ Registry::start(bool nowarn) // // Create the admin interface and register it with the object registry. // - ObjectPtr admin = new AdminI(_communicator, nodeReg, appReg, serverRegistry, adapterRegistry, objectRegistry, - this); - adminAdapter->add(admin, stringToIdentity("IcePack/Admin")); - ObjectPrx adminPrx = adminAdapter->createDirectProxy(stringToIdentity("IcePack/Admin")); + ObjectPtr admin = new AdminI(_communicator, nodeReg, appReg, serverRegistry, adapterRegistry, objectRegistry, this); + const string adminIdProperty = "IcePack.Registry.AdminIdentity"; + Identity adminId = stringToIdentity(properties->getPropertyWithDefault(adminIdProperty, "IcePack/Admin")); + adminAdapter->add(admin, adminId); + ObjectPrx adminPrx = adminAdapter->createDirectProxy(adminId); try { objectRegistry->remove(adminPrx->ice_getIdentity()); @@ -302,8 +307,8 @@ Registry::start(bool nowarn) // registered with the registry object adapter which is using an independant threadpool. // locator = new LocatorI(adapterRegistry, objectRegistry, locatorRegistryPrx); - registryAdapter->add(locator, stringToIdentity("IcePack/Locator")); - obj = registryAdapter->createDirectProxy(stringToIdentity("IcePack/Locator")); + registryAdapter->add(locator, locatorId); + obj = registryAdapter->createDirectProxy(locatorId); _communicator->setDefaultLocator(LocatorPrx::uncheckedCast(obj->ice_collocationOptimization(false))); // diff --git a/cpp/src/IceStorm/OnewayProxy.cpp b/cpp/src/IceStorm/OnewayProxy.cpp index 57b3b34baff..e662eb55f48 100644 --- a/cpp/src/IceStorm/OnewayProxy.cpp +++ b/cpp/src/IceStorm/OnewayProxy.cpp @@ -26,5 +26,5 @@ void IceStorm::OnewayProxy::deliver(const EventPtr& event) { vector<Ice::Byte> dummy; - _obj->ice_invoke(event->op, Ice::Idempotent, event->data, dummy, event->context); + _obj->ice_invoke(event->op, event->mode, event->data, dummy, event->context); } diff --git a/cpp/src/IceStorm/TopicI.cpp b/cpp/src/IceStorm/TopicI.cpp index 8046140f2c5..8fa062ff000 100644 --- a/cpp/src/IceStorm/TopicI.cpp +++ b/cpp/src/IceStorm/TopicI.cpp @@ -196,7 +196,13 @@ IceStorm::TopicSubscribers::publish(const EventPtr& event) { if((*p)->inactive()) { - if((*p)->error()) + // + // NOTE: only persistent subscribers need to be reaped + // and copied in the error list. Transient subscribers + // can be removed right away, the topic doesn't keep + // any reference on them. + // + if((*p)->error() && (*p)->persistent()) { e.push_back(*p); } @@ -638,25 +644,23 @@ TopicI::reap() for(SubscriberList::iterator p = error.begin(); p != error.end(); ++p) { SubscriberPtr subscriber = *p; - assert(subscriber->error()); - if(subscriber->persistent()) + assert(subscriber->error() && subscriber->persistent()); // Only persistent subscribers need to be reaped. + + if(_links.erase(subscriber->id().category) > 0) { - if(_links.erase(subscriber->id().category) > 0) + updated = true; + if(_traceLevels->topic > 0) { - updated = true; - if(_traceLevels->topic > 0) - { - Ice::Trace out(_traceLevels->logger, _traceLevels->topicCat); - out << "reaping " << subscriber->id(); - } + Ice::Trace out(_traceLevels->logger, _traceLevels->topicCat); + out << "reaping " << subscriber->id(); } - else + } + else + { + if(_traceLevels->topic > 0) { - if(_traceLevels->topic > 0) - { - Ice::Trace out(_traceLevels->logger, _traceLevels->topicCat); - out << "reaping " << subscriber->id() << " failed - not in database"; - } + Ice::Trace out(_traceLevels->logger, _traceLevels->topicCat); + out << "reaping " << subscriber->id() << " failed - not in database"; } } } diff --git a/cpp/src/IceStorm/TwowayProxy.cpp b/cpp/src/IceStorm/TwowayProxy.cpp index 24d29dc0493..bdf4cc16fa8 100644 --- a/cpp/src/IceStorm/TwowayProxy.cpp +++ b/cpp/src/IceStorm/TwowayProxy.cpp @@ -76,7 +76,7 @@ IceStorm::UnorderedTwowayProxy::deliver(const EventPtr& event) // // TODO: Use a buffer of AMI callback objects to eliminate the dynamic memory allocation? // - _obj->ice_invoke_async(new UnorderedInvokeCB(this), event->op, Ice::Idempotent, event->data, event->context); + _obj->ice_invoke_async(new UnorderedInvokeCB(this), event->op, event->mode, event->data, event->context); } class OrderedInvokeCB : public Ice::AMI_Object_ice_invoke @@ -202,6 +202,6 @@ IceStorm::OrderedTwowayProxy::deliver(const EventPtr& event) // TODO: Use a buffer of AMI callback objects to eliminate the dynamic memory allocation? (we could // actually use only 2 AMI callback objects there.) // - _obj->ice_invoke_async(new OrderedInvokeCB(this), event->op, Ice::Idempotent, event->data, event->context); + _obj->ice_invoke_async(new OrderedInvokeCB(this), event->op, event->mode, event->data, event->context); } |