summaryrefslogtreecommitdiff
path: root/TAO
diff options
context:
space:
mode:
Diffstat (limited to 'TAO')
-rw-r--r--TAO/tao/Asynch_Invocation.cpp25
-rw-r--r--TAO/tao/Asynch_Invocation.h85
-rw-r--r--TAO/tao/Asynch_Invocation.i36
-rw-r--r--TAO/tao/Asynch_Reply_Dispatcher.cpp111
-rw-r--r--TAO/tao/Asynch_Reply_Dispatcher.h99
-rw-r--r--TAO/tao/Asynch_Reply_Dispatcher.i23
-rw-r--r--TAO/tao/DynamicInterface/DII_Invocation.cpp94
-rw-r--r--TAO/tao/DynamicInterface/DII_Invocation.h43
-rw-r--r--TAO/tao/DynamicInterface/DII_Invocation.inl26
-rw-r--r--TAO/tao/DynamicInterface/DII_Reply_Dispatcher.cpp22
-rw-r--r--TAO/tao/DynamicInterface/DII_Reply_Dispatcher.h41
-rw-r--r--TAO/tao/DynamicInterface/DII_Reply_Dispatcher.inl26
-rw-r--r--TAO/tao/DynamicInterface/Dynamic_Adapter_Impl.cpp43
-rw-r--r--TAO/tao/DynamicInterface/Dynamic_Adapter_Impl.h11
-rw-r--r--TAO/tao/DynamicInterface/Request.cpp8
-rw-r--r--TAO/tao/DynamicInterface/TAO_DynamicInterface.dsp14
-rw-r--r--TAO/tao/Dynamic_Adapter.cpp11
-rw-r--r--TAO/tao/Dynamic_Adapter.h11
-rw-r--r--TAO/tao/Invocation.cpp790
-rw-r--r--TAO/tao/Invocation.h117
-rw-r--r--TAO/tao/Invocation.i58
-rw-r--r--TAO/tao/Reply_Dispatcher.cpp6
-rw-r--r--TAO/tao/Reply_Dispatcher.h9
-rw-r--r--TAO/tao/Reply_Dispatcher.i7
-rw-r--r--TAO/tao/Synch_Reply_Dispatcher.cpp37
-rw-r--r--TAO/tao/Synch_Reply_Dispatcher.h19
-rw-r--r--TAO/tao/Synch_Reply_Dispatcher.i8
-rw-r--r--TAO/tao/TAO.dsp4
-rw-r--r--TAO/tao/TAO_Static.dsp4
29 files changed, 787 insertions, 1001 deletions
diff --git a/TAO/tao/Asynch_Invocation.cpp b/TAO/tao/Asynch_Invocation.cpp
index 1d057a495a4..57d90272533 100644
--- a/TAO/tao/Asynch_Invocation.cpp
+++ b/TAO/tao/Asynch_Invocation.cpp
@@ -5,7 +5,9 @@
ACE_RCSID(tao, Asynch_Invocation, "$Id$")
-#if (TAO_HAS_AMI_CALLBACK == 1) || (TAO_HAS_AMI_POLLER == 1)
+#if (TAO_HAS_AMI_CALLBACK == 1) \
+ || (TAO_HAS_AMI_POLLER == 1) \
+ || (TAO_HAS_MINIMUM_CORBA == 0)
#include "tao/Timeprobe.h"
#include "tao/Stub.h"
@@ -49,22 +51,8 @@ ACE_TIMEPROBE_EVENT_DESCRIPTIONS (TAO_Asynch_Invocation_Timeprobe_Description,
#endif /* ACE_ENABLE_TIMEPROBES */
-void
-TAO_GIOP_Twoway_Asynch_Invocation::start (CORBA::Environment &ACE_TRY_ENV)
- ACE_THROW_SPEC ((CORBA::SystemException))
-{
- this->TAO_GIOP_Invocation::start (ACE_TRY_ENV);
- ACE_CHECK;
-
- this->target_spec_.target_specifier (this->profile_->object_key ());
- this->transport_->start_request (this->orb_core_,
- this->target_spec_,
- this->out_stream_,
- ACE_TRY_ENV);
-}
-
int
-TAO_GIOP_Twoway_Asynch_Invocation::invoke (CORBA::Environment &ACE_TRY_ENV)
+TAO_GIOP_Asynch_Invocation::invoke (CORBA::Environment &ACE_TRY_ENV)
ACE_THROW_SPEC ((CORBA::SystemException))
{
TAO_FUNCTION_PP_TIMEPROBE (TAO_GIOP_ASYNCH_INVOCATION_INVOKE_START);
@@ -72,6 +60,7 @@ TAO_GIOP_Twoway_Asynch_Invocation::invoke (CORBA::Environment &ACE_TRY_ENV)
return this->invoke_i (ACE_TRY_ENV);
}
+// **************************************************************************
int
TAO_GIOP_Twoway_Asynch_Invocation::invoke_i (CORBA::Environment &ACE_TRY_ENV)
@@ -107,4 +96,6 @@ TAO_GIOP_Twoway_Asynch_Invocation::invoke_i (CORBA::Environment &ACE_TRY_ENV)
return TAO_INVOKE_OK;
}
-#endif /* TAO_HAS_AMI_CALLBACK == 1 || TAO_HAS_AMI_POLLER == 1 */
+#endif /* TAO_HAS_AMI_CALLBACK == 1
+ || TAO_HAS_AMI_POLLER == 1
+ || TAO_HAS_MINIMUM_CORBA == 0 */
diff --git a/TAO/tao/Asynch_Invocation.h b/TAO/tao/Asynch_Invocation.h
index 805e7315175..45a70a524b3 100644
--- a/TAO/tao/Asynch_Invocation.h
+++ b/TAO/tao/Asynch_Invocation.h
@@ -10,8 +10,9 @@
// Encapsulate the logic for remote Asynchronous Invocations.
//
// = AUTHOR
-// Carlos O'Ryan <coryan@cs.wustl.edu> and Alexander Babu Arulanthu
-// <alex@cs.wustl.edu>
+// Carlos O'Ryan <coryan@cs.wustl.edu>,
+// Alexander Babu Arulanthu <alex@cs.wustl.edu>
+// Jeff Parsons <parsons@cs.wustl.edu>
//
// ============================================================================
@@ -25,65 +26,81 @@
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
-#if (TAO_HAS_AMI_CALLBACK == 1) || (TAO_HAS_AMI_POLLER == 1)
+#if (TAO_HAS_AMI_CALLBACK == 1) \
+ || (TAO_HAS_AMI_POLLER == 1) \
+ || (TAO_HAS_MINIMUM_CORBA == 0)
#include "tao/MessagingC.h"
#include "tao/Asynch_Reply_Dispatcher.h"
-class TAO_Export TAO_GIOP_Twoway_Asynch_Invocation : public TAO_GIOP_Invocation
+class TAO_Export TAO_GIOP_Asynch_Invocation
+ : public TAO_GIOP_Invocation
{
// = TITLE
- // Sends a two-way request does not expect the reply.
+ // TAO_Asynch_Invocation.
//
// = DESCRIPTION
- // This class connects (or lookups a connection from the cache) to
- // the remote server, builds the CDR stream for the Request, send
- // the CDR stream and returns.
+ // Base class for TAO_GIOP_Twoway_Asynch_Invocation and
+ // TAO_GIOP_DII_Deferred_Invocation.
//
public:
- TAO_GIOP_Twoway_Asynch_Invocation (TAO_Stub *data,
- const char *operation,
- CORBA::ULong opname_len_,
- TAO_ORB_Core* orb_core,
- const TAO_Reply_Handler_Skeleton &reply_handler_skel,
- Messaging::ReplyHandler_ptr reply_handler_ptr);
+ TAO_GIOP_Asynch_Invocation (TAO_Stub *stub,
+ const char *operation,
+ CORBA::ULong opname_len,
+ TAO_ORB_Core *orb_core);
// Constructor.
- void start (CORBA_Environment &TAO_IN_ENV =
- TAO_default_environment ())
+ virtual int invoke (CORBA_Environment &TAO_IN_ENV =
+ TAO_default_environment ())
ACE_THROW_SPEC ((CORBA::SystemException));
- // Calls TAO_GIOP_Asynch_Invocation::start.
+ // Send request, without blocking until any reply comes back.
- int invoke (CORBA_Environment &TAO_IN_ENV =
- TAO_default_environment ())
- ACE_THROW_SPEC ((CORBA::SystemException));
- // Send request, block until any reply comes back, and unmarshal
- // reply parameters as appropriate.
+protected:
+ virtual int invoke_i (CORBA::Environment &ACE_TRY_ENV)
+ ACE_THROW_SPEC ((CORBA::SystemException)) = 0;
+ // Must be overridden.
+ TAO_Asynch_Reply_Dispatcher_Base *rd_;
+ // Reply dispatcher for the current asynchronous invocation.
+};
- // TAO_InputCDR &inp_stream (void);
- // // Return the underlying input stream.
+class TAO_Export TAO_GIOP_Twoway_Asynch_Invocation
+ : public TAO_GIOP_Asynch_Invocation
+{
+ // = TITLE
+ // TAO_GIOP_Twoway_Asynch_Invocation.
//
+ // = DESCRIPTION
+ // Sends a two-way request does not expect the reply.
+ // This class connects (or lookups a connection from the cache) to
+ // the remote server, builds the CDR stream for the Request, send
+ // the CDR stream and returns.
+ //
+public:
+ TAO_GIOP_Twoway_Asynch_Invocation (
+ TAO_Stub *stub,
+ const char *operation,
+ CORBA::ULong opname_len_,
+ TAO_ORB_Core* orb_core,
+ const TAO_Reply_Handler_Skeleton &reply_handler_skel,
+ Messaging::ReplyHandler_ptr reply_handler_ptr
+ );
+ // Constructor.
- const IOP::ServiceContextList& reply_service_info (void) const;
- // Accessor to the reply ServiceContextList.
-
-private:
- int invoke_i (CORBA::Environment &ACE_TRY_ENV)
+protected:
+ virtual int invoke_i (CORBA::Environment &ACE_TRY_ENV)
ACE_THROW_SPEC ((CORBA::SystemException));
// Implementation of the invoke() methods, handles the basic
// send/reply code and the system exceptions.
-
-private:
- TAO_Asynch_Reply_Dispatcher *rd_;
- // Reply dispatcher for the current synchronous Asynch_Invocation.
};
#if defined (__ACE_INLINE__)
# include "tao/Asynch_Invocation.i"
#endif /* __ACE_INLINE__ */
-#endif /* TAO_HAS_AMI_CALLBACK == 1 || TAO_HAS_AMI_POLLER == 1 */
+#endif /* TAO_HAS_AMI_CALLBACK == 1
+ || TAO_HAS_AMI_POLLER == 1
+ || TAO_HAS_MINIMUM_CORBA == 0 */
#include "ace/post.h"
#endif /* TAO_ASYNCH_INVOCATION_H */
diff --git a/TAO/tao/Asynch_Invocation.i b/TAO/tao/Asynch_Invocation.i
index e4d3fa79e05..503151f0cf0 100644
--- a/TAO/tao/Asynch_Invocation.i
+++ b/TAO/tao/Asynch_Invocation.i
@@ -3,30 +3,44 @@
// $Id$
//
-#if (TAO_HAS_AMI_CALLBACK == 1) || (TAO_HAS_AMI_POLLER == 1)
-
ACE_INLINE
-TAO_GIOP_Twoway_Asynch_Invocation::
-TAO_GIOP_Twoway_Asynch_Invocation (TAO_Stub *stub,
- const char *operation,
- CORBA::ULong opname_len,
- TAO_ORB_Core *orb_core,
- const TAO_Reply_Handler_Skeleton &reply_handler_skel,
- Messaging::ReplyHandler_ptr reply_handler_ptr)
+TAO_GIOP_Asynch_Invocation::TAO_GIOP_Asynch_Invocation (
+ TAO_Stub *stub,
+ const char *operation,
+ CORBA::ULong opname_len,
+ TAO_ORB_Core *orb_core
+ )
: TAO_GIOP_Invocation (stub,
operation,
opname_len,
orb_core),
rd_ (0)
{
+}
+
+// ********************************************************************
+
+ACE_INLINE
+TAO_GIOP_Twoway_Asynch_Invocation::TAO_GIOP_Twoway_Asynch_Invocation (
+ TAO_Stub *stub,
+ const char *operation,
+ CORBA::ULong opname_len,
+ TAO_ORB_Core *orb_core,
+ const TAO_Reply_Handler_Skeleton &reply_handler_skel,
+ Messaging::ReplyHandler_ptr reply_handler_ptr
+ )
+ : TAO_GIOP_Asynch_Invocation (stub,
+ operation,
+ opname_len,
+ orb_core)
+{
// New reply dispatcher on the heap, because
// we will go out of scope and hand over the
// reply dispatcher to the ORB.
// So this->rd_ is 0, because we do not need to
// hold a pointer to it.
- ACE_NEW (rd_,
+ ACE_NEW (this->rd_,
TAO_Asynch_Reply_Dispatcher (reply_handler_skel,
reply_handler_ptr));
}
-#endif /* TAO_HAS_AMI_CALLBACK == 1 || TAO_HAS_AMI_POLLER == 1 */
diff --git a/TAO/tao/Asynch_Reply_Dispatcher.cpp b/TAO/tao/Asynch_Reply_Dispatcher.cpp
index ecb576bce9c..3be259008bb 100644
--- a/TAO/tao/Asynch_Reply_Dispatcher.cpp
+++ b/TAO/tao/Asynch_Reply_Dispatcher.cpp
@@ -5,8 +5,6 @@
ACE_RCSID(tao, Asynch_Reply_Dispatcher, "$Id$")
-#if (TAO_HAS_AMI_CALLBACK == 1) || (TAO_HAS_AMI_POLLER == 1)
-
#include "tao/GIOP_Message_State.h"
#include "tao/ORB_Core.h"
#include "tao/Leader_Follower.h"
@@ -16,48 +14,102 @@ ACE_RCSID(tao, Asynch_Reply_Dispatcher, "$Id$")
#include "tao/Asynch_Reply_Dispatcher.i"
#endif /* __ACE_INLINE__ */
+#if (TAO_HAS_AMI_CALLBACK == 1) \
+ || (TAO_HAS_AMI_POLLER == 1) \
+ || (TAO_HAS_MINIMUM_CORBA == 0)
+
// Constructor.
-TAO_Asynch_Reply_Dispatcher::
- TAO_Asynch_Reply_Dispatcher (const TAO_Reply_Handler_Skeleton &reply_handler_skel,
- Messaging::ReplyHandler_ptr reply_handler)
- : reply_status_ (100), // Something really vague
- message_state_ (0),
- reply_handler_skel_ (reply_handler_skel),
- reply_handler_ (Messaging::ReplyHandler::_duplicate (reply_handler)),
- transport_ (0)
+TAO_Asynch_Reply_Dispatcher_Base::TAO_Asynch_Reply_Dispatcher_Base (void)
+ : message_state_ (0),
+ transport_ (0)
{
}
// Destructor.
-TAO_Asynch_Reply_Dispatcher::~TAO_Asynch_Reply_Dispatcher (void)
+TAO_Asynch_Reply_Dispatcher_Base::~TAO_Asynch_Reply_Dispatcher_Base (void)
{
if (this->transport_ != 0)
- this->transport_->idle_after_reply ();
+ {
+ this->transport_->idle_after_reply ();
+ }
+}
+
+// Must override pure virtual method in TAO_Reply_Dispatcher.
+int
+TAO_Asynch_Reply_Dispatcher_Base::dispatch_reply (
+ CORBA::ULong reply_status,
+ const TAO_GIOP_Version & /* version */,
+ IOP::ServiceContextList &reply_ctx,
+ TAO_GIOP_Message_State *message_state
+ )
+{
+ return 0;
+}
+
+TAO_GIOP_Message_State *
+TAO_Asynch_Reply_Dispatcher_Base::message_state (void)
+{
+ return this->message_state_;
+}
+
+void
+TAO_Asynch_Reply_Dispatcher_Base::dispatcher_bound (TAO_Transport *)
+{
+}
+
+void
+TAO_Asynch_Reply_Dispatcher_Base::connection_closed (void)
+{
+}
+
+#endif /* (TAO_HAS_AMI_CALLBACK == 1) \
+ || (TAO_HAS_AMI_POLLER == 1) \
+ || (TAO_HAS_MINIMUM_CORBA == 0) */
+
+// ************************************************************************
+
+#if (TAO_HAS_AMI_CALLBACK == 1) || (TAO_HAS_AMI_POLLER == 1)
+
+// Constructor.
+TAO_Asynch_Reply_Dispatcher::TAO_Asynch_Reply_Dispatcher (
+ const TAO_Reply_Handler_Skeleton &reply_handler_skel,
+ Messaging::ReplyHandler_ptr reply_handler
+ )
+ : reply_handler_skel_ (reply_handler_skel),
+ reply_handler_ (Messaging::ReplyHandler::_duplicate (reply_handler))
+{
+}
+
+// Destructor.
+TAO_Asynch_Reply_Dispatcher::~TAO_Asynch_Reply_Dispatcher (void)
+{
}
// Dispatch the reply.
int
-TAO_Asynch_Reply_Dispatcher::dispatch_reply (CORBA::ULong reply_status,
- const TAO_GIOP_Version & /*version*/,
- IOP::ServiceContextList &reply_ctx,
- TAO_GIOP_Message_State *message_state)
+TAO_Asynch_Reply_Dispatcher::dispatch_reply (
+ CORBA::ULong reply_status,
+ const TAO_GIOP_Version & /* version */,
+ IOP::ServiceContextList &reply_ctx,
+ TAO_GIOP_Message_State *message_state
+ )
{
this->reply_status_ = reply_status;
- // this->version_ = version;
this->message_state_ = message_state;
// Steal the buffer, that way we don't do any unnecesary copies of
// this data.
CORBA::ULong max = reply_ctx.maximum ();
CORBA::ULong len = reply_ctx.length ();
- IOP::ServiceContext* context_list = reply_ctx.get_buffer (1);
+ IOP::ServiceContext *context_list = reply_ctx.get_buffer (1);
this->reply_service_info_.replace (max, len, context_list, 1);
if (TAO_debug_level >= 4)
{
ACE_DEBUG ((LM_DEBUG,
- "(%P | %t):TAO_Asynch_Reply_Dispatcher::dispatch_reply:\n"));
+ ACE_TEXT ("(%P | %t):TAO_Asynch_Reply_Dispatcher::")
+ ACE_TEXT ("dispatch_reply:\n")));
}
CORBA::ULong reply_error = TAO_AMI_REPLY_NOT_OK;
@@ -106,17 +158,6 @@ TAO_Asynch_Reply_Dispatcher::dispatch_reply (CORBA::ULong reply_status,
return 1;
}
-TAO_GIOP_Message_State *
-TAO_Asynch_Reply_Dispatcher::message_state (void)
-{
- return this->message_state_;
-}
-
-void
-TAO_Asynch_Reply_Dispatcher::dispatcher_bound (TAO_Transport*)
-{
-}
-
void
TAO_Asynch_Reply_Dispatcher::connection_closed (void)
{
@@ -124,9 +165,13 @@ TAO_Asynch_Reply_Dispatcher::connection_closed (void)
{
// Generate a fake exception....
CORBA::COMM_FAILURE comm_failure (0, CORBA::COMPLETED_MAYBE);
+
TAO_OutputCDR out_cdr;
+
comm_failure._tao_encode (out_cdr, ACE_TRY_ENV);
+
ACE_TRY_CHECK;
+
// Turn into an output CDR
TAO_InputCDR cdr (out_cdr);
@@ -139,8 +184,10 @@ TAO_Asynch_Reply_Dispatcher::connection_closed (void)
ACE_CATCHANY
{
if (TAO_debug_level >= 4)
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
- "Asynch_Reply_Dispacher::connection_closed");
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Asynch_Reply_Dispacher::connection_closed");
+ }
}
ACE_ENDTRY;
diff --git a/TAO/tao/Asynch_Reply_Dispatcher.h b/TAO/tao/Asynch_Reply_Dispatcher.h
index a1187904428..bb6eba5d147 100644
--- a/TAO/tao/Asynch_Reply_Dispatcher.h
+++ b/TAO/tao/Asynch_Reply_Dispatcher.h
@@ -25,81 +25,106 @@
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
-// *********************************************************************
-
-#if (TAO_HAS_AMI_CALLBACK == 1) || (TAO_HAS_AMI_POLLER == 1)
-
#include "tao/Reply_Dispatcher.h"
#include "tao/MessagingC.h"
-class TAO_Export TAO_Asynch_Reply_Dispatcher : public TAO_Reply_Dispatcher
+#if (TAO_HAS_AMI_CALLBACK == 1) \
+ || (TAO_HAS_AMI_POLLER == 1) \
+ || (TAO_HAS_MINIMUM_CORBA == 0)
+
+class TAO_Export TAO_Asynch_Reply_Dispatcher_Base
+ : public TAO_Reply_Dispatcher
{
// = TITLE
- //
- // Reply dispatcher for Asynchoronous Method Invocation (AMI)s.
+ // TAO_Asynch_Reply_Dispatcher_Base
//
// = DESCRIPTION
- //
-
+ // Base class for TAO_Asynch_Reply_Dispatcher and
+ // TAO_DII_Deferred_Reply_Dispatcher.
public:
- TAO_Asynch_Reply_Dispatcher (const TAO_Reply_Handler_Skeleton &reply_handler_skel,
- Messaging::ReplyHandler_ptr reply_handler_ptr);
- // Constructor.
+ TAO_Asynch_Reply_Dispatcher_Base (void);
+ // Default constructor.
- virtual ~TAO_Asynch_Reply_Dispatcher (void);
+ virtual ~TAO_Asynch_Reply_Dispatcher_Base (void);
// Destructor.
- CORBA::ULong reply_status (void) const;
- // Get the reply status.
-
- const TAO_GIOP_Version& version (void) const;
- // Get the GIOP version
-
void transport (TAO_Transport *t);
// Sets the transport for this invocation.
// = The Reply Dispatcher methods
virtual int dispatch_reply (CORBA::ULong reply_status,
- const TAO_GIOP_Version& version,
- IOP::ServiceContextList& reply_ctx,
- TAO_GIOP_Message_State* message_state);
+ const TAO_GIOP_Version &version,
+ IOP::ServiceContextList &reply_ctx,
+ TAO_GIOP_Message_State *message_state);
+
virtual TAO_GIOP_Message_State *message_state (void);
+
virtual void dispatcher_bound (TAO_Transport *t);
+
virtual void connection_closed (void);
protected:
IOP::ServiceContextList reply_service_info_;
- // The service context list
+ // The service context list.
// Note, that this is not a reference as in
// the synchronous case. We own the reply_service_info
- // because our TAO_Asynch_Invocation will go out
- // of scope before we are done.
-
-private:
- CORBA::ULong reply_status_;
- // Reply or LocateReply status.
-
- // TAO_GIOP_Version version_;
- // The version
+ // because our TAO_Asynch_Invocation or TAO_DII_Deferred_Invocation
+ // will go out of scope before we are done.
TAO_GIOP_Message_State *message_state_;
// CDR stream for reading the input.
+ TAO_Transport *transport_;
+ // This invocation is using this transport, may change...
+};
+
+#endif /* (TAO_HAS_AMI_CALLBACK == 1) \
+ || (TAO_HAS_AMI_POLLER == 1) \
+ || (TAO_HAS_MINIMUM_CORBA == 0) */
+
+// *********************************************************************
+
+#if (TAO_HAS_AMI_CALLBACK == 1) || (TAO_HAS_AMI_POLLER == 1)
+
+class TAO_Export TAO_Asynch_Reply_Dispatcher
+ : public TAO_Asynch_Reply_Dispatcher_Base
+{
+ // = TITLE
+ // TAO_Asynch_Reply_Dispatcher
+ //
+ // = DESCRIPTION
+ // Reply dispatcher for Asynchoronous Method Invocation (AMI)s.
+public:
+ TAO_Asynch_Reply_Dispatcher (
+ const TAO_Reply_Handler_Skeleton &reply_handler_skel,
+ Messaging::ReplyHandler_ptr reply_handler_ptr
+ );
+ // Constructor.
+
+ virtual ~TAO_Asynch_Reply_Dispatcher (void);
+ // Destructor.
+
+ // = The Reply Dispatcher methods
+ virtual int dispatch_reply (CORBA::ULong reply_status,
+ const TAO_GIOP_Version &version,
+ IOP::ServiceContextList &reply_ctx,
+ TAO_GIOP_Message_State *message_state);
+
+ virtual void connection_closed (void);
+
+private:
const TAO_Reply_Handler_Skeleton reply_handler_skel_;
// Skeleton for the call back method in the Reply Handler.
Messaging::ReplyHandler_var reply_handler_;
// Reply Handler passed in the Asynchronous Invocation.
-
- TAO_Transport *transport_;
- // This invocation is using this transport, may change...
};
+#endif /* TAO_HAS_AMI_CALLBACK == 1 || TAO_HAS_AMI_POLLER == 1 */
+
#if defined (__ACE_INLINE__)
#include "tao/Asynch_Reply_Dispatcher.i"
#endif /* __ACE_INLINE__ */
-#endif /* TAO_HAS_AMI_CALLBACK == 1 || TAO_HAS_AMI_POLLER == 1 */
-
#include "ace/post.h"
#endif /* TAO_ASYNCH_REPLY_DISPATCHER_H */
diff --git a/TAO/tao/Asynch_Reply_Dispatcher.i b/TAO/tao/Asynch_Reply_Dispatcher.i
index ede940e4e63..3e002fac8bd 100644
--- a/TAO/tao/Asynch_Reply_Dispatcher.i
+++ b/TAO/tao/Asynch_Reply_Dispatcher.i
@@ -1,21 +1,16 @@
// $Id$
+#if (TAO_HAS_AMI_CALLBACK == 1) \
+ || (TAO_HAS_AMI_POLLER == 1) \
+ || (TAO_HAS_MINIMUM_CORBA == 0)
-ACE_INLINE CORBA::ULong
-TAO_Asynch_Reply_Dispatcher::reply_status (void) const
-{
- return this->reply_status_;
-}
-
-#if 0
-ACE_INLINE const TAO_GIOP_Version &
-TAO_Asynch_Reply_Dispatcher::version (void) const
-{
- return this->version_;
-}
-#endif /*if 0*/
ACE_INLINE void
-TAO_Asynch_Reply_Dispatcher::transport (TAO_Transport *t)
+TAO_Asynch_Reply_Dispatcher_Base::transport (TAO_Transport *t)
{
this->transport_ = t;
}
+
+#endif /* (TAO_HAS_AMI_CALLBACK == 1) \
+ || (TAO_HAS_AMI_POLLER == 1) \
+ || (TAO_HAS_MINIMUM_CORBA == 0) */
+
diff --git a/TAO/tao/DynamicInterface/DII_Invocation.cpp b/TAO/tao/DynamicInterface/DII_Invocation.cpp
index 297005d2f48..585dfdbd173 100644
--- a/TAO/tao/DynamicInterface/DII_Invocation.cpp
+++ b/TAO/tao/DynamicInterface/DII_Invocation.cpp
@@ -17,21 +17,91 @@ ACE_RCSID(DynamicInterface, DII_Invocation, "$Id$")
# include "DII_Invocation.inl"
#endif /* ! __ACE_INLINE__ */
-void
-TAO_GIOP_DII_Deferred_Invocation::start (CORBA::Environment &ACE_TRY_ENV)
- ACE_THROW_SPEC ((CORBA::SystemException))
+int
+TAO_GIOP_DII_Invocation::invoke (CORBA::ExceptionList_ptr exceptions,
+ CORBA::Environment &ACE_TRY_ENV)
+ ACE_THROW_SPEC ((CORBA::SystemException, CORBA::UnknownUserException))
{
- this->TAO_GIOP_Invocation::start (ACE_TRY_ENV);
- ACE_CHECK;
-
- this->target_spec_.target_specifier (this->profile_->object_key ());
- this->transport_->start_request (this->orb_core_,
- this->target_spec_,
- this->out_stream_,
- ACE_TRY_ENV);
- ACE_CHECK;
+ int retval = this->invoke_i (0,
+ ACE_TRY_ENV);
+ ACE_CHECK_RETURN (retval);
+
+ // A TAO_INVOKE_EXCEPTION status, but no exception raised means that
+ // we have a user exception.
+ // @@ This is a bit brittle, think about a better implementation.
+ if (retval == TAO_INVOKE_EXCEPTION)
+ {
+ // Match the exception interface repository id with the
+ // exception in the exception list.
+ // This is important to decode the exception.
+
+ CORBA::String_var buf;
+
+ TAO_InputCDR tmp_stream (this->inp_stream (),
+ this->inp_stream ().start ()->length (),
+ 0);
+
+ // Pull the exception ID out of the marshaling buffer.
+ if (tmp_stream.read_string (buf.inout ()) == 0)
+ {
+ ACE_THROW_RETURN (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE,
+ CORBA::COMPLETED_YES),
+ TAO_INVOKE_EXCEPTION);
+ }
+
+ for (CORBA::ULong i = 0;
+ exceptions != 0 && i < exceptions->count ();
+ i++)
+ {
+ CORBA::TypeCode_ptr tcp = exceptions->item (i,
+ ACE_TRY_ENV);
+ ACE_CHECK_RETURN (TAO_INVOKE_EXCEPTION);
+
+ const char *xid = tcp->id (ACE_TRY_ENV);
+ ACE_CHECK_RETURN (TAO_INVOKE_EXCEPTION);
+
+ if (ACE_OS::strcmp (buf.in (), xid) != 0)
+ {
+ continue;
+ }
+
+ const ACE_Message_Block* cdr = this->inp_stream ().start ();
+
+ CORBA_Any any (tcp,
+ 0,
+ this->inp_stream ().byte_order (),
+ cdr);
+
+ CORBA_Exception *exception = 0;
+
+ ACE_NEW_THROW_EX (exception,
+ CORBA_UnknownUserException (any),
+ CORBA::NO_MEMORY (TAO_DEFAULT_MINOR_CODE,
+ CORBA::COMPLETED_YES));
+ ACE_CHECK_RETURN (TAO_INVOKE_EXCEPTION);
+
+ // @@ Think about a better way to raise the exception here,
+ // maybe we need some more macros?
+ ACE_TRY_ENV.exception (exception); // We can not use ACE_THROW here.
+ return TAO_INVOKE_EXCEPTION;
+ }
+
+ // If we couldn't find the right exception, report it as
+ // CORBA::UNKNOWN.
+
+ // @@ It would seem that if the remote exception is a
+ // UserException we can assume that the request was
+ // completed.
+ ACE_THROW_RETURN (CORBA::UNKNOWN (TAO_DEFAULT_MINOR_CODE,
+ CORBA::COMPLETED_YES),
+ TAO_INVOKE_EXCEPTION);
+ }
+
+ return retval;
}
+//***************************************************************************
+
int
TAO_GIOP_DII_Deferred_Invocation::invoke (CORBA::Environment &ACE_TRY_ENV)
ACE_THROW_SPEC ((CORBA::SystemException))
diff --git a/TAO/tao/DynamicInterface/DII_Invocation.h b/TAO/tao/DynamicInterface/DII_Invocation.h
index 3c9bc21e96e..f2d64e79199 100644
--- a/TAO/tao/DynamicInterface/DII_Invocation.h
+++ b/TAO/tao/DynamicInterface/DII_Invocation.h
@@ -11,8 +11,9 @@
// The DII invocation classes.
//
// = AUTHOR
-// Carlos O'Ryan <coryan@cs.wustl.edu> and Alexander Babu Arulanthu
-// <alex@cs.wustl.edu>
+// Carlos O'Ryan <coryan@cs.wustl.edu>
+// Alexander Babu Arulanthu <alex@cs.wustl.edu>
+// Jeff Parsons <parsons@cs.wustl.edu>
//
// ============================================================================
@@ -31,14 +32,40 @@
#include "DII_Reply_Dispatcher.h"
#include "Request.h"
+class TAO_GIOP_DII_Invocation : public TAO_GIOP_Twoway_Invocation
+{
+ // = TITLE
+ // Sends a two-way request using DII.
+ //
+ // = DESCRIPTION
+ // This class replaces just one method - invoke - of its base
+ // class with one of a slightly different signature. The class
+ // is not exported because it is only instantiated by
+ // CORBA::Request in this library.
+ //
+public:
+ TAO_GIOP_DII_Invocation (TAO_Stub *data,
+ const char *operation,
+ CORBA::ULong opname_len,
+ TAO_ORB_Core *orb_core);
+ // Constructor.
+
+ int invoke (CORBA::ExceptionList_ptr exceptions,
+ CORBA_Environment &ACE_TRY_ENV =
+ TAO_default_environment ())
+ ACE_THROW_SPEC ((CORBA::SystemException,CORBA::UnknownUserException));
+ // Send request, block until any reply comes back, and unmarshal
+ // reply parameters as appropriate.
+};
+
class TAO_DynamicInterface_Export TAO_GIOP_DII_Deferred_Invocation
: public TAO_GIOP_Invocation
{
// = TITLE
- // Sends a two-way request does not expect the reply.
+ // Sends a two-way request using DII and does not wait for a reply.
//
// = DESCRIPTION
- // This class connects (or lookups a connection from the cache) to
+ // This class connects (or looks up a connection from the cache) to
// the remote server, builds the CDR stream for the Request, send
// the CDR stream and returns.
//
@@ -48,20 +75,12 @@ public:
const CORBA::Request_ptr req);
// Constructor.
- void start (CORBA_Environment &TAO_IN_ENV =
- TAO_default_environment ())
- ACE_THROW_SPEC ((CORBA::SystemException));
- // Calls TAO_GIOP_Asynch_Invocation::start.
-
int invoke (CORBA_Environment &TAO_IN_ENV =
TAO_default_environment ())
ACE_THROW_SPEC ((CORBA::SystemException));
// Send request, block until any reply comes back, and unmarshal
// reply parameters as appropriate.
- const IOP::ServiceContextList& reply_service_info (void) const;
- // Accessor to the reply ServiceContextList.
-
private:
int invoke_i (CORBA::Environment &ACE_TRY_ENV)
ACE_THROW_SPEC ((CORBA::SystemException));
diff --git a/TAO/tao/DynamicInterface/DII_Invocation.inl b/TAO/tao/DynamicInterface/DII_Invocation.inl
index 70a21a36a73..36df85f8e81 100644
--- a/TAO/tao/DynamicInterface/DII_Invocation.inl
+++ b/TAO/tao/DynamicInterface/DII_Invocation.inl
@@ -4,21 +4,33 @@
//
ACE_INLINE
-TAO_GIOP_DII_Deferred_Invocation::
-TAO_GIOP_DII_Deferred_Invocation (TAO_Stub *stub,
- TAO_ORB_Core *orb_core,
- const CORBA::Request_ptr req)
+TAO_GIOP_DII_Invocation::TAO_GIOP_DII_Invocation (TAO_Stub *data,
+ const char *operation,
+ CORBA::ULong opname_len,
+ TAO_ORB_Core *orb_core)
+ : TAO_GIOP_Twoway_Invocation (data,
+ operation,
+ opname_len,
+ orb_core)
+{
+}
+
+ACE_INLINE
+TAO_GIOP_DII_Deferred_Invocation::TAO_GIOP_DII_Deferred_Invocation (
+ TAO_Stub *stub,
+ TAO_ORB_Core *orb_core,
+ const CORBA::Request_ptr req
+ )
: TAO_GIOP_Invocation (stub,
req->operation (),
ACE_OS::strlen (req->operation ()),
- orb_core),
- rd_ (0)
+ orb_core)
{
// New reply dispatcher on the heap, because
// we will go out of scope and hand over the
// reply dispatcher to the ORB.
// So this->rd_ is 0, because we do not need to
// hold a pointer to it.
- ACE_NEW (rd_,
+ ACE_NEW (this->rd_,
TAO_DII_Deferred_Reply_Dispatcher (req));
}
diff --git a/TAO/tao/DynamicInterface/DII_Reply_Dispatcher.cpp b/TAO/tao/DynamicInterface/DII_Reply_Dispatcher.cpp
index b945b665327..8fb5e6031f1 100644
--- a/TAO/tao/DynamicInterface/DII_Reply_Dispatcher.cpp
+++ b/TAO/tao/DynamicInterface/DII_Reply_Dispatcher.cpp
@@ -13,24 +13,15 @@ ACE_RCSID(DynamicInterface, DII_Reply_Dispatcher, "$Id$")
#include "tao/GIOP_Message_State.h"
#include "tao/debug.h"
-#if !defined (__ACE_INLINE__)
-#include "DII_Reply_Dispatcher.inl"
-#endif /* __ACE_INLINE__ */
-
// Constructor.
TAO_DII_Deferred_Reply_Dispatcher::TAO_DII_Deferred_Reply_Dispatcher (const CORBA::Request_ptr req)
- : req_ (req),
- transport_ (0)
+ : req_ (req)
{
}
// Destructor.
TAO_DII_Deferred_Reply_Dispatcher::~TAO_DII_Deferred_Reply_Dispatcher (void)
{
- if (this->transport_ != 0)
- {
- this->transport_->idle_after_reply ();
- }
}
// Dispatch the reply.
@@ -83,17 +74,6 @@ TAO_DII_Deferred_Reply_Dispatcher::dispatch_reply (
return 1;
}
-TAO_GIOP_Message_State *
-TAO_DII_Deferred_Reply_Dispatcher::message_state (void)
-{
- return this->message_state_;
-}
-
-void
-TAO_DII_Deferred_Reply_Dispatcher::dispatcher_bound (TAO_Transport*)
-{
-}
-
void
TAO_DII_Deferred_Reply_Dispatcher::connection_closed (void)
{
diff --git a/TAO/tao/DynamicInterface/DII_Reply_Dispatcher.h b/TAO/tao/DynamicInterface/DII_Reply_Dispatcher.h
index c28e9a4a890..c76d19448b2 100644
--- a/TAO/tao/DynamicInterface/DII_Reply_Dispatcher.h
+++ b/TAO/tao/DynamicInterface/DII_Reply_Dispatcher.h
@@ -28,10 +28,10 @@
#if (TAO_HAS_MINIMUM_CORBA == 0)
#include "dynamicinterface_export.h"
-#include "tao/Reply_Dispatcher.h"
+#include "tao/Asynch_Reply_Dispatcher.h"
class TAO_DynamicInterface_Export TAO_DII_Deferred_Reply_Dispatcher
- : public TAO_Reply_Dispatcher
+ : public TAO_Asynch_Reply_Dispatcher_Base
{
// = TITLE
// TAO_DII_Deferred_Reply_Dispatcher
@@ -46,52 +46,19 @@ public:
virtual ~TAO_DII_Deferred_Reply_Dispatcher (void);
// Destructor.
- CORBA::ULong reply_status (void) const;
- // Get the reply status.
-
- const TAO_GIOP_Version& version (void) const;
- // Get the GIOP version
-
- void transport (TAO_Transport *t);
- // Sets the transport for this invocation.
-
// = The Reply_Dispatcher methods
virtual int dispatch_reply (CORBA::ULong reply_status,
const TAO_GIOP_Version& version,
IOP::ServiceContextList& reply_ctx,
- TAO_GIOP_Message_State* message_state);
- virtual TAO_GIOP_Message_State *message_state (void);
- virtual void dispatcher_bound (TAO_Transport*);
- virtual void connection_closed (void);
+ TAO_GIOP_Message_State *message_state);
-protected:
- IOP::ServiceContextList reply_service_info_;
- // The service context list
- // Note, that this is not a reference as in
- // the synchronous case. We own the reply_service_info
- // because our TAO_Asynch_Invocation will go out
- // of scope before we are done.
+ virtual void connection_closed (void);
private:
- CORBA::ULong reply_status_;
- // Reply or LocateReply status.
-
- TAO_GIOP_Message_State *message_state_;
- // CDR stream for reading the input.
- // @@ Carlos : message_state should go away. All we need is the reply
- // cdr. Is that right? (Alex).
-
const CORBA::Request_ptr req_;
// Where the reply needs to go.
-
- TAO_Transport *transport_;
- // This invocation is using this transport, may change...
};
-#if defined (__ACE_INLINE__)
-# include "DII_Reply_Dispatcher.inl"
-#endif /* __ACE_INLINE__ */
-
#endif /* TAO_HAS_MINIMUM_CORBA */
#include "ace/post.h"
#endif /* TAO_REPLY_DISPATCHER_H */
diff --git a/TAO/tao/DynamicInterface/DII_Reply_Dispatcher.inl b/TAO/tao/DynamicInterface/DII_Reply_Dispatcher.inl
deleted file mode 100644
index d1b661944c4..00000000000
--- a/TAO/tao/DynamicInterface/DII_Reply_Dispatcher.inl
+++ /dev/null
@@ -1,26 +0,0 @@
-// $Id$
-
-#if (TAO_HAS_MINIMUM_CORBA == 0)
-
-ACE_INLINE CORBA::ULong
-TAO_DII_Deferred_Reply_Dispatcher::reply_status (void) const
-{
- return this->reply_status_;
-}
-
-#if 0
-ACE_INLINE const TAO_GIOP_Version&
-TAO_DII_Deferred_Reply_Dispatcher::version (void) const
-{
- return this->version_;
-}
-
-#endif /*If 0 */
-
-ACE_INLINE void
-TAO_DII_Deferred_Reply_Dispatcher::transport (TAO_Transport *t)
-{
- this->transport_ = t;
-}
-
-#endif /* TAO_HAS_MINIMUM_CORBA */
diff --git a/TAO/tao/DynamicInterface/Dynamic_Adapter_Impl.cpp b/TAO/tao/DynamicInterface/Dynamic_Adapter_Impl.cpp
index bca16588048..966a2a04072 100644
--- a/TAO/tao/DynamicInterface/Dynamic_Adapter_Impl.cpp
+++ b/TAO/tao/DynamicInterface/Dynamic_Adapter_Impl.cpp
@@ -135,49 +135,6 @@ TAO_Dynamic_Adapter_Impl::create_exception_list (
));
}
-CORBA::Exception *
-TAO_Dynamic_Adapter_Impl::decode_user_exception (
- CORBA::ExceptionList_ptr exceptions,
- TAO_GIOP_Twoway_Invocation *invocation,
- const char *buf,
- CORBA::Environment &ACE_TRY_ENV
- )
-{
- for (CORBA::ULong i = 0;
- exceptions != 0 && i < exceptions->count ();
- i++)
- {
- CORBA::TypeCode_ptr tcp = exceptions->item (i,
- ACE_TRY_ENV);
- ACE_CHECK_RETURN (0);
-
- const char *xid = tcp->id (ACE_TRY_ENV);
- ACE_CHECK_RETURN (0);
-
- if (ACE_OS::strcmp (buf, xid) != 0)
- {
- continue;
- }
-
- const ACE_Message_Block *cdr = invocation->inp_stream ().start ();
-
- CORBA_Any any (tcp,
- 0,
- invocation->inp_stream ().byte_order (),
- cdr);
-
- CORBA_Exception *exception = 0;
-
- ACE_NEW_RETURN (exception,
- CORBA_UnknownUserException (any),
- 0);
-
- return exception;
- }
-
- return 0;
-}
-
int
TAO_Dynamic_Adapter_Impl::Initializer (void)
{
diff --git a/TAO/tao/DynamicInterface/Dynamic_Adapter_Impl.h b/TAO/tao/DynamicInterface/Dynamic_Adapter_Impl.h
index ddf5b4225f0..79fbe3c4e2a 100644
--- a/TAO/tao/DynamicInterface/Dynamic_Adapter_Impl.h
+++ b/TAO/tao/DynamicInterface/Dynamic_Adapter_Impl.h
@@ -87,17 +87,6 @@ public:
CORBA_Environment &ACE_TRY_ENV =
TAO_default_environment ());
- // Decoding the user exception in the DII version of
- // TAO_GIOP_Twoway_Invocation::invoke().
-
- virtual CORBA::Exception *decode_user_exception (
- CORBA::ExceptionList_ptr exceptions,
- TAO_GIOP_Twoway_Invocation *invocation,
- const char *buf,
- CORBA::Environment &ACE_TRY_ENV =
- TAO_default_environment ()
- );
-
// Used to force the initialization of the ORB code.
static int Initializer (void);
};
diff --git a/TAO/tao/DynamicInterface/Request.cpp b/TAO/tao/DynamicInterface/Request.cpp
index 1d5af62d3fe..bb4090eee6a 100644
--- a/TAO/tao/DynamicInterface/Request.cpp
+++ b/TAO/tao/DynamicInterface/Request.cpp
@@ -133,10 +133,10 @@ CORBA_Request::~CORBA_Request (void)
void
CORBA_Request::invoke (CORBA::Environment &ACE_TRY_ENV)
{
- TAO_GIOP_Twoway_Invocation call (this->target_->_stubobj (),
- this->opname_,
- ACE_OS::strlen (this->opname_),
- this->orb_->orb_core ());
+ TAO_GIOP_DII_Invocation call (this->target_->_stubobj (),
+ this->opname_,
+ ACE_OS::strlen (this->opname_),
+ this->orb_->orb_core ());
// Loop as needed for forwarding.
for (;;)
diff --git a/TAO/tao/DynamicInterface/TAO_DynamicInterface.dsp b/TAO/tao/DynamicInterface/TAO_DynamicInterface.dsp
index 9e8050b9e9f..c80bca29864 100644
--- a/TAO/tao/DynamicInterface/TAO_DynamicInterface.dsp
+++ b/TAO/tao/DynamicInterface/TAO_DynamicInterface.dsp
@@ -232,27 +232,23 @@ SOURCE=.\Server_Request.h
# PROP Default_Filter "i"
# Begin Source File
-SOURCE=.\Context.i
+SOURCE=.\Context.inl
# End Source File
# Begin Source File
-SOURCE=.\DII_Invocation.i
+SOURCE=.\DII_Invocation.inl
# End Source File
# Begin Source File
-SOURCE=.\DII_Reply_Dispatcher.i
+SOURCE=.\ExceptionList.inl
# End Source File
# Begin Source File
-SOURCE=.\ExceptionList.i
+SOURCE=.\Request.inl
# End Source File
# Begin Source File
-SOURCE=.\Request.i
-# End Source File
-# Begin Source File
-
-SOURCE=.\Server_Request.i
+SOURCE=.\Server_Request.inl
# End Source File
# End Group
# End Target
diff --git a/TAO/tao/Dynamic_Adapter.cpp b/TAO/tao/Dynamic_Adapter.cpp
index a6645c06917..4646d8dd856 100644
--- a/TAO/tao/Dynamic_Adapter.cpp
+++ b/TAO/tao/Dynamic_Adapter.cpp
@@ -77,17 +77,6 @@ TAO_Dynamic_Adapter::create_exception_list (CORBA::ExceptionList_ptr &,
{
}
-CORBA::Exception *
-TAO_Dynamic_Adapter::decode_user_exception (
- CORBA::ExceptionList_ptr,
- TAO_GIOP_Twoway_Invocation *,
- const char *,
- CORBA::Environment &
- )
-{
- return 0;
-}
-
// ***********************************************************************
// Implementation of the CORBA::is_nil and CORBA::release methods for
diff --git a/TAO/tao/Dynamic_Adapter.h b/TAO/tao/Dynamic_Adapter.h
index 7a3de6f7b5d..9bc0299e583 100644
--- a/TAO/tao/Dynamic_Adapter.h
+++ b/TAO/tao/Dynamic_Adapter.h
@@ -81,17 +81,6 @@ public:
virtual void create_exception_list (CORBA::ExceptionList_ptr &,
CORBA_Environment &);
-
- // Decoding the user exception in the DII version of
- // TAO_GIOP_Twoway_Invocation::invoke().
-
- virtual CORBA::Exception *decode_user_exception (
- CORBA::ExceptionList_ptr exceptions,
- TAO_GIOP_Twoway_Invocation *invocation,
- const char *buf,
- CORBA::Environment &ACE_TRY_ENV =
- TAO_default_environment ()
- );
};
#endif /* TAO_HAS_MINIMUM_CORBA */
diff --git a/TAO/tao/Invocation.cpp b/TAO/tao/Invocation.cpp
index c20891dfdfb..b1cbeeae92a 100644
--- a/TAO/tao/Invocation.cpp
+++ b/TAO/tao/Invocation.cpp
@@ -79,10 +79,12 @@ ACE_TIMEPROBE_EVENT_DESCRIPTIONS (TAO_Invocation_Timeprobe_Description,
TAO_GIOP_Invocation::TAO_GIOP_Invocation (TAO_Stub *stub,
const char *operation,
CORBA::ULong opname_len,
- TAO_ORB_Core* orb_core)
+ TAO_ORB_Core *orb_core)
: stub_ (stub),
- op_details_ (operation, opname_len),
- out_stream_ (buffer, sizeof buffer, /* ACE_CDR::DEFAULT_BUFSIZE */
+ op_details_ (operation,
+ opname_len),
+ out_stream_ (buffer,
+ sizeof buffer, /* ACE_CDR::DEFAULT_BUFSIZE */
TAO_ENCAP_BYTE_ORDER,
orb_core->output_cdr_buffer_allocator (),
orb_core->output_cdr_dblock_allocator (),
@@ -139,11 +141,13 @@ TAO_GIOP_Invocation::start (CORBA::Environment &ACE_TRY_ENV)
// assert (this->stub_ != 0);
if (this->stub_ == 0)
- ACE_THROW (CORBA::INTERNAL (
- CORBA_SystemException::_tao_minor_code (
- TAO_DEFAULT_MINOR_CODE,
- EINVAL),
- CORBA::COMPLETED_NO));
+ {
+ ACE_THROW (CORBA::INTERNAL (
+ CORBA_SystemException::_tao_minor_code (
+ TAO_DEFAULT_MINOR_CODE,
+ EINVAL),
+ CORBA::COMPLETED_NO));
+ }
// Get a pointer to the connector registry, which might be in
// thread-specific storage, depending on the concurrency model.
@@ -151,11 +155,13 @@ TAO_GIOP_Invocation::start (CORBA::Environment &ACE_TRY_ENV)
this->orb_core_->connector_registry ();
if (conn_reg == 0)
- ACE_THROW (CORBA::INTERNAL (
- CORBA_SystemException::_tao_minor_code (
- TAO_DEFAULT_MINOR_CODE,
- EINVAL),
- CORBA::COMPLETED_NO));
+ {
+ ACE_THROW (CORBA::INTERNAL (
+ CORBA_SystemException::_tao_minor_code (
+ TAO_DEFAULT_MINOR_CODE,
+ EINVAL),
+ CORBA::COMPLETED_NO));
+ }
// Initialize endpoint selection strategy.
if (!this->is_selector_initialized_)
@@ -173,7 +179,9 @@ TAO_GIOP_Invocation::start (CORBA::Environment &ACE_TRY_ENV)
has_timeout,
this->max_wait_time_value_);
if (has_timeout)
- this->max_wait_time_ = &this->max_wait_time_value_;
+ {
+ this->max_wait_time_ = &this->max_wait_time_value_;
+ }
}
ACE_Countdown_Time countdown (this->max_wait_time_);
@@ -192,13 +200,16 @@ TAO_GIOP_Invocation::start (CORBA::Environment &ACE_TRY_ENV)
{
// If loaded services have nothing to say on
// profile/endpoint selection, let the strategy do the work.
- this->endpoint_selector_->select_endpoint (this, ACE_TRY_ENV);
+ this->endpoint_selector_->select_endpoint (this,
+ ACE_TRY_ENV);
ACE_CHECK;
}
// Get the transport object.
if (this->transport_ != 0)
- this->transport_->idle ();
+ {
+ this->transport_->idle ();
+ }
// Obtain a connection.
int result = conn_reg->connect (this->endpoint_,
@@ -246,6 +257,9 @@ TAO_GIOP_Invocation::start (CORBA::Environment &ACE_TRY_ENV)
// Obtain unique request id from the RMS.
this->op_details_.request_id (
this->transport_->tms ()->request_id ());
+
+ // Make sure that you have the right object key
+ this->target_spec_.target_specifier (this->profile_->object_key ());
}
void
@@ -274,14 +288,15 @@ TAO_GIOP_Invocation::prepare_header (CORBA::Octet response_flags,
this->target_spec_.target_specifier (
this->profile_->object_key ());
}
- else if (this->stub_->addressing_mode () ==
- TAO_Target_Specification::Profile_Addr)
+ else if (this->stub_->addressing_mode ()
+ == TAO_Target_Specification::Profile_Addr)
{
this->target_spec_.target_specifier (
- this->profile_->create_tagged_profile ());
+ this->profile_->create_tagged_profile ()
+ );
}
- else if (this->stub_->addressing_mode () ==
- TAO_Target_Specification::Reference_Addr)
+ else if (this->stub_->addressing_mode ()
+ == TAO_Target_Specification::Reference_Addr)
{
// We need to call the method seperately. If there is no
// IOP::IOR info, the call would create the info and return the
@@ -299,8 +314,11 @@ TAO_GIOP_Invocation::prepare_header (CORBA::Octet response_flags,
// Send the request for the header
if (this->transport_->send_request_header (this->op_details_,
this->target_spec_,
- this->out_stream_) == 0)
- ACE_THROW (CORBA::MARSHAL ());
+ this->out_stream_)
+ == 0)
+ {
+ ACE_THROW (CORBA::MARSHAL ());
+ }
}
@@ -313,8 +331,10 @@ TAO_GIOP_Invocation::invoke (CORBA::Boolean is_roundtrip,
ACE_Countdown_Time countdown (this->max_wait_time_);
if (this->transport_ == 0)
- ACE_THROW_RETURN (CORBA::INTERNAL (),
- TAO_INVOKE_EXCEPTION);
+ {
+ ACE_THROW_RETURN (CORBA::INTERNAL (),
+ TAO_INVOKE_EXCEPTION);
+ }
// @@ Alex: the <is_roundtrip> flag will be tricky when we move to
// AMI: now it is used both to indicate the the CORBA request in
@@ -417,16 +437,20 @@ TAO_GIOP_Invocation::location_forward (TAO_InputCDR &inp_stream,
CORBA::Object_var object = 0;
if ( (inp_stream >> object.inout ()) == 0)
+ {
ACE_THROW_RETURN (CORBA::MARSHAL (),
TAO_INVOKE_EXCEPTION);
+ }
// The object pointer has to be changed to a TAO_Stub pointer
// in order to obtain the profiles.
TAO_Stub *stubobj = object->_stubobj ();
if (stubobj == 0)
- ACE_THROW_RETURN (CORBA::INTERNAL (),
- TAO_INVOKE_EXCEPTION);
+ {
+ ACE_THROW_RETURN (CORBA::INTERNAL (),
+ TAO_INVOKE_EXCEPTION);
+ }
// Modify the state as appropriate to include new forwarding profiles.
this->endpoint_selector_->forward (this,
@@ -442,8 +466,7 @@ CORBA::ULong
TAO_GIOP_Invocation::create_ior_info (void)
{
// Get the list of profiles
- const TAO_MProfile &mprofile =
- this->stub_->base_profiles ();
+ const TAO_MProfile &mprofile = this->stub_->base_profiles ();
if (this->ior_info_.profiles.length () == 0)
{
@@ -465,15 +488,11 @@ TAO_GIOP_Invocation::create_ior_info (void)
// Call the create_tagged_profile one every member of the
// profile and make the sequence
- for (CORBA::ULong index = 0;
- index < count;
- ++index)
+ for (CORBA::ULong index = 0; index < count; ++index)
{
- TAO_Profile *prof =
- multi_prof->get_profile (index);
+ TAO_Profile *prof = multi_prof->get_profile (index);
- this->ior_info_.profiles[index] =
- prof->create_tagged_profile ();
+ this->ior_info_.profiles[index] = prof->create_tagged_profile ();
}
delete multi_prof;
@@ -483,8 +502,7 @@ TAO_GIOP_Invocation::create_ior_info (void)
}
void
-TAO_GIOP_Invocation::add_rt_service_context (CORBA_Environment
- &ACE_TRY_ENV)
+TAO_GIOP_Invocation::add_rt_service_context (CORBA_Environment &ACE_TRY_ENV)
{
// RTCORBA-specific processing.
// If invocation target supports RTCORBA::CLIENT_PROPAGATED priority
@@ -496,7 +514,9 @@ TAO_GIOP_Invocation::add_rt_service_context (CORBA_Environment
// This function may get called multiple times, but we only need to
// perform the processing once.
if (this->rt_context_initialized_)
- return;
+ {
+ return;
+ }
if (this->endpoint_selection_state_.priority_model_policy_)
{
@@ -512,8 +532,7 @@ TAO_GIOP_Invocation::add_rt_service_context (CORBA_Environment
== 0)
ACE_THROW (CORBA::MARSHAL ());
- IOP::ServiceContextList &context_list =
- this->service_info ();
+ IOP::ServiceContextList &context_list = this->service_info ();
CORBA::ULong l = context_list.length ();
context_list.length (l + 1);
@@ -528,7 +547,9 @@ TAO_GIOP_Invocation::add_rt_service_context (CORBA_Environment
i != 0;
i = i->cont ())
{
- ACE_OS::memcpy (buf, i->rd_ptr (), i->length ());
+ ACE_OS::memcpy (buf,
+ i->rd_ptr (),
+ i->length ());
buf += i->length ();
}
}
@@ -549,187 +570,17 @@ TAO_GIOP_Invocation::add_rt_service_context (CORBA_Environment
// ****************************************************************
-TAO_GIOP_Twoway_Invocation::~TAO_GIOP_Twoway_Invocation (void)
+TAO_GIOP_Synch_Invocation::~TAO_GIOP_Synch_Invocation (void)
{
if (this->transport_ != 0)
- this->transport_->idle_after_reply ();
-}
-
-void
-TAO_GIOP_Twoway_Invocation::start (CORBA::Environment &ACE_TRY_ENV)
- ACE_THROW_SPEC ((CORBA::SystemException))
-{
- this->TAO_GIOP_Invocation::start (ACE_TRY_ENV);
- ACE_CHECK;
-
- this->target_spec_.target_specifier (this->profile_->object_key ());
- this->transport_->start_request (this->orb_core_,
- this->target_spec_,
- this->out_stream_,
- ACE_TRY_ENV);
- ACE_CHECK;
- this->rd_.reply_received () = 0;
-}
-
-#if (TAO_HAS_MINIMUM_CORBA == 0)
-
-int
-TAO_GIOP_Twoway_Invocation::invoke (CORBA::ExceptionList_ptr exceptions,
- CORBA::Environment &ACE_TRY_ENV)
- ACE_THROW_SPEC ((CORBA::SystemException, CORBA::UnknownUserException))
-{
- TAO_FUNCTION_PP_TIMEPROBE (TAO_GIOP_INVOCATION_INVOKE_START);
-
- int retval = this->invoke_i (ACE_TRY_ENV);
- ACE_CHECK_RETURN (retval);
-
- // A TAO_INVOKE_EXCEPTION status, but no exception raised means that
- // we have a user exception.
- // @@ This is a bit brittle, think about a better implementation.
- if (retval == TAO_INVOKE_EXCEPTION)
{
- // Match the exception interface repository id with the
- // exception in the exception list.
- // This is important to decode the exception.
-
- CORBA::String_var buf;
-
- TAO_InputCDR tmp_stream (this->inp_stream (),
- this->inp_stream ().start ()->length (),
- 0);
-
- // Pull the exception ID out of the marshaling buffer.
- if (tmp_stream.read_string (buf.inout ()) == 0)
- {
- ACE_THROW_RETURN (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE,
- CORBA::COMPLETED_YES),
- TAO_INVOKE_EXCEPTION);
- }
-
- TAO_Dynamic_Adapter *dynamic_adapter =
- ACE_Dynamic_Service<TAO_Dynamic_Adapter>::instance ("Dynamic_Adapter");
-
- CORBA_Exception *decoded_exception =
- dynamic_adapter->decode_user_exception (exceptions,
- this,
- buf.in (),
- ACE_TRY_ENV);
- ACE_CHECK_RETURN (TAO_INVOKE_EXCEPTION);
-
- if (decoded_exception != 0)
- {
- // @@ Think about a better way to raise the exception here,
- // maybe we need some more macros?
-
- // We can not use ACE_THROW here.
- ACE_TRY_ENV.exception (decoded_exception);
- return TAO_INVOKE_EXCEPTION;
- }
- else
- {
- // If we couldn't find the right exception, report it as
- // CORBA::UNKNOWN.
-
- // @@ It would seem like if the remote exception is a
- // UserException we can assume that the request was
- // completed.
- ACE_THROW_RETURN (CORBA::UNKNOWN (TAO_DEFAULT_MINOR_CODE,
- CORBA::COMPLETED_YES),
- TAO_INVOKE_EXCEPTION);
- }
+ this->transport_->idle_after_reply ();
}
-
- return retval;
}
-#endif /* TAO_HAS_MINIMUM_CORBA == 0 */
-
-// Send request, block until any reply comes back, and unmarshal reply
-// parameters as appropriate.
-//
-// This is used by the generated stubs.
-
int
-TAO_GIOP_Twoway_Invocation::invoke (TAO_Exception_Data *excepts,
- CORBA::ULong except_count,
- CORBA::Environment &ACE_TRY_ENV)
- ACE_THROW_SPEC ((CORBA::Exception))
-{
- TAO_FUNCTION_PP_TIMEPROBE (TAO_GIOP_INVOCATION_INVOKE_START);
-
- int retval = this->invoke_i (ACE_TRY_ENV);
- ACE_CHECK_RETURN (retval);
-
- // A TAO_INVOKE_EXCEPTION status, but no exception raised means that
- // we have a user exception.
- // @@ This is a bit brittle, think about a better implementation.
- if (retval == TAO_INVOKE_EXCEPTION)
- {
- // Match the exception interface repository id with the
- // exception in the exception list.
- // This is important to decode the exception.
-
- CORBA::String_var buf;
-
- // Pull the exception ID out of the marshaling buffer.
- if (this->inp_stream ().read_string (buf.inout ()) == 0)
- {
- // @@ Why do we close the connection. Only the request
- // failed, but the connection seems to be still
- // valid!
- // this->transport_->close_connection ();
- ACE_THROW_RETURN (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE,
- CORBA::COMPLETED_YES),
- TAO_INVOKE_EXCEPTION);
- }
-
- for (CORBA::ULong i = 0;
- i < except_count;
- i++)
- {
- CORBA::TypeCode_ptr tcp = excepts[i].tc;
- const char *xid = tcp->id (ACE_TRY_ENV);
- ACE_CHECK_RETURN (TAO_INVOKE_EXCEPTION);
-
- if (ACE_OS::strcmp (buf.in (), xid) != 0)
- continue;
-
- // match
- CORBA::Exception *exception = excepts[i].alloc ();
-
- if (exception == 0)
- ACE_THROW_RETURN (CORBA::NO_MEMORY (TAO_DEFAULT_MINOR_CODE,
- CORBA::COMPLETED_YES),
- TAO_INVOKE_EXCEPTION);
-
- exception->_tao_decode (this->inp_stream (),
- ACE_TRY_ENV);
- ACE_CHECK_RETURN (TAO_INVOKE_EXCEPTION);
-
- if (TAO_debug_level > 5)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("TAO: (%P|%t) Raising exception %s\n"),
- buf.in ()));
-
- // @@ Think about a better way to raise the exception here,
- // maybe we need some more macros?
- ACE_TRY_ENV.exception (exception); // We can not use ACE_THROW here.
- return TAO_INVOKE_EXCEPTION;
- }
-
- // If we couldn't find the right exception, report it as
- // CORBA::UNKNOWN.
-
- ACE_THROW_RETURN (CORBA::UNKNOWN (TAO_DEFAULT_MINOR_CODE,
- CORBA::COMPLETED_YES),
- TAO_INVOKE_EXCEPTION);
- }
-
- return retval;
-}
-
-int
-TAO_GIOP_Twoway_Invocation::invoke_i (CORBA::Environment &ACE_TRY_ENV)
+TAO_GIOP_Synch_Invocation::invoke_i (CORBA::Boolean is_locate_request,
+ CORBA::Environment &ACE_TRY_ENV)
ACE_THROW_SPEC ((CORBA::SystemException))
{
// Register a reply dispatcher for this invocation. Use the
@@ -739,10 +590,10 @@ TAO_GIOP_Twoway_Invocation::invoke_i (CORBA::Environment &ACE_TRY_ENV)
TAO_Transport_Mux_Strategy *tms = this->transport_->tms ();
- TAO_Bind_Dispatcher_Guard dispatch_guard(this->op_details_.request_id(),
- &this->rd_,
- tms);
- int retval = dispatch_guard.status();
+ TAO_Bind_Dispatcher_Guard dispatch_guard (this->op_details_.request_id(),
+ &this->rd_,
+ tms);
+ int retval = dispatch_guard.status ();
if (retval == -1)
{
@@ -755,11 +606,14 @@ TAO_GIOP_Twoway_Invocation::invoke_i (CORBA::Environment &ACE_TRY_ENV)
}
// Just send the request, without trying to wait for the reply.
- retval = TAO_GIOP_Invocation::invoke (1, ACE_TRY_ENV);
+ retval = TAO_GIOP_Invocation::invoke (1,
+ ACE_TRY_ENV);
ACE_CHECK_RETURN (retval);
if (retval != TAO_INVOKE_OK)
- return retval;
+ {
+ return retval;
+ }
// This blocks until the response is read. In the current version,
// there is only one client thread that ever uses this connection,
@@ -788,8 +642,7 @@ TAO_GIOP_Twoway_Invocation::invoke_i (CORBA::Environment &ACE_TRY_ENV)
if (TAO_debug_level > 0 && this->max_wait_time_ != 0)
{
- CORBA::ULong msecs =
- this->max_wait_time_->msec ();
+ CORBA::ULong msecs = this->max_wait_time_->msec ();
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("TAO (%P|%t) Timeout on recv is <%u>\n"),
@@ -803,19 +656,19 @@ TAO_GIOP_Twoway_Invocation::invoke_i (CORBA::Environment &ACE_TRY_ENV)
if (TAO_debug_level > 0 && this->max_wait_time_ != 0)
{
- CORBA::ULong msecs =
- this->max_wait_time_->msec ();
+ CORBA::ULong msecs = this->max_wait_time_->msec ();
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("TAO (%P|%t) Timeout after recv is <%u> status <%d>\n"),
- msecs, reply_error));
+ msecs,
+ reply_error));
}
// Check the reply error.
if (reply_error == -1)
{
- // The guard automatically unbinds the dispatcher
+ // The guard automatically unbinds the dispatcher.
if (errno == ETIME)
{
// Just a timeout, don't close the connection or
@@ -847,6 +700,14 @@ TAO_GIOP_Twoway_Invocation::invoke_i (CORBA::Environment &ACE_TRY_ENV)
CORBA::ULong reply_status = this->rd_.reply_status ();
+ if (is_locate_request)
+ {
+ // A locate request checks a different set of enum return values,
+ // so we return to the TAO_GIOP_Locate_Request_Invocation caller
+ // to do that.
+ return reply_status;
+ }
+
switch (reply_status)
{
case TAO_PLUGGABLE_MESSAGE_NO_EXCEPTION:
@@ -854,8 +715,8 @@ TAO_GIOP_Twoway_Invocation::invoke_i (CORBA::Environment &ACE_TRY_ENV)
return TAO_INVOKE_OK;
case TAO_PLUGGABLE_MESSAGE_USER_EXCEPTION:
- // Return so the exception can be handled.
- return TAO_INVOKE_EXCEPTION;
+ // Return so the exception can be handled.
+ return TAO_INVOKE_EXCEPTION;
case TAO_PLUGGABLE_MESSAGE_SYSTEM_EXCEPTION:
{
@@ -877,9 +738,11 @@ TAO_GIOP_Twoway_Invocation::invoke_i (CORBA::Environment &ACE_TRY_ENV)
if ((this->inp_stream () >> minor) == 0
|| (this->inp_stream () >> completion) == 0)
- ACE_THROW_RETURN (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE,
- CORBA::COMPLETED_MAYBE),
- TAO_INVOKE_OK);
+ {
+ ACE_THROW_RETURN (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE,
+ CORBA::COMPLETED_MAYBE),
+ TAO_INVOKE_OK);
+ }
CORBA::SystemException* ex =
TAO_Exceptions::create_system_exception (type_id.in (),
@@ -911,7 +774,8 @@ TAO_GIOP_Twoway_Invocation::invoke_i (CORBA::Environment &ACE_TRY_ENV)
case TAO_PLUGGABLE_MESSAGE_LOCATION_FORWARD:
// Handle the forwarding and return so the stub restarts the
// request!
- return this->location_forward (this->inp_stream (), ACE_TRY_ENV);
+ return this->location_forward (this->inp_stream (),
+ ACE_TRY_ENV);
case TAO_PLUGGABLE_MESSAGE_NEEDS_ADDRESSING_MODE:
{
// We have received an exception with a request to change the
@@ -942,392 +806,236 @@ TAO_GIOP_Twoway_Invocation::invoke_i (CORBA::Environment &ACE_TRY_ENV)
// ****************************************************************
-TAO_GIOP_Oneway_Invocation::
-TAO_GIOP_Oneway_Invocation (TAO_Stub *stub,
- const char *operation,
- CORBA::ULong opname_len,
- TAO_ORB_Core *orb_core)
- : TAO_GIOP_Invocation (stub, operation, opname_len, orb_core),
- sync_scope_ (TAO::SYNC_WITH_TRANSPORT)
-{
- int has_synchronization = 0;
- int scope = 0;
- this->orb_core_->call_sync_scope_hook (this->stub_,
- has_synchronization,
- scope);
-
- this->sync_scope_ = scope;
-}
-
-TAO_GIOP_Oneway_Invocation::~TAO_GIOP_Oneway_Invocation (void)
-{
- if (this->transport_ != 0)
- this->transport_->idle_after_reply ();
-}
-
void
-TAO_GIOP_Oneway_Invocation::start (CORBA::Environment &ACE_TRY_ENV)
+TAO_GIOP_Twoway_Invocation::start (CORBA_Environment &ACE_TRY_ENV)
ACE_THROW_SPEC ((CORBA::SystemException))
{
- this->TAO_GIOP_Invocation::start (ACE_TRY_ENV);
+ TAO_GIOP_Invocation::start (ACE_TRY_ENV);
ACE_CHECK;
- // Make sure that you have the right object key
- this->target_spec_.target_specifier (this->profile_->object_key ());
-
this->transport_->start_request (this->orb_core_,
this->target_spec_,
this->out_stream_,
ACE_TRY_ENV);
}
+// Send request, block until any reply comes back, and unmarshal reply
+// parameters as appropriate.
+
int
-TAO_GIOP_Oneway_Invocation::invoke (CORBA::Environment &ACE_TRY_ENV)
- ACE_THROW_SPEC ((CORBA::SystemException))
+TAO_GIOP_Twoway_Invocation::invoke (TAO_Exception_Data *excepts,
+ CORBA::ULong except_count,
+ CORBA::Environment &ACE_TRY_ENV)
+ ACE_THROW_SPEC ((CORBA::Exception))
{
- if (this->sync_scope_ == TAO::SYNC_WITH_TRANSPORT ||
- this->sync_scope_ == TAO::SYNC_NONE ||
- this->sync_scope_ == TAO::SYNC_EAGER_BUFFERING ||
- this->sync_scope_ == TAO::SYNC_DELAYED_BUFFERING)
- {
- return TAO_GIOP_Invocation::invoke (0,
- ACE_TRY_ENV);
- }
-
- // Create this only if a reply is required.
- TAO_Synch_Reply_Dispatcher rd (this->orb_core_,
- this->op_details_.service_info ());
-
- // The rest of this function is very similar to
- // TWO_GIOP_Twoway_Invocation::invoke_i, because we must
- // wait for a reply. See comments in that code.
- // @@ Jeff: is it possible to factor out this code into a common
- // case class or something? In fact, what is the difference between
- // the two classes now?
- TAO_Transport_Mux_Strategy *tms = this->transport_->tms ();
+ TAO_FUNCTION_PP_TIMEPROBE (TAO_GIOP_INVOCATION_INVOKE_START);
- TAO_Bind_Dispatcher_Guard dispatch_guard(this->op_details_.request_id(),
- &rd,
- tms);
- int retval = dispatch_guard.status();
+ int retval = this->invoke_i (0,
+ ACE_TRY_ENV);
+ ACE_CHECK_RETURN (retval);
- if (retval == -1)
+ // A TAO_INVOKE_EXCEPTION status, but no exception raised means that
+ // we have a user exception.
+ // @@ This is a bit brittle, think about a better implementation.
+ if (retval == TAO_INVOKE_EXCEPTION)
{
- // @@ What is the right way to handle this error?
- this->close_connection ();
-
- ACE_THROW_RETURN (CORBA::INTERNAL (TAO_DEFAULT_MINOR_CODE,
- CORBA::COMPLETED_NO),
- TAO_INVOKE_EXCEPTION);
- }
+ // Pull the exception from the stream.
+ CORBA::String_var buf;
- // Send the request.
- retval = TAO_GIOP_Invocation::invoke (1,
- ACE_TRY_ENV);
- ACE_CHECK_RETURN (retval);
+ if ((this->inp_stream () >> buf.inout ()) == 0)
+ {
+ // Could not demarshal the exception id, raise an local
+ // CORBA::MARSHAL
+ ACE_THROW_RETURN (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE,
+ CORBA::COMPLETED_MAYBE),
+ TAO_INVOKE_EXCEPTION);
+ }
- if (retval != TAO_INVOKE_OK)
- return retval;
+ // Match the exception interface repository id with the
+ // exception in the exception list.
+ // This is important to decode the exception.
- // Wait for the reply.
- if (TAO_debug_level > 0 && this->max_wait_time_ != 0)
- {
- CORBA::ULong msecs =
- this->max_wait_time_->msec ();
+ for (CORBA::ULong i = 0; i < except_count; ++i)
+ {
+ CORBA::TypeCode_ptr tcp = excepts[i].tc;
+ const char *xid = tcp->id (ACE_TRY_ENV);
+ ACE_CHECK_RETURN (TAO_INVOKE_EXCEPTION);
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("TAO (%P|%t) Timeout on recv is <%u>\n"),
- msecs));
- }
+ if (ACE_OS::strcmp (buf.in (), xid) != 0)
+ {
+ continue;
+ }
- int reply_error =
- this->transport_->wait_strategy ()->wait (this->max_wait_time_,
- rd.reply_received ());
+ // match
+ CORBA::Exception *exception = excepts[i].alloc ();
+ if (exception == 0)
+ {
+ ACE_THROW_RETURN (CORBA::NO_MEMORY (TAO_DEFAULT_MINOR_CODE,
+ CORBA::COMPLETED_YES),
+ TAO_INVOKE_EXCEPTION);
+ }
- if (TAO_debug_level > 0 && this->max_wait_time_ != 0)
- {
- CORBA::ULong msecs =
- this->max_wait_time_->msec ();
+ exception->_tao_decode (this->inp_stream (),
+ ACE_TRY_ENV);
+ ACE_CHECK_RETURN (TAO_INVOKE_EXCEPTION);
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("TAO (%P|%t) Timeout after recv is <%u> status <%d>\n"),
- msecs, reply_error));
- }
+ if (TAO_debug_level > 5)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO: (%P|%t) Raising exception %s\n"),
+ buf.in ()));
+ }
- // Check the reply error.
- if (reply_error == -1)
- {
- // The guard automatically unbinds the dispatcher
- if (errno == ETIME)
- {
- // Just a timeout, don't close the connection or
- // anything...
- ACE_THROW_RETURN (CORBA::TIMEOUT (
- CORBA_SystemException::_tao_minor_code (
- TAO_TIMEOUT_SEND_MINOR_CODE,
- errno),
- CORBA::COMPLETED_NO),
- TAO_INVOKE_EXCEPTION);
+ // @@ Think about a better way to raise the exception here,
+ // maybe we need some more macros?
+ ACE_TRY_ENV.exception (exception); // We can not use ACE_THROW here.
+ return TAO_INVOKE_EXCEPTION;
}
- return this->orb_core_->service_raise_comm_failure (this,
- this->profile_,
- ACE_TRY_ENV);
- }
+ // If we couldn't find the right exception, report it as
+ // CORBA::UNKNOWN.
- CORBA::ULong reply_status = rd.reply_status ();
+ ACE_THROW_RETURN (CORBA::UNKNOWN (TAO_DEFAULT_MINOR_CODE,
+ CORBA::COMPLETED_YES),
+ TAO_INVOKE_EXCEPTION);
+ }
- switch (reply_status)
- {
- case TAO_PLUGGABLE_MESSAGE_NO_EXCEPTION:
- // Return so that the STUB can demarshal the reply.
- return TAO_INVOKE_OK;
+ return retval;
+}
- case TAO_PLUGGABLE_MESSAGE_USER_EXCEPTION:
- {
- // Pull the exception from the stream.
- CORBA::String_var buf;
+// ****************************************************************
- if ((rd.reply_cdr () >> buf.inout ()) == 0)
- {
- // Could not demarshal the exception id, raise an local
- // CORBA::MARSHAL
- ACE_THROW_RETURN (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE,
- CORBA::COMPLETED_MAYBE),
- TAO_INVOKE_EXCEPTION);
- }
+TAO_GIOP_Oneway_Invocation::TAO_GIOP_Oneway_Invocation (
+ TAO_Stub *stub,
+ const char *operation,
+ CORBA::ULong opname_len,
+ TAO_ORB_Core *orb_core
+ )
+ : TAO_GIOP_Synch_Invocation (stub,
+ operation,
+ opname_len,
+ orb_core),
+ sync_scope_ (TAO::SYNC_WITH_TRANSPORT)
+{
+ int has_synchronization = 0;
+ int scope = 0;
+ this->orb_core_->call_sync_scope_hook (this->stub_,
+ has_synchronization,
+ scope);
+
+ this->sync_scope_ = scope;
+}
- // This kind of exception shouldn't happen with oneways,
- // but if it does, we turn it into a CORBA::UNKNOWN exception.
- ACE_THROW_RETURN (CORBA::UNKNOWN (TAO_DEFAULT_MINOR_CODE,
- CORBA::COMPLETED_YES),
- TAO_INVOKE_EXCEPTION);
- }
+void
+TAO_GIOP_Oneway_Invocation::start (CORBA_Environment &ACE_TRY_ENV)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_GIOP_Invocation::start (ACE_TRY_ENV);
+ ACE_CHECK;
- case TAO_PLUGGABLE_MESSAGE_SYSTEM_EXCEPTION:
- {
- // @@ Add the location macros for these exceptions...
+ this->transport_->start_request (this->orb_core_,
+ this->target_spec_,
+ this->out_stream_,
+ ACE_TRY_ENV);
+}
- CORBA::String_var type_id;
+int
+TAO_GIOP_Oneway_Invocation::invoke (CORBA::Environment &ACE_TRY_ENV)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (this->sync_scope_ == TAO::SYNC_WITH_TRANSPORT
+ || this->sync_scope_ == TAO::SYNC_NONE
+ || this->sync_scope_ == TAO::SYNC_EAGER_BUFFERING
+ || this->sync_scope_ == TAO::SYNC_DELAYED_BUFFERING)
+ {
+ return TAO_GIOP_Invocation::invoke (0,
+ ACE_TRY_ENV);
+ }
- if ((rd.reply_cdr () >> type_id.inout ()) == 0)
- {
- // Could not demarshal the exception id, raise a local
- // CORBA::MARSHAL
- ACE_THROW_RETURN (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE,
- CORBA::COMPLETED_MAYBE),
- TAO_INVOKE_OK);
- }
+ int retval = this->invoke_i (0,
+ ACE_TRY_ENV);
+ ACE_CHECK_RETURN (retval);
- CORBA::ULong minor = 0;
- CORBA::ULong completion = 0;
+ // A TAO_INVOKE_EXCEPTION status, but no exception raised means that
+ // we have a user exception.
+ // @@ This is a bit brittle, think about a better implementation.
+ if (retval == TAO_INVOKE_EXCEPTION)
+ {
+ // Pull the exception from the stream.
+ CORBA::String_var buf;
- if ((rd.reply_cdr () >> minor) == 0
- || (rd.reply_cdr () >> completion) == 0)
+ if ((this->inp_stream () >> buf.inout ()) == 0)
+ {
+ // Could not demarshal the exception id, raise an local
+ // CORBA::MARSHAL
ACE_THROW_RETURN (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE,
CORBA::COMPLETED_MAYBE),
- TAO_INVOKE_OK);
-
- CORBA::SystemException* ex =
- TAO_Exceptions::create_system_exception (type_id.in (),
- ACE_TRY_ENV);
- ACE_CHECK_RETURN (TAO_INVOKE_OK);
-
- if (ex == 0)
- {
- // @@ We should raise a CORBA::NO_MEMORY, but we ran out
- // of memory already. We need a pre-allocated, TSS,
- // CORBA::NO_MEMORY instance
- ACE_NEW_RETURN (ex,
- CORBA::UNKNOWN,
TAO_INVOKE_EXCEPTION);
- }
-
- ex->minor (minor);
- ex->completed (CORBA::CompletionStatus (completion));
-
- // @@ There should be a better way to raise this exception!
- // This code works for both native and emulated exceptions,
- // but it is ugly.
- ACE_TRY_ENV.exception (ex); // We can not use ACE_THROW here.
- return TAO_INVOKE_OK;
- }
-
- case TAO_PLUGGABLE_MESSAGE_LOCATION_FORWARD:
- // Handle the forwarding and return so the stub restarts the
- // request!
- return this->location_forward (rd.reply_cdr (),
- ACE_TRY_ENV);
- case TAO_PLUGGABLE_MESSAGE_NEEDS_ADDRESSING_MODE:
- {
- // We have received an exception with a request to change the
- // addressing mode. First let us read the mode that the
- // server/agent asks for.
- CORBA::Short addr_mode = 0;
- if (rd.reply_cdr ().read_short (addr_mode) == 0)
- {
- // Could not demarshal the addressing disposition, raise an local
- // CORBA::MARSHAL
- ACE_THROW_RETURN (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE,
- CORBA::COMPLETED_MAYBE),
- TAO_INVOKE_OK);
- }
-
- // Now set this addressing mode in the stub object, so that
- // the next invocation need not go through this.
- this->stub_->addressing_mode (addr_mode);
+ }
- // Now restart the invocation
- return TAO_INVOKE_RESTART;
- }
+ // This kind of exception shouldn't happen with oneways,
+ // but if it does, we turn it into a CORBA::UNKNOWN exception.
+ ACE_THROW_RETURN (CORBA::UNKNOWN (TAO_DEFAULT_MINOR_CODE,
+ CORBA::COMPLETED_YES),
+ TAO_INVOKE_EXCEPTION);
}
- return TAO_INVOKE_OK;
+ return retval;
}
// ****************************************************************
-TAO_GIOP_Locate_Request_Invocation::~TAO_GIOP_Locate_Request_Invocation (void)
-{
- if (this->transport_ != 0)
- this->transport_->idle_after_reply ();
-}
-
-// Send request, block until any reply comes back.
void
-TAO_GIOP_Locate_Request_Invocation::start (CORBA::Environment &ACE_TRY_ENV)
+TAO_GIOP_Locate_Request_Invocation::start (CORBA_Environment &ACE_TRY_ENV)
ACE_THROW_SPEC ((CORBA::SystemException))
{
- this->TAO_GIOP_Invocation::start (ACE_TRY_ENV);
+ TAO_GIOP_Invocation::start (ACE_TRY_ENV);
ACE_CHECK;
- // Just make sure that you pass in the object key
- this->target_spec_.target_specifier (this->profile_->object_key ());
-
this->transport_->start_locate (this->orb_core_,
this->target_spec_,
this->op_details_,
this->out_stream_,
ACE_TRY_ENV);
- this->rd_.reply_received () = 0;
}
+// Send request, block until any reply comes back.
int
TAO_GIOP_Locate_Request_Invocation::invoke (CORBA::Environment &ACE_TRY_ENV)
ACE_THROW_SPEC ((CORBA::SystemException))
{
- // @@ TODO This method is very similar to invoke_i(), we should try
- // to refactor them.
-
if (this->transport_ == 0)
- ACE_THROW_RETURN (CORBA::INTERNAL (),
- TAO_INVOKE_EXCEPTION);
-
- // Register a reply dispatcher for this invocation. Use the
- // preallocated reply dispatcher.
-
- // Bind.
- TAO_Transport_Mux_Strategy *tms = this->transport_->tms ();
-
- TAO_Bind_Dispatcher_Guard dispatch_guard (this->op_details_.request_id(),
- &this->rd_,
- tms);
- int retval = dispatch_guard.status();
-
- if (retval == -1)
{
- // @@ What is the right way to handle this error?
- this->close_connection ();
-
- ACE_THROW_RETURN (CORBA::INTERNAL (TAO_DEFAULT_MINOR_CODE,
- CORBA::COMPLETED_NO),
+ ACE_THROW_RETURN (CORBA::INTERNAL (),
TAO_INVOKE_EXCEPTION);
}
- int result =
- this->transport_->send_request (this->stub_,
- this->orb_core_,
- this->out_stream_,
- 1,
- this->max_wait_time_);
-
-
- if (result == -1)
- {
- this->transport_->close_connection ();
- this->transport_ = 0;
-
- this->endpoint_->reset_hint ();
-
- // @@ This code abort if the connection for the currenct profile
- // fails. Should we transparently try new profiles until one
- // works? Or is that something that a higher level component
- // should decide? Remember that LocateRequests are part of
- // the strategy to establish a connection.
-
- return this->orb_core_->service_raise_transient_failure (this,
- this->profile_,
- ACE_TRY_ENV);
-
- }
-
- // @@ Maybe the right place to do this is once the reply is
- // received? But what about oneways?
- this->endpoint_selector_->success (this);
-
- // Wait for the reply.
- int reply_error =
- this->transport_->wait_strategy ()->wait (this->max_wait_time_,
- this->rd_.reply_received ());
-
- // Check the reply error.
- if (reply_error == -1)
- {
- // The guard automatically unbinds the dispatcher
- if (errno == ETIME)
- {
- // Just a timeout, don't close the connection or
- // anything...
- ACE_THROW_RETURN (CORBA::TIMEOUT (
- CORBA_SystemException::_tao_minor_code (
- TAO_TIMEOUT_SEND_MINOR_CODE,
- errno),
- CORBA::COMPLETED_NO),
- TAO_INVOKE_EXCEPTION);
- }
-
- return this->orb_core_->service_raise_comm_failure (this,
- this->profile_,
- ACE_TRY_ENV);
- }
-
- CORBA::ULong locate_status = this->rd_.reply_status ();
+ CORBA::ULong locate_status = this->invoke_i (1,
+ ACE_TRY_ENV);
+ ACE_CHECK_RETURN (TAO_INVOKE_EXCEPTION);
switch (locate_status)
{
case TAO_GIOP_OBJECT_HERE:
break;
-
case TAO_GIOP_UNKNOWN_OBJECT:
ACE_THROW_RETURN (CORBA::OBJECT_NOT_EXIST (TAO_DEFAULT_MINOR_CODE,
CORBA::COMPLETED_YES),
TAO_INVOKE_EXCEPTION);
- // NOTREACHED
-
+ // NOTREACHED.
case TAO_GIOP_OBJECT_FORWARD:
return this->location_forward (this->inp_stream (),
ACE_TRY_ENV);
case TAO_GIOP_LOC_SYSTEM_EXCEPTION:
{
- // What else do we do??
// Pull the exception from the stream.
CORBA::String_var buf;
- if ((this->rd_.reply_cdr () >> buf.inout ()) == 0)
+ if ((this->inp_stream () >> buf.inout ()) == 0)
{
- // Could not demarshal the exception id, raise an local
- // CORBA::MARSHAL
+ // Could not demarshal the exception id, raise a local
+ // CORBA::MARSHAL exception.
ACE_THROW_RETURN (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE,
CORBA::COMPLETED_MAYBE),
TAO_INVOKE_EXCEPTION);
@@ -1345,10 +1053,11 @@ TAO_GIOP_Locate_Request_Invocation::invoke (CORBA::Environment &ACE_TRY_ENV)
// addressing mode. First let us read the mode that the
// server/agent asks for.
CORBA::Short addr_mode = 0;
- if (this->rd_.reply_cdr ().read_short (addr_mode) == 0)
+
+ if (this->inp_stream ().read_short (addr_mode) == 0)
{
- // Could not demarshal the addressing disposition, raise an local
- // CORBA::MARSHAL
+ // Could not demarshal the addressing disposition, raise a local
+ // CORBA::MARSHAL exception.
ACE_THROW_RETURN (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE,
CORBA::COMPLETED_MAYBE),
TAO_INVOKE_OK);
@@ -1358,7 +1067,7 @@ TAO_GIOP_Locate_Request_Invocation::invoke (CORBA::Environment &ACE_TRY_ENV)
// the next invocation need not go through this.
this->stub_->addressing_mode (addr_mode);
- // Now restart the invocation
+ // Restart the invocation.
return TAO_INVOKE_RESTART;
}
}
@@ -1366,8 +1075,3 @@ TAO_GIOP_Locate_Request_Invocation::invoke (CORBA::Environment &ACE_TRY_ENV)
return TAO_INVOKE_OK;
}
-// ****************************************************************
-
-#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
-#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
-#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
diff --git a/TAO/tao/Invocation.h b/TAO/tao/Invocation.h
index 3ad42bc9f24..afbc1d5fd47 100644
--- a/TAO/tao/Invocation.h
+++ b/TAO/tao/Invocation.h
@@ -83,7 +83,7 @@ public:
TAO_GIOP_Invocation (TAO_Stub *data,
const char *operation,
CORBA::ULong opname_len,
- TAO_ORB_Core* orb_core);
+ TAO_ORB_Core *orb_core);
// Constructor.
virtual ~TAO_GIOP_Invocation (void);
@@ -121,13 +121,13 @@ public:
// resets the forwarding profile and behaves like we are fowarded
// (to the same server)
-protected:
void start (CORBA_Environment &ACE_TRY_ENV =
TAO_default_environment ())
ACE_THROW_SPEC ((CORBA::SystemException));
// Establishes a connection to the remote server, initializes
// the GIOP headers in the output CDR.
+protected:
int invoke (CORBA::Boolean is_roundtrip,
CORBA_Environment &ACE_TRY_ENV =
TAO_default_environment ())
@@ -230,42 +230,70 @@ protected:
// ****************************************************************
-class TAO_Export TAO_GIOP_Twoway_Invocation : public TAO_GIOP_Invocation
+class TAO_Export TAO_GIOP_Synch_Invocation : public TAO_GIOP_Invocation
{
// = TITLE
- // Sends a two-way request, and expects the reply.
+ // TAO_GIOP_Synch_Invocation.
+ //
+ // = DESCRIPTION
+ // Base class for TAO_GIOP_Twoway_Invocation and
+ // TAO_GIOP_Oneway_Invocation.
+ //
+public:
+ TAO_GIOP_Synch_Invocation (TAO_Stub *stub,
+ const char *operation,
+ CORBA::ULong opname_len,
+ TAO_ORB_Core *orb_core);
+ // Constructor.
+
+ virtual ~TAO_GIOP_Synch_Invocation (void);
+ // Destructor.
+
+ TAO_InputCDR &inp_stream (void);
+ // Return the underlying input stream. Called by the stub to demarshal
+ // the results of the upcall into whatever return arguments there may be.
+
+protected:
+ int invoke_i (CORBA::Boolean is_locate_request,
+ CORBA::Environment &ACE_TRY_ENV)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Implementation of the invoke() methods, handles the basic
+ // send/reply code and the system exceptions.
+
+ TAO_Synch_Reply_Dispatcher rd_;
+ // Reply dispatcher for the current synchronous invocation.
+};
+
+// ****************************************************************
+
+class TAO_Export TAO_GIOP_Twoway_Invocation
+ : public TAO_GIOP_Synch_Invocation
+{
+ // = TITLE
+ // TAO_GIOP_Twoway_Invocation.
//
// = DESCRIPTION
+ // Sends a two-way request, and expects the reply.
// This class connects (or lookups a connection from the cache) to
// the remote server, builds the CDR stream for the Request, send
// the CDR stream and expects the response and interprets the
// incoming CDR stream.
//
public:
- TAO_GIOP_Twoway_Invocation (TAO_Stub *data,
+ TAO_GIOP_Twoway_Invocation (TAO_Stub *stub,
const char *operation,
CORBA::ULong opname_len,
- TAO_ORB_Core* orb_core);
+ TAO_ORB_Core *orb_core);
// Constructor.
- ~TAO_GIOP_Twoway_Invocation (void);
+ virtual ~TAO_GIOP_Twoway_Invocation (void);
// Destructor.
- void start (CORBA_Environment &TAO_IN_ENV =
+ void start (CORBA_Environment &ACE_TRY_ENV =
TAO_default_environment ())
ACE_THROW_SPEC ((CORBA::SystemException));
- // Calls TAO_GIOP_Invocation::start.
-
-#if (TAO_HAS_MINIMUM_CORBA == 0)
-
- int invoke (CORBA::ExceptionList_ptr exceptions,
- CORBA_Environment &ACE_TRY_ENV =
- TAO_default_environment ())
- ACE_THROW_SPEC ((CORBA::SystemException,CORBA::UnknownUserException));
- // Send request, block until any reply comes back, and unmarshal
- // reply parameters as appropriate.
-
-#endif /* TAO_HAS_MINIMUM_CORBA == 0 */
+ // Establishes a connection to the remote server, initializes
+ // the GIOP headers in the output CDR.
int invoke (TAO_Exception_Data *excepts,
CORBA::ULong except_count,
@@ -276,41 +304,34 @@ public:
// accomplishes the same task as the normal invoke except that
// Exceptions are allocated and decoded here. This reduces the
// footprint of the generated stubs.
-
- TAO_InputCDR &inp_stream (void);
- // return the underlying input stream
-
-private:
- int invoke_i (CORBA::Environment &ACE_TRY_ENV)
- ACE_THROW_SPEC ((CORBA::SystemException));
- // Implementation of the invoke() methods, handles the basic
- // send/reply code and the system exceptions.
-
- TAO_Synch_Reply_Dispatcher rd_;
- // Reply dispatcher for the current synchronous invocation.
};
// ****************************************************************
-class TAO_Export TAO_GIOP_Oneway_Invocation : public TAO_GIOP_Invocation
+class TAO_Export TAO_GIOP_Oneway_Invocation
+ : public TAO_GIOP_Synch_Invocation
{
// = TITLE
- // Sends a oneway request.
+ // TAO_GIOP_Oneway_Invocation
+ //
+ // = DESCRIPTION
+ // Sends a oneway request.
//
public:
- TAO_GIOP_Oneway_Invocation (TAO_Stub *data,
+ TAO_GIOP_Oneway_Invocation (TAO_Stub *stub,
const char *operation,
CORBA::ULong opname_len,
- TAO_ORB_Core* orb_core);
+ TAO_ORB_Core *orb_core);
// Constructor.
- ~TAO_GIOP_Oneway_Invocation (void);
+ virtual ~TAO_GIOP_Oneway_Invocation (void);
// Destructor.
- void start (CORBA_Environment &TAO_IN_ENV =
+ void start (CORBA_Environment &ACE_TRY_ENV =
TAO_default_environment ())
ACE_THROW_SPEC ((CORBA::SystemException));
- // Call TAO_GIOP_Invocation::start()
+ // Establishes a connection to the remote server, initializes
+ // the GIOP headers in the output CDR.
int invoke (CORBA_Environment &ACE_TRY_ENV =
TAO_default_environment ())
@@ -326,36 +347,34 @@ private:
// ****************************************************************
-class TAO_Export TAO_GIOP_Locate_Request_Invocation : public TAO_GIOP_Invocation
+class TAO_Export TAO_GIOP_Locate_Request_Invocation
+ : public TAO_GIOP_Synch_Invocation
{
// = TITLE
// Sends a locate request.
//
public:
TAO_GIOP_Locate_Request_Invocation (TAO_Stub *data,
- TAO_ORB_Core* orb_core);
+ TAO_ORB_Core *orb_core);
// Constructor.
~TAO_GIOP_Locate_Request_Invocation (void);
// Destructor.
- void start (CORBA_Environment &TAO_IN_ENV =
+ void start (CORBA_Environment &ACE_TRY_ENV =
TAO_default_environment ())
ACE_THROW_SPEC ((CORBA::SystemException));
- // Calls TAO_GIOP_Invocation::start.
+ // Establishes a connection to the remote server, initializes
+ // the GIOP headers in the output CDR.
int invoke (CORBA_Environment &ACE_TRY_ENV =
TAO_default_environment ())
ACE_THROW_SPEC ((CORBA::SystemException));
// Send request, without blocking for any response.
-
- TAO_InputCDR &inp_stream (void);
- // return the underlying input stream
-private:
- TAO_Synch_Reply_Dispatcher rd_;
- // Reply dispatcher for the current synchronous invocation.
};
+// ****************************************************************
+
#if defined (__ACE_INLINE__)
# include "tao/Invocation.i"
#endif /* __ACE_INLINE__ */
diff --git a/TAO/tao/Invocation.i b/TAO/tao/Invocation.i
index 544fb1dee48..9020379b23b 100644
--- a/TAO/tao/Invocation.i
+++ b/TAO/tao/Invocation.i
@@ -31,24 +31,55 @@ TAO_GIOP_Invocation::restart_flag (CORBA::Boolean flag)
// ****************************************************************
ACE_INLINE
-TAO_GIOP_Twoway_Invocation::
-TAO_GIOP_Twoway_Invocation (TAO_Stub *stub,
- const char *operation,
- CORBA::ULong opname_len,
- TAO_ORB_Core *orb_core)
- : TAO_GIOP_Invocation (stub, operation, opname_len, orb_core),
- rd_ (orb_core, this->op_details_.service_info ())
+TAO_GIOP_Synch_Invocation::TAO_GIOP_Synch_Invocation (
+ TAO_Stub *stub,
+ const char *operation,
+ CORBA::ULong opname_len,
+ TAO_ORB_Core *orb_core
+ )
+ : TAO_GIOP_Invocation (stub,
+ operation,
+ opname_len,
+ orb_core),
+ rd_ (orb_core,
+ this->op_details_.service_info ())
{
}
ACE_INLINE TAO_InputCDR &
-TAO_GIOP_Twoway_Invocation::inp_stream (void)
+TAO_GIOP_Synch_Invocation::inp_stream (void)
{
return this->rd_.reply_cdr ();
}
// ****************************************************************
+ACE_INLINE
+TAO_GIOP_Twoway_Invocation::TAO_GIOP_Twoway_Invocation (
+ TAO_Stub *stub,
+ const char *operation,
+ CORBA::ULong opname_len,
+ TAO_ORB_Core *orb_core
+ )
+ : TAO_GIOP_Synch_Invocation (stub,
+ operation,
+ opname_len,
+ orb_core)
+{
+}
+
+ACE_INLINE
+TAO_GIOP_Twoway_Invocation::~TAO_GIOP_Twoway_Invocation (void)
+{
+}
+
+// ****************************************************************
+
+ACE_INLINE
+TAO_GIOP_Oneway_Invocation::~TAO_GIOP_Oneway_Invocation (void)
+{
+}
+
ACE_INLINE TAO::SyncScope
TAO_GIOP_Oneway_Invocation::sync_scope (void)
{
@@ -61,13 +92,14 @@ ACE_INLINE
TAO_GIOP_Locate_Request_Invocation::
TAO_GIOP_Locate_Request_Invocation (TAO_Stub *stub,
TAO_ORB_Core *orb_core)
- : TAO_GIOP_Invocation (stub, 0, 0, orb_core),
- rd_ (orb_core, this->op_details_.service_info ())
+ : TAO_GIOP_Synch_Invocation (stub,
+ 0,
+ 0,
+ orb_core)
{
}
-ACE_INLINE TAO_InputCDR &
-TAO_GIOP_Locate_Request_Invocation::inp_stream (void)
+TAO_GIOP_Locate_Request_Invocation::~TAO_GIOP_Locate_Request_Invocation (void)
{
- return this->rd_.reply_cdr ();
}
+
diff --git a/TAO/tao/Reply_Dispatcher.cpp b/TAO/tao/Reply_Dispatcher.cpp
index 81bf75162ab..8e1c67591fe 100644
--- a/TAO/tao/Reply_Dispatcher.cpp
+++ b/TAO/tao/Reply_Dispatcher.cpp
@@ -10,6 +10,7 @@ ACE_RCSID(tao, Reply_Dispatcher, "$Id$")
// Constructor.
TAO_Reply_Dispatcher::TAO_Reply_Dispatcher (void)
+ : reply_status_ (100) // Just an invalid reply status.
{
}
@@ -18,8 +19,3 @@ TAO_Reply_Dispatcher::~TAO_Reply_Dispatcher (void)
{
}
-TAO_GIOP_Message_State *
-TAO_Reply_Dispatcher::message_state (void)
-{
- return 0;
-}
diff --git a/TAO/tao/Reply_Dispatcher.h b/TAO/tao/Reply_Dispatcher.h
index 48d56df63bc..274382c1850 100644
--- a/TAO/tao/Reply_Dispatcher.h
+++ b/TAO/tao/Reply_Dispatcher.h
@@ -67,7 +67,10 @@ public:
// protocols implement different variants of such ClientReply
// class.
- virtual TAO_GIOP_Message_State *message_state (void);
+ CORBA::ULong reply_status (void) const;
+ // Get the reply status.
+
+ virtual TAO_GIOP_Message_State *message_state (void) = 0;
// Get the Message State into which the reply has been read.
virtual void dispatcher_bound (TAO_Transport*) = 0;
@@ -82,6 +85,10 @@ public:
// message then we could re-issue the request instead of raising
// the exception, it would a matter of simply adding a boolean
// argument to this function.
+
+protected:
+ CORBA::ULong reply_status_;
+ // Reply or LocateReply status.
};
#if defined (__ACE_INLINE__)
diff --git a/TAO/tao/Reply_Dispatcher.i b/TAO/tao/Reply_Dispatcher.i
index cfa1da318d3..9d8265bb761 100644
--- a/TAO/tao/Reply_Dispatcher.i
+++ b/TAO/tao/Reply_Dispatcher.i
@@ -1 +1,8 @@
// $Id$
+
+ACE_INLINE CORBA::ULong
+TAO_Reply_Dispatcher::reply_status (void) const
+{
+ return this->reply_status_;
+}
+
diff --git a/TAO/tao/Synch_Reply_Dispatcher.cpp b/TAO/tao/Synch_Reply_Dispatcher.cpp
index fdb5722cf92..647174d02dd 100644
--- a/TAO/tao/Synch_Reply_Dispatcher.cpp
+++ b/TAO/tao/Synch_Reply_Dispatcher.cpp
@@ -4,17 +4,14 @@
#include "tao/ORB_Core.h"
#include "tao/Wait_Strategy.h"
-#if !defined (__ACE_INLINE__)
-#include "tao/Synch_Reply_Dispatcher.i"
-#endif /* __ACE_INLINE__ */
-
ACE_RCSID(tao, Synch_Reply_Dispatcher, "$Id$")
// Constructor.
-TAO_Synch_Reply_Dispatcher::TAO_Synch_Reply_Dispatcher (TAO_ORB_Core *orb_core,
- IOP::ServiceContextList &sc)
+TAO_Synch_Reply_Dispatcher::TAO_Synch_Reply_Dispatcher (
+ TAO_ORB_Core *orb_core,
+ IOP::ServiceContextList &sc
+ )
: reply_service_info_ (sc),
- reply_status_ (100), //Just a invalid reply status
message_state_ (orb_core),
reply_received_ (0),
orb_core_ (orb_core),
@@ -41,13 +38,14 @@ TAO_Synch_Reply_Dispatcher::reply_received (void)
}
int
-TAO_Synch_Reply_Dispatcher::dispatch_reply (CORBA::ULong reply_status,
- const TAO_GIOP_Version & /*version*/,
- IOP::ServiceContextList &reply_ctx,
- TAO_GIOP_Message_State *message_state)
+TAO_Synch_Reply_Dispatcher::dispatch_reply (
+ CORBA::ULong reply_status,
+ const TAO_GIOP_Version & /* version */,
+ IOP::ServiceContextList &reply_ctx,
+ TAO_GIOP_Message_State *message_state
+ )
{
this->reply_status_ = reply_status;
- //this->version_ = version;
// Steal the buffer, that way we don't do any unnecesary copies of
// this data.
@@ -75,9 +73,13 @@ TAO_Synch_Reply_Dispatcher::dispatch_reply (CORBA::ULong reply_status,
if (this->wait_strategy_ != 0)
{
if (this->wait_strategy_->reply_dispatched (
- this->reply_received_,
- this->leader_follower_condition_variable_) == -1)
- return -1;
+ this->reply_received_,
+ this->leader_follower_condition_variable_
+ )
+ == -1)
+ {
+ return -1;
+ }
}
return 1;
@@ -103,7 +105,8 @@ TAO_Synch_Reply_Dispatcher::connection_closed (void)
if (this->wait_strategy_ != 0)
{
this->wait_strategy_->connection_closed (
- this->reply_received_,
- this->leader_follower_condition_variable_);
+ this->reply_received_,
+ this->leader_follower_condition_variable_
+ );
}
}
diff --git a/TAO/tao/Synch_Reply_Dispatcher.h b/TAO/tao/Synch_Reply_Dispatcher.h
index 4cdce168f51..2232f4c5918 100644
--- a/TAO/tao/Synch_Reply_Dispatcher.h
+++ b/TAO/tao/Synch_Reply_Dispatcher.h
@@ -44,12 +44,6 @@ public:
virtual ~TAO_Synch_Reply_Dispatcher (void);
// Destructor.
- CORBA::ULong reply_status (void) const;
- // Get the reply status.
-
- const TAO_GIOP_Version& version (void) const;
- // Get the GIOP version.
-
TAO_InputCDR &reply_cdr (void);
// Return the reply CDR.
@@ -60,8 +54,11 @@ public:
const TAO_GIOP_Version& version,
IOP::ServiceContextList& reply_ctx,
TAO_GIOP_Message_State* message_state);
+
virtual TAO_GIOP_Message_State *message_state (void);
+
virtual void dispatcher_bound (TAO_Transport *);
+
virtual void connection_closed (void);
protected:
@@ -69,12 +66,6 @@ protected:
// The service context list
private:
- CORBA::ULong reply_status_;
- // Reply or LocateReply status.
-
- // TAO_GIOP_Version version_;
- // The version
-
TAO_GIOP_Message_State message_state_;
// All the state required to receive the input...
// @@ Having members of type TAO_GIOP* indicates that we
@@ -99,9 +90,5 @@ private:
// to the Waiting_Strategy to do the signalling, if needed.
};
-#if defined (__ACE_INLINE__)
-#include "tao/Synch_Reply_Dispatcher.i"
-#endif /* __ACE_INLINE__ */
-
#include "ace/post.h"
#endif /* TAO_REPLY_DISPATCHER_H */
diff --git a/TAO/tao/Synch_Reply_Dispatcher.i b/TAO/tao/Synch_Reply_Dispatcher.i
deleted file mode 100644
index 3e02a8bc13f..00000000000
--- a/TAO/tao/Synch_Reply_Dispatcher.i
+++ /dev/null
@@ -1,8 +0,0 @@
-// $Id$
-
-
-ACE_INLINE CORBA::ULong
-TAO_Synch_Reply_Dispatcher::reply_status (void) const
-{
- return this->reply_status_;
-}
diff --git a/TAO/tao/TAO.dsp b/TAO/tao/TAO.dsp
index d5a60171643..32ee26136f1 100644
--- a/TAO/tao/TAO.dsp
+++ b/TAO/tao/TAO.dsp
@@ -3892,6 +3892,10 @@ SOURCE=.\Asynch_Invocation.i
# End Source File
# Begin Source File
+SOURCE=.\Asynch_Reply_Dispatcher.i
+# End Source File
+# Begin Source File
+
SOURCE=.\Base_Connection_Property.i
# End Source File
# Begin Source File
diff --git a/TAO/tao/TAO_Static.dsp b/TAO/tao/TAO_Static.dsp
index 082b0649f37..173e5c0a849 100644
--- a/TAO/tao/TAO_Static.dsp
+++ b/TAO/tao/TAO_Static.dsp
@@ -779,6 +779,10 @@ SOURCE=.\Asynch_Invocation.i
# End Source File
# Begin Source File
+SOURCE=.\Asynch_Reply_Dispatcher.i
+# End Source File
+# Begin Source File
+
SOURCE=.\Base_Connection_Property.i
# End Source File
# Begin Source File