summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/Direct.cpp
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2009-03-02 15:23:53 -0330
committerDwayne Boone <dwayne@zeroc.com>2009-03-02 15:23:53 -0330
commit8b15e6ba73a45b5be5064cb2f866ad0654d7af18 (patch)
tree9ee591d38fb7725ab2e6ef637b46b54d1394ef33 /cpp/src/Ice/Direct.cpp
parentFix 3755 - demo/Ice/callback has context parameter? (diff)
downloadice-8b15e6ba73a45b5be5064cb2f866ad0654d7af18.tar.bz2
ice-8b15e6ba73a45b5be5064cb2f866ad0654d7af18.tar.xz
ice-8b15e6ba73a45b5be5064cb2f866ad0654d7af18.zip
C++Builder 2009 port
Diffstat (limited to 'cpp/src/Ice/Direct.cpp')
-rw-r--r--cpp/src/Ice/Direct.cpp64
1 files changed, 27 insertions, 37 deletions
diff --git a/cpp/src/Ice/Direct.cpp b/cpp/src/Ice/Direct.cpp
index 3d655a145e2..b8163bbf1c9 100644
--- a/cpp/src/Ice/Direct.cpp
+++ b/cpp/src/Ice/Direct.cpp
@@ -37,48 +37,19 @@ IceInternal::Direct::Direct(const Current& current) :
ServantManagerPtr servantManager = adapter->getServantManager();
assert(servantManager);
- try
+ _servant = servantManager->findServant(_current.id, _current.facet);
+ if(!_servant)
{
- _servant = servantManager->findServant(_current.id, _current.facet);
- if(!_servant)
+ _locator = servantManager->findServantLocator(_current.id.category);
+ if(!_locator && !_current.id.category.empty())
{
- _locator = servantManager->findServantLocator(_current.id.category);
- if(!_locator && !_current.id.category.empty())
- {
- _locator = servantManager->findServantLocator("");
- }
- if(_locator)
- {
- _servant = _locator->locate(_current, _cookie);
- }
+ _locator = servantManager->findServantLocator("");
}
- if(!_servant)
- {
- if(servantManager && servantManager->hasServant(_current.id))
- {
- FacetNotExistException ex(__FILE__, __LINE__);
- ex.id = _current.id;
- ex.facet = _current.facet;
- ex.operation = _current.operation;
- throw ex;
- }
- else
- {
- ObjectNotExistException ex(__FILE__, __LINE__);
- ex.id = _current.id;
- ex.facet = _current.facet;
- ex.operation = _current.operation;
- throw ex;
- }
- }
- }
- catch(...)
- {
- if(_locator && _servant)
+ if(_locator)
{
try
{
- _locator->finished(_current, _servant, _cookie);
+ _servant = _locator->locate(_current, _cookie);
}
catch(...)
{
@@ -86,8 +57,27 @@ IceInternal::Direct::Direct(const Current& current) :
throw;
}
}
+ }
+
+ if(!_servant)
+ {
adapter->decDirectCount();
- throw;
+ if(servantManager && servantManager->hasServant(_current.id))
+ {
+ FacetNotExistException ex(__FILE__, __LINE__);
+ ex.id = _current.id;
+ ex.facet = _current.facet;
+ ex.operation = _current.operation;
+ throw ex;
+ }
+ else
+ {
+ ObjectNotExistException ex(__FILE__, __LINE__);
+ ex.id = _current.id;
+ ex.facet = _current.facet;
+ ex.operation = _current.operation;
+ throw ex;
+ }
}
}