diff options
author | Marc Laukien <marc@zeroc.com> | 2001-09-27 20:54:00 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2001-09-27 20:54:00 +0000 |
commit | d331c4f5778d3287334175fdf9c8191d659fe0f5 (patch) | |
tree | e49632f032c05a734371e074c75e4e59ff908a96 /cpp/src/Ice/ObjectAdapterI.cpp | |
parent | location transparency stuff (diff) | |
download | ice-d331c4f5778d3287334175fdf9c8191d659fe0f5.tar.bz2 ice-d331c4f5778d3287334175fdf9c8191d659fe0f5.tar.xz ice-d331c4f5778d3287334175fdf9c8191d659fe0f5.zip |
more collocation stuff
Diffstat (limited to 'cpp/src/Ice/ObjectAdapterI.cpp')
-rw-r--r-- | cpp/src/Ice/ObjectAdapterI.cpp | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/cpp/src/Ice/ObjectAdapterI.cpp b/cpp/src/Ice/ObjectAdapterI.cpp index 66532312759..a889541b3e6 100644 --- a/cpp/src/Ice/ObjectAdapterI.cpp +++ b/cpp/src/Ice/ObjectAdapterI.cpp @@ -181,29 +181,8 @@ Ice::ObjectAdapterI::identityToServant(const string& ident) ObjectPtr Ice::ObjectAdapterI::proxyToServant(const ObjectPrx& proxy) { - // - // We must first check whether at least one endpoint contained in - // the proxy matches this object adapter. - // ReferencePtr ref = proxy->__reference(); - vector<EndpointPtr>::const_iterator p; - for (p = ref->endpoints.begin(); p != ref->endpoints.end(); ++p) - { - vector<CollectorFactoryPtr>::const_iterator q; - for (q = _collectorFactories.begin(); q != _collectorFactories.end(); ++q) - { - if ((*q)->equivalent(*p)) - { - // - // OK, endpoints and object adapter match. Let's find - // the object. - // - return identityToServant(ref->identity); - } - } - } - - throw WrongObjectAdapterException(__FILE__, __LINE__); + return identityToServant(ref->identity); } ObjectPrx @@ -305,3 +284,23 @@ Ice::ObjectAdapterI::newProxy(const string& ident) ReferencePtr reference = new Reference(_instance, ident, Reference::ModeTwoway, false, endpoints, endpoints); return _instance->proxyFactory()->referenceToProxy(reference); } + +bool +Ice::ObjectAdapterI::isLocal(const ObjectPrx& proxy) +{ + ReferencePtr ref = proxy->__reference(); + vector<EndpointPtr>::const_iterator p; + for (p = ref->endpoints.begin(); p != ref->endpoints.end(); ++p) + { + vector<CollectorFactoryPtr>::const_iterator q; + for (q = _collectorFactories.begin(); q != _collectorFactories.end(); ++q) + { + if ((*q)->equivalent(*p)) + { + return true; + } + } + } + + return false; +} |