summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Ice/Direct.cpp4
-rw-r--r--cpp/src/Ice/Incoming.cpp49
-rw-r--r--cpp/src/Ice/ObjectAdapterI.cpp8
-rw-r--r--cpp/src/Ice/Outgoing.cpp1
-rw-r--r--cpp/src/Ice/Proxy.cpp24
-rw-r--r--cpp/src/Ice/TraceUtil.cpp1
-rw-r--r--cpp/src/slice2cpp/Gen.cpp2
-rw-r--r--cpp/src/slice2java/Gen.cpp27
8 files changed, 54 insertions, 62 deletions
diff --git a/cpp/src/Ice/Direct.cpp b/cpp/src/Ice/Direct.cpp
index dcaf4cb6f28..37230f9d466 100644
--- a/cpp/src/Ice/Direct.cpp
+++ b/cpp/src/Ice/Direct.cpp
@@ -50,6 +50,8 @@ IceInternal::Direct::Direct(const Current& current) :
{
ObjectNotExistException ex(__FILE__, __LINE__);
ex.id = _current.id;
+ ex.facet = _current.facet;
+ ex.operation = _current.operation;
throw ex;
}
@@ -59,7 +61,9 @@ IceInternal::Direct::Direct(const Current& current) :
if(!_facetServant)
{
FacetNotExistException ex(__FILE__, __LINE__);
+ ex.id = _current.id;
ex.facet = _current.facet;
+ ex.operation = _current.operation;
throw ex;
}
}
diff --git a/cpp/src/Ice/Incoming.cpp b/cpp/src/Ice/Incoming.cpp
index ad6063d2138..0e35443abc0 100644
--- a/cpp/src/Ice/Incoming.cpp
+++ b/cpp/src/Ice/Incoming.cpp
@@ -23,12 +23,18 @@ IceInternal::Incoming::Incoming(const InstancePtr& instance, const ObjectAdapter
_os(instance)
{
_current.adapter = adapter;
- dynamic_cast<ObjectAdapterI*>(_current.adapter.get())->incUsageCount();
+ if(_current.adapter)
+ {
+ dynamic_cast<ObjectAdapterI*>(_current.adapter.get())->incUsageCount();
+ }
}
IceInternal::Incoming::~Incoming()
{
- dynamic_cast<ObjectAdapterI*>(_current.adapter.get())->decUsageCount();
+ if(_current.adapter)
+ {
+ dynamic_cast<ObjectAdapterI*>(_current.adapter.get())->decUsageCount();
+ }
}
void
@@ -80,23 +86,26 @@ IceInternal::Incoming::invoke(bool response)
try
{
- servant = _current.adapter->identityToServant(_current.id);
-
- if(!servant && !_current.id.category.empty())
+ if(_current.adapter)
{
- locator = _current.adapter->findServantLocator(_current.id.category);
- if(locator)
+ servant = _current.adapter->identityToServant(_current.id);
+
+ if(!servant && !_current.id.category.empty())
{
- servant = locator->locate(_current, cookie);
+ locator = _current.adapter->findServantLocator(_current.id.category);
+ if(locator)
+ {
+ servant = locator->locate(_current, cookie);
+ }
}
- }
-
- if(!servant)
- {
- locator = _current.adapter->findServantLocator("");
- if(locator)
+
+ if(!servant)
{
- servant = locator->locate(_current, cookie);
+ locator = _current.adapter->findServantLocator("");
+ if(locator)
+ {
+ servant = locator->locate(_current, cookie);
+ }
}
}
@@ -123,11 +132,6 @@ IceInternal::Incoming::invoke(bool response)
status = servant->__dispatch(*this, _current);
}
}
-
- if(locator && servant)
- {
- locator->finished(_current, servant, cookie);
- }
}
catch(const LocationForward& ex)
{
@@ -278,6 +282,11 @@ IceInternal::Incoming::invoke(bool response)
// the caller of this operation.
//
+ if(locator && servant)
+ {
+ locator->finished(_current, servant, cookie);
+ }
+
_is.endReadEncaps();
if(response)
diff --git a/cpp/src/Ice/ObjectAdapterI.cpp b/cpp/src/Ice/ObjectAdapterI.cpp
index e4737e66e7f..31329f20b5b 100644
--- a/cpp/src/Ice/ObjectAdapterI.cpp
+++ b/cpp/src/Ice/ObjectAdapterI.cpp
@@ -456,12 +456,8 @@ void
Ice::ObjectAdapterI::incUsageCount()
{
IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
-
- if(!_instance)
- {
- throw ObjectAdapterDeactivatedException(__FILE__, __LINE__);
- }
-
+
+ assert(_instance); // Must not be called after deactivation.
assert(_usageCount >= 0);
++_usageCount;
}
diff --git a/cpp/src/Ice/Outgoing.cpp b/cpp/src/Ice/Outgoing.cpp
index 60f99669911..09c2d4b7492 100644
--- a/cpp/src/Ice/Outgoing.cpp
+++ b/cpp/src/Ice/Outgoing.cpp
@@ -214,6 +214,7 @@ IceInternal::Outgoing::finished(BasicStream& is)
_is.swap(is);
Byte status;
_is.read(status);
+
switch(static_cast<DispatchStatus>(status))
{
case DispatchOK:
diff --git a/cpp/src/Ice/Proxy.cpp b/cpp/src/Ice/Proxy.cpp
index 27c0ad62d6a..ec4b3f25689 100644
--- a/cpp/src/Ice/Proxy.cpp
+++ b/cpp/src/Ice/Proxy.cpp
@@ -1053,7 +1053,7 @@ IceDelegateD::Ice::Object::ice_isA(const string& __id, const Context& __context)
Direct __direct(__current);
return __direct.facetServant()->ice_isA(__id, __current);
}
- return false; // To keep VC++ compiler happy.
+ return false; // To keep the Visual C++ compiler happy.
}
void
@@ -1079,7 +1079,7 @@ IceDelegateD::Ice::Object::ice_ids(const ::Ice::Context& __context)
Direct __direct(__current);
return __direct.facetServant()->ice_ids(__current);
}
- return vector<string>(); // To keep VC++ compiler happy.
+ return vector<string>(); // To keep the Visual C++ compiler happy.
}
string
@@ -1092,7 +1092,7 @@ IceDelegateD::Ice::Object::ice_id(const ::Ice::Context& __context)
Direct __direct(__current);
return __direct.facetServant()->ice_id(__current);
}
- return false; // To keep VC++ compiler happy.
+ return false; // To keep the Visual C++ compiler happy.
}
vector<string>
@@ -1105,7 +1105,7 @@ IceDelegateD::Ice::Object::ice_facets(const ::Ice::Context& __context)
Direct __direct(__current);
return __direct.facetServant()->ice_facets(__current);
}
- return vector<string>(); // To keep VC++ compiler happy.
+ return vector<string>(); // To keep the Visual C++ compiler happy.
}
bool
@@ -1120,16 +1120,18 @@ IceDelegateD::Ice::Object::ice_invoke(const string& operation,
while(true)
{
Direct __direct(current);
- Blobject* __servant = dynamic_cast<Blobject*>(__direct.facetServant().get());
- if(!__servant)
+ Blobject* servant = dynamic_cast<Blobject*>(__direct.facetServant().get());
+ if(!servant)
{
- OperationNotExistException ex(__FILE__, __LINE__);
- ex.operation = current.operation;
- throw ex;
+ OperationNotExistException opEx(__FILE__, __LINE__);
+ opEx.id = current.id;
+ opEx.facet = current.facet;
+ opEx.operation = current.operation;
+ throw opEx;
}
- return __servant->ice_invoke(inParams, outParams, current);
+ return servant->ice_invoke(inParams, outParams, current);
}
- return false; // To keep VC++ compiler happy.
+ return false; // To keep the Visual C++ compiler happy.
}
void
diff --git a/cpp/src/Ice/TraceUtil.cpp b/cpp/src/Ice/TraceUtil.cpp
index b5084a296fe..6cc0ce85001 100644
--- a/cpp/src/Ice/TraceUtil.cpp
+++ b/cpp/src/Ice/TraceUtil.cpp
@@ -191,6 +191,7 @@ IceInternal::traceRequest(const char* heading, const BasicStream& str, const ::I
{
s << " (oneway)";
}
+
printRequestHeader(s, stream);
logger->trace(tl->protocolCat, s.str());
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp
index b9a43894ccb..f2e32296300 100644
--- a/cpp/src/slice2cpp/Gen.cpp
+++ b/cpp/src/slice2cpp/Gen.cpp
@@ -1741,6 +1741,8 @@ Slice::Gen::DelegateDVisitor::visitOperation(const OperationPtr& p)
C << nl << "if(!__servant)";
C << sb;
C << nl << "::Ice::OperationNotExistException __opEx(__FILE__, __LINE__);";
+ C << nl << "__opEx.id = __current.id;";
+ C << nl << "__opEx.facet = __current.facet;";
C << nl << "__opEx.operation = __current.operation;";
C << nl << "throw __opEx;";
C << eb;
diff --git a/cpp/src/slice2java/Gen.cpp b/cpp/src/slice2java/Gen.cpp
index 47edc78d15b..16edaee1182 100644
--- a/cpp/src/slice2java/Gen.cpp
+++ b/cpp/src/slice2java/Gen.cpp
@@ -3157,11 +3157,11 @@ Slice::Gen::DelegateDVisitor::visitClassDefStart(const ClassDefPtr& p)
out << nl << "catch(ClassCastException __ex)";
out << sb;
out << nl << "Ice.OperationNotExistException __opEx = new Ice.OperationNotExistException();";
+ out << nl << "__opEx.id = __current.id;";
+ out << nl << "__opEx.facet = __current.facet;";
out << nl << "__opEx.operation = __current.operation;";
out << nl << "throw __opEx;";
out << eb;
- out << nl << "try";
- out << sb;
out << nl;
if(ret)
{
@@ -3178,34 +3178,11 @@ Slice::Gen::DelegateDVisitor::visitClassDefStart(const ClassDefPtr& p)
out << nl << "return;";
}
out << eb;
- ExceptionList::const_iterator r;
- for(r = throws.begin(); r != throws.end(); ++r)
- {
- out << nl << "catch(" << getAbsolute((*r)->scoped(), scope) << " __ex)";
- out << sb;
- out << nl << "throw __ex;";
- out << eb;
- }
- //
- // No need to catch Ice.UserException because it's not possible in Java
- //
- out << nl << "catch(Ice.LocalException __ex)";
- out << sb;
- out << nl << "throw __ex;";
- out << eb;
- out << nl << "catch(java.lang.RuntimeException __ex)";
- out << sb;
- out << nl << "Ice.UnknownException __e = new Ice.UnknownException();";
- out << nl << "__e.initCause(__ex);";
- out << nl << "throw __e;";
- out << eb;
- out << eb;
out << nl << "finally";
out << sb;
out << nl << "__direct.destroy();";
out << eb;
out << eb;
-
out << eb;
}