summaryrefslogtreecommitdiff
path: root/cpp/src/slice2java/Gen.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2007-12-12 18:54:19 +0100
committerBenoit Foucher <benoit@zeroc.com>2007-12-12 18:54:19 +0100
commit3dff2b82d498d2e29dc4c42c4053557e16a373d4 (patch)
tree4242da8678ce8f36e34b9d821212cf78519af415 /cpp/src/slice2java/Gen.cpp
parentMerge branch 'master' of ssh://cvs.zeroc.com/home/git/ice (diff)
downloadice-3dff2b82d498d2e29dc4c42c4053557e16a373d4.tar.bz2
ice-3dff2b82d498d2e29dc4c42c4053557e16a373d4.tar.xz
ice-3dff2b82d498d2e29dc4c42c4053557e16a373d4.zip
Fixed bug 2592
Diffstat (limited to 'cpp/src/slice2java/Gen.cpp')
-rw-r--r--cpp/src/slice2java/Gen.cpp29
1 files changed, 24 insertions, 5 deletions
diff --git a/cpp/src/slice2java/Gen.cpp b/cpp/src/slice2java/Gen.cpp
index b5f5fb267d7..e49e502d8f7 100644
--- a/cpp/src/slice2java/Gen.cpp
+++ b/cpp/src/slice2java/Gen.cpp
@@ -5025,6 +5025,7 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p)
out << sp << nl << "public final void" << nl << "__invoke" << spar << "Ice.ObjectPrx __prx"
<< paramsInvoke << contextParam << epar;
out << sb;
+ out << nl << "__acquire(__prx);";
out << nl << "try";
out << sb;
if(p->returnsData())
@@ -5045,13 +5046,12 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p)
out << nl << "__os.writePendingObjects();";
}
out << nl << "__os.endWriteEncaps();";
+ out << nl << "__send();";
out << eb;
out << nl << "catch(Ice.LocalException __ex)";
out << sb;
- out << nl << "__finished(__ex);";
- out << nl << "return;";
+ out << nl << "__release(__ex);";
out << eb;
- out << nl << "__send();";
out << eb;
out << sp << nl << "protected final void" << nl << "__response(boolean __ok)";
@@ -5096,8 +5096,7 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p)
{
out << nl << "catch(" << getAbsolute(*r, classPkg) << " __ex)";
out << sb;
- out << nl << "ice_exception(__ex);";
- out << nl << "return;";
+ out << nl << "throw __ex;";
out << eb;
}
out << nl << "catch(Ice.UserException __ex)";
@@ -5137,12 +5136,32 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p)
out << nl << "__is.readPendingObjects();";
}
out << eb;
+ if(!throws.empty())
+ {
+ out << nl << "catch(Ice.UserException __ex)";
+ out << sb;
+ out << nl << "try";
+ out << sb;
+ out << nl << "ice_exception(__ex);";
+ out << eb;
+ out << nl << "catch(java.lang.Exception ex)";
+ out << sb;
+ out << nl << "__warning(ex);";
+ out << eb;
+ out << nl << "finally";
+ out << sb;
+ out << nl << "__release();";
+ out << eb;
+ out << nl << "return;";
+ out << eb;
+ }
out << nl << "catch(Ice.LocalException __ex)";
out << sb;
out << nl << "__finished(__ex);";
out << nl << "return;";
out << eb;
out << nl << "ice_response" << spar << args << epar << ';';
+ out << nl << "__release();";
out << eb;
out << eb;