summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/Proxy.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2009-12-03 21:14:59 +0100
committerBenoit Foucher <benoit@zeroc.com>2009-12-03 21:14:59 +0100
commitc5b5f38299c69bd68febb52b3559c4e653f54acb (patch)
tree76f0dffec24a8f4fff91c90f1f51299d3de68723 /cpp/src/Ice/Proxy.cpp
parentBug 4407 - Fixed C++Builder test failure (diff)
downloadice-c5b5f38299c69bd68febb52b3559c4e653f54acb.tar.bz2
ice-c5b5f38299c69bd68febb52b3559c4e653f54acb.tar.xz
ice-c5b5f38299c69bd68febb52b3559c4e653f54acb.zip
AMI requests now throw IllegalArgumentExcption instaed of TwowayOnlyException
Diffstat (limited to 'cpp/src/Ice/Proxy.cpp')
-rw-r--r--cpp/src/Ice/Proxy.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/cpp/src/Ice/Proxy.cpp b/cpp/src/Ice/Proxy.cpp
index 5b5f32ccf9d..96df0c720ac 100644
--- a/cpp/src/Ice/Proxy.cpp
+++ b/cpp/src/Ice/Proxy.cpp
@@ -151,9 +151,9 @@ IceProxy::Ice::Object::begin_ice_isA(const string& typeId,
const ::Ice::LocalObjectPtr& cookie)
{
OutgoingAsyncPtr __result = new OutgoingAsync(this, ice_isA_name, del, cookie);
+ __checkAsyncTwowayOnly(ice_isA_name);
try
{
- __checkTwowayOnly(ice_isA_name);
__result->__prepare(ice_isA_name, Normal, ctx);
IceInternal::BasicStream* __os = __result->__getOs();
__os->write(typeId);
@@ -294,9 +294,9 @@ IceProxy::Ice::Object::begin_ice_ids(const Context* ctx,
const ::Ice::LocalObjectPtr& cookie)
{
OutgoingAsyncPtr __result = new OutgoingAsync(this, ice_ids_name, del, cookie);
+ __checkAsyncTwowayOnly(ice_ids_name);
try
{
- __checkTwowayOnly(ice_ids_name);
__result->__prepare(ice_ids_name, Normal, ctx);
IceInternal::BasicStream* __os = __result->__getOs();
__os->endWriteEncaps();
@@ -338,9 +338,9 @@ IceProxy::Ice::Object::begin_ice_id(const Context* ctx,
const ::Ice::LocalObjectPtr& cookie)
{
OutgoingAsyncPtr __result = new OutgoingAsync(this, ice_id_name, del, cookie);
+ __checkAsyncTwowayOnly(ice_id_name);
try
{
- __checkTwowayOnly(ice_id_name);
__result->__prepare(ice_id_name, Normal, ctx);
IceInternal::BasicStream* __os = __result->__getOs();
__os->endWriteEncaps();
@@ -1307,6 +1307,20 @@ IceProxy::Ice::Object::__checkTwowayOnly(const string& name) const
}
void
+IceProxy::Ice::Object::__checkAsyncTwowayOnly(const string& name) const
+{
+ //
+ // No mutex lock necessary, there is nothing mutable in this operation.
+ //
+ if(!ice_isTwoway())
+ {
+ throw IceUtil::IllegalArgumentException(__FILE__,
+ __LINE__,
+ "`" + name + "' can only be called with a twoway proxy");
+ }
+}
+
+void
IceProxy::Ice::Object::__end(const ::Ice::AsyncResultPtr& __result, const std::string& operation) const
{
AsyncResult::__check(__result, this, operation);