summaryrefslogtreecommitdiff
path: root/TAO/tao/Synch_Invocation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/tao/Synch_Invocation.cpp')
-rw-r--r--TAO/tao/Synch_Invocation.cpp70
1 files changed, 43 insertions, 27 deletions
diff --git a/TAO/tao/Synch_Invocation.cpp b/TAO/tao/Synch_Invocation.cpp
index d1b4d7cc30d..59ed7c08ea8 100644
--- a/TAO/tao/Synch_Invocation.cpp
+++ b/TAO/tao/Synch_Invocation.cpp
@@ -70,13 +70,14 @@ namespace TAO
if (s != TAO_INVOKE_SUCCESS)
return s;
-#endif /*TAO_HAS_INTERCEPTORS */
// We have started the interception flow. We need to call the
// ending interception flow if things go wrong. The purpose of the
// try block is to do just this.
try
{
+#endif /*TAO_HAS_INTERCEPTORS */
+
TAO_OutputCDR &cdr = this->resolver_.transport ()->out_stream ();
cdr.message_attributes (this->details_.request_id (),
@@ -131,7 +132,7 @@ namespace TAO
if (tmp != TAO_INVOKE_SUCCESS)
s = tmp;
}
-#endif /*TAO_HAS_INTERCEPTORS */
+#endif /* TAO_HAS_INTERCEPTORS */
if (s != TAO_INVOKE_SUCCESS)
return s;
@@ -177,7 +178,7 @@ namespace TAO
if (tmp != TAO_INVOKE_SUCCESS)
s = tmp;
}
-#endif /*TAO_HAS_INTERCEPTORS */
+#endif /* TAO_HAS_INTERCEPTORS */
if (s != TAO_INVOKE_SUCCESS)
return s;
@@ -186,8 +187,7 @@ namespace TAO
// the return value? That would be bogus as per the contract
// in the interface. The call violated the contract
- s = this->check_reply_status (rd
- );
+ s = this->check_reply_status (rd);
// For some strategies one may want to release the transport
// back to cache after receiving the reply.
@@ -206,14 +206,9 @@ namespace TAO
}
if (tmp != TAO_INVOKE_SUCCESS)
s = tmp;
-#endif /*TAO_HAS_INTERCEPTORS */
-
- if (s != TAO_INVOKE_SUCCESS)
- return s;
}
catch ( ::CORBA::Exception& ex)
{
-#if TAO_HAS_INTERCEPTORS == 1
PortableInterceptor::ReplyStatus const status =
this->handle_any_exception (&ex);
@@ -222,11 +217,23 @@ namespace TAO
s = TAO_INVOKE_RESTART;
else if (status == PortableInterceptor::SYSTEM_EXCEPTION
|| status == PortableInterceptor::USER_EXCEPTION)
-#else
- ACE_UNUSED_ARG (ex);
-#endif /*TAO_HAS_INTERCEPTORS*/
throw;
}
+ catch (...)
+ {
+ // Notify interceptors of non-CORBA exception, and propagate
+ // that exception to the caller.
+
+ PortableInterceptor::ReplyStatus const st =
+ this->handle_all_exception ();
+
+ if (st == PortableInterceptor::LOCATION_FORWARD ||
+ st == PortableInterceptor::TRANSPORT_RETRY)
+ s = TAO_INVOKE_RESTART;
+ else
+ throw;
+ }
+#endif /* TAO_HAS_INTERCEPTORS */
return s;
}
@@ -650,7 +657,7 @@ namespace TAO
{
ACE_Countdown_Time countdown (max_wait_time);
- const CORBA::Octet response_flags = this->details_.response_flags ();
+ CORBA::Octet const response_flags = this->details_.response_flags ();
Invocation_Status s = TAO_INVOKE_FAILURE;
@@ -670,15 +677,15 @@ namespace TAO
if (s != TAO_INVOKE_SUCCESS)
return s;
+
+ try
+ {
#endif /*TAO_HAS_INTERCEPTORS */
- TAO_Transport* transport =
- this->resolver_.transport ();
+ TAO_Transport* const transport = this->resolver_.transport ();
- TAO_OutputCDR &cdr = transport->out_stream ();
+ TAO_OutputCDR &cdr = transport->out_stream ();
- try
- {
cdr.message_attributes (this->details_.request_id (),
this->resolver_.stub (),
TAO_Transport::TAO_ONEWAY_REQUEST,
@@ -690,7 +697,7 @@ namespace TAO
countdown.update ();
- if (transport->is_connected())
+ if (transport->is_connected ())
{
// We have a connected transport so we can send the message
s = this->send_message (cdr,
@@ -709,13 +716,10 @@ namespace TAO
}
#if TAO_HAS_INTERCEPTORS == 1
- s =
- this->receive_other_interception ();
-#endif /*TAO_HAS_INTERCEPTORS */
+ s = this->receive_other_interception ();
}
catch ( ::CORBA::Exception& ex)
{
-#if TAO_HAS_INTERCEPTORS == 1
PortableInterceptor::ReplyStatus const status =
this->handle_any_exception (&ex);
@@ -724,11 +728,23 @@ namespace TAO
s = TAO_INVOKE_RESTART;
else if (status == PortableInterceptor::SYSTEM_EXCEPTION
|| status == PortableInterceptor::USER_EXCEPTION)
-#else
- ACE_UNUSED_ARG (ex);
-#endif /*TAO_HAS_INTERCEPTORS*/
throw;
}
+ catch (...)
+ {
+ // Notify interceptors of non-CORBA exception, and propagate
+ // that exception to the caller.
+
+ PortableInterceptor::ReplyStatus const st =
+ this->handle_all_exception ();
+
+ if (st == PortableInterceptor::LOCATION_FORWARD ||
+ st == PortableInterceptor::TRANSPORT_RETRY)
+ s = TAO_INVOKE_RESTART;
+ else
+ throw;
+ }
+#endif /* TAO_HAS_INTERCEPTORS */
return s;
}