summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Ice/Direct.cpp2
-rw-r--r--cpp/src/Ice/Incoming.cpp2
-rw-r--r--cpp/src/Ice/Object.cpp64
-rw-r--r--cpp/src/Ice/TraceUtil.cpp5
4 files changed, 46 insertions, 27 deletions
diff --git a/cpp/src/Ice/Direct.cpp b/cpp/src/Ice/Direct.cpp
index 59d9ef67ff1..107fa061bf6 100644
--- a/cpp/src/Ice/Direct.cpp
+++ b/cpp/src/Ice/Direct.cpp
@@ -47,7 +47,7 @@ IceInternal::Direct::Direct(const ObjectAdapterPtr& adapter, const Current& curr
if(_servant && !_current.facet.empty())
{
- _facetServant = _servant->ice_findFacet(_current.facet, 0);
+ _facetServant = _servant->ice_findFacetPath(_current.facet, 0);
if(!_facetServant)
{
FacetNotExistException ex(__FILE__, __LINE__);
diff --git a/cpp/src/Ice/Incoming.cpp b/cpp/src/Ice/Incoming.cpp
index 4699e4b922f..fdd68423339 100644
--- a/cpp/src/Ice/Incoming.cpp
+++ b/cpp/src/Ice/Incoming.cpp
@@ -100,7 +100,7 @@ IceInternal::Incoming::invoke(bool response)
{
if(!current.facet.empty())
{
- ObjectPtr facetServant = servant->ice_findFacet(current.facet, 0);
+ ObjectPtr facetServant = servant->ice_findFacetPath(current.facet, 0);
if(!facetServant)
{
status = DispatchFacetNotExist;
diff --git a/cpp/src/Ice/Object.cpp b/cpp/src/Ice/Object.cpp
index c64a503760a..72e40db2a72 100644
--- a/cpp/src/Ice/Object.cpp
+++ b/cpp/src/Ice/Object.cpp
@@ -343,7 +343,38 @@ Ice::Object::ice_removeAllFacets()
}
ObjectPtr
-Ice::Object::ice_findFacet(const vector<string>& path, int start)
+Ice::Object::ice_findFacet(const string& name)
+{
+ IceUtil::Mutex::Lock sync(_activeFacetMapMutex);
+
+ map<string, ObjectPtr>::iterator p = _activeFacetMap.end();
+
+ if(_activeFacetMapHint != _activeFacetMap.end())
+ {
+ if(_activeFacetMapHint->first == name)
+ {
+ p = _activeFacetMapHint;
+ }
+ }
+
+ if(p == _activeFacetMap.end())
+ {
+ p = _activeFacetMap.find(name);
+ }
+
+ if(p != _activeFacetMap.end())
+ {
+ _activeFacetMapHint = p;
+ return p->second;
+ }
+ else
+ {
+ return 0;
+ }
+}
+
+ObjectPtr
+Ice::Object::ice_findFacetPath(const vector<string>& path, int start)
{
int sz = path.size();
@@ -357,32 +388,15 @@ Ice::Object::ice_findFacet(const vector<string>& path, int start)
return this;
}
+ ObjectPtr f = ice_findFacet(path[start]);
+ if(f)
{
- IceUtil::Mutex::Lock sync(_activeFacetMapMutex);
-
- map<string, ObjectPtr>::iterator p = _activeFacetMap.end();
-
- if(_activeFacetMapHint != _activeFacetMap.end())
- {
- if(_activeFacetMapHint->first == path[start])
- {
- p = _activeFacetMapHint;
- }
- }
-
- if(p == _activeFacetMap.end())
- {
- p = _activeFacetMap.find(path[start]);
- }
-
- if(p != _activeFacetMap.end())
- {
- _activeFacetMapHint = p;
- return p->second->ice_findFacet(path, start + 1);
- }
+ return f->ice_findFacetPath(path, start + 1);
+ }
+ else
+ {
+ return f;
}
-
- return 0;
}
DispatchStatus
diff --git a/cpp/src/Ice/TraceUtil.cpp b/cpp/src/Ice/TraceUtil.cpp
index 98243178f3a..e0675cf585a 100644
--- a/cpp/src/Ice/TraceUtil.cpp
+++ b/cpp/src/Ice/TraceUtil.cpp
@@ -297,6 +297,11 @@ IceInternal::traceReply(const char* heading, const BasicStream& str, const ::Ice
s << "(object not exist)";
break;
}
+ case DispatchFacetNotExist:
+ {
+ s << "(facet not exist)";
+ break;
+ }
case DispatchOperationNotExist:
{
s << "(operation not exist)";