summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbala <balanatarajan@users.noreply.github.com>2003-07-20 13:33:07 +0000
committerbala <balanatarajan@users.noreply.github.com>2003-07-20 13:33:07 +0000
commiteb6e18fa2810a6dbf799355ee076d719329e163f (patch)
treeeb4557e3514eeea40722259828fc455ff9135daf
parent184052e701e4d5a99f3b2f6c87571e491c4c2750 (diff)
downloadATCD-eb6e18fa2810a6dbf799355ee076d719329e163f.tar.gz
ChangeLogTag:Sun Jul 20 07:56:17 2003 Balachandran Natarajan <bala@dre.vanderbilt.edu>
-rw-r--r--TAO/ChangeLog_ref71
-rw-r--r--TAO/tao/Argument.h3
-rw-r--r--TAO/tao/ClientRequestInfo_i.cpp53
-rw-r--r--TAO/tao/ClientRequestInfo_i.h20
-rw-r--r--TAO/tao/Collocated_Invocation.cpp42
-rw-r--r--TAO/tao/Collocated_Invocation.h62
-rw-r--r--TAO/tao/Collocation_Proxy_Broker.h50
-rw-r--r--TAO/tao/Invocation.cpp4
-rw-r--r--TAO/tao/Invocation_Adapter.cpp220
-rw-r--r--TAO/tao/Invocation_Adapter.h129
-rw-r--r--TAO/tao/Invocation_Base.cpp209
-rw-r--r--TAO/tao/Invocation_Base.h110
-rw-r--r--TAO/tao/Invocation_Endpoint_Selectors.cpp9
-rw-r--r--TAO/tao/Invocation_Endpoint_Selectors.h7
-rw-r--r--TAO/tao/ORB_Core.cpp52
-rw-r--r--TAO/tao/ORB_Core.h9
-rw-r--r--TAO/tao/Profile_Transport_Resolver.cpp94
-rw-r--r--TAO/tao/Profile_Transport_Resolver.h21
-rw-r--r--TAO/tao/Remote_Invocation.cpp50
-rw-r--r--TAO/tao/Remote_Invocation.h24
-rw-r--r--TAO/tao/Stub.h3
-rw-r--r--TAO/tao/Synch_Invocation.cpp148
-rw-r--r--TAO/tao/Synch_Invocation.h27
-rw-r--r--TAO/tao/TODO23
-rw-r--r--TAO/tao/corbafwd.h24
-rw-r--r--TAO/tao/operation_details.cpp58
-rw-r--r--TAO/tao/operation_details.h30
-rw-r--r--TAO/tao/operation_details.i16
28 files changed, 1209 insertions, 359 deletions
diff --git a/TAO/ChangeLog_ref b/TAO/ChangeLog_ref
index 5728e5897e4..dc3061d0533 100644
--- a/TAO/ChangeLog_ref
+++ b/TAO/ChangeLog_ref
@@ -1,3 +1,74 @@
+Sun Jul 20 07:56:17 2003 Balachandran Natarajan <bala@dre.vanderbilt.edu>
+
+ * tao/Collocated_Invocation.cpp:
+ * tao/Collocated_Invocation.h: New files which provide the actual
+ implementation for making collocated calls on the servant. This
+ class should deal with everything related to collocation like
+ forwarding, interceptors, special ways for AMI etc.
+
+ * tao/Collocation_Proxy_Broker.h: A abstract base class which will
+ be implemented in the generated code for the client side calls
+ to be converted as upcalls in the skeleton code.
+
+ * tao/Invocation_Adapter.cpp:
+ * tao/Invocation_Adapter.h: The original implementation of
+ Invocation_Base is now renamed to be TAO::Invocation_Adapter
+ since this sounded more correct. The invocation adapter has a
+ wide range of responsibilities including making the right type
+ of invocation object (like oneways, twoays, collocated etc.) and
+ delegating further responsibilities to those classes.
+
+ * tao/Argument.h: Cosmetic fix.
+
+ * tao/ClientRequestInfo_i.cpp:
+ * tao/ClientRequestInfo_i.h: This class uses the TAO::Invocation_Base
+ object instead of the age old TAO_GIOP_Invocation class.
+
+ * tao/Invocation.cpp: Changed the usage of int to bool in the
+ calls to the ORB_Core that fetches the timeout.
+
+ * tao/Invocation_Base.cpp:
+ * tao/Invocation_Base.h: New class that serves as a base class for
+ Remote and colloctaed invocations. This base class provides the
+ right implementations for interceptors.
+
+ * tao/Invocation_Endpoint_Selectors.cpp:
+ * tao/Invocation_Endpoint_Selectors.h: Added timeout to the
+ select_endpoint () call.
+
+ * tao/ORB_Core.cpp:
+ * tao/ORB_Core.h: Changed the calls, connection_timeout () and
+ timeout () to take a boolean. This is just a simple
+ C++'ification our code. Added a call collocation_strategy_new ()
+ whose implementation is exactly the same as collocation_strategy
+ () but returns a TAO::Collocation_Strategy instead of an
+ int. The old call will be retired and the _new () call will
+ replace the original call. The _new is provided as a backward
+ compatibility measure to get our workspace compiling.
+
+ * tao/Remote_Invocation.cpp:
+ * tao/Remote_Invocation.h:
+ * tao/Profile_Transport_Resolver.cpp:
+ * tao/Profile_Transport_Resolver.h: Added support for connection
+ and roundtrip timeouts.
+
+ * tao/Stub.h: The struct TAO_Exception_Data will now take a
+ typecode pointer to the exception.
+
+ * tao/Synch_Invocation.cpp:
+ * tao/Synch_Invocation.h: Lots of refactoring to support timeouts
+ in the code.
+
+ * tao/corbafwd.h: A new enum is now added and the old enum within
+ namepsace TAO_Collocation_Strategy needs to be retired. Infact
+ the namepscae itself needs to go.
+
+ * tao/operation_details.cpp:
+ * tao/operation_details.h:
+ * tao/operation_details.i: More or less all the details of the
+ operation are now stored here. This makes it easier for
+ accessing the information for interceptors.
+
Thu Jul 17 20:59:34 2003 Jeff Parsons <j.parsons@vanderbilt.edu>
* tao/Abstract_Servant_Base.h:
diff --git a/TAO/tao/Argument.h b/TAO/tao/Argument.h
index c9c6c52a407..9b91acdfe23 100644
--- a/TAO/tao/Argument.h
+++ b/TAO/tao/Argument.h
@@ -54,7 +54,8 @@ namespace TAO
virtual void interceptor_result (CORBA::Any *);
virtual CORBA::Boolean interceptor_replace (CORBA::Any &);
};
-};
+
+}
#include "ace/post.h"
diff --git a/TAO/tao/ClientRequestInfo_i.cpp b/TAO/tao/ClientRequestInfo_i.cpp
index 7c90b33fbb9..014476d7214 100644
--- a/TAO/tao/ClientRequestInfo_i.cpp
+++ b/TAO/tao/ClientRequestInfo_i.cpp
@@ -1,10 +1,11 @@
#include "ClientRequestInfo_i.h"
-#include "Invocation.h"
+#include "Invocation_Base.h"
#include "Stub.h"
#include "Profile.h"
#include "Tagged_Components.h"
#include "Valuetype_Adapter.h"
#include "debug.h"
+#include "Service_Context.h"
#include "ace/Dynamic_Service.h"
@@ -18,7 +19,7 @@ ACE_RCSID (TAO,
# include "ClientRequestInfo_i.inl"
# endif /* !__ACE_INLINE__ */
-TAO_ClientRequestInfo_i::TAO_ClientRequestInfo_i (TAO_GIOP_Invocation *inv,
+TAO_ClientRequestInfo_i::TAO_ClientRequestInfo_i (TAO::Invocation_Base *inv,
CORBA::Object_ptr target)
: invocation_ (inv),
target_ (target), // No need to duplicate.
@@ -32,7 +33,7 @@ TAO_ClientRequestInfo_i::TAO_ClientRequestInfo_i (TAO_GIOP_Invocation *inv,
}
TAO_ClientRequestInfo_i::TAO_ClientRequestInfo_i (
- TAO_GIOP_Invocation *inv,
+ TAO::Invocation_Base *inv,
CORBA::AbstractBase_ptr abstract_target
)
: invocation_ (inv),
@@ -91,7 +92,7 @@ TAO_ClientRequestInfo_i::target (ACE_ENV_SINGLE_ARG_DECL)
{
if (CORBA::is_nil (this->target_))
{
-
+
TAO_Valuetype_Adapter *adapter =
ACE_Dynamic_Service<TAO_Valuetype_Adapter>::instance (
TAO_ORB_Core::valuetype_adapter_name ()
@@ -118,7 +119,7 @@ TAO_ClientRequestInfo_i::effective_target (ACE_ENV_SINGLE_ARG_DECL)
// TAO_GIOP_Invocation::forward_reference() already duplicates
// the reference before returning it so there is no need to
// duplicate it here.
- return this->invocation_->forward_reference ();
+ return this->invocation_->forwarded_reference ();
}
if (CORBA::is_nil (this->target_))
@@ -455,25 +456,21 @@ char *
TAO_ClientRequestInfo_i::operation (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
ACE_THROW_SPEC ((CORBA::SystemException))
{
- return CORBA::string_dup (this->invocation_->operation ());
+ return CORBA::string_dup (this->invocation_->operation_name ());
}
Dynamic::ParameterList *
TAO_ClientRequestInfo_i::arguments (ACE_ENV_SINGLE_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException))
{
- ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14,
- CORBA::COMPLETED_NO),
- 0);
+ return this->invocation_->arguments (ACE_ENV_SINGLE_ARG_PARAMETER);
}
Dynamic::ExceptionList *
TAO_ClientRequestInfo_i::exceptions (ACE_ENV_SINGLE_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException))
{
- ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14,
- CORBA::COMPLETED_NO),
- 0);
+ return this->invocation_->exceptions (ACE_ENV_SINGLE_ARG_PARAMETER);
}
Dynamic::ContextList *
@@ -514,22 +511,7 @@ Messaging::SyncScope
TAO_ClientRequestInfo_i::sync_scope (ACE_ENV_SINGLE_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException))
{
- TAO_GIOP_Oneway_Invocation *inv =
- ACE_dynamic_cast (TAO_GIOP_Oneway_Invocation *,
- this->invocation_);
-
- // The response_expected_ check is a precautionary measure for
- // platforms that do not support RTTI, i.e. where the dynamic_cast
- // above would incorrectly work. If the response_expected flag is
- // not equal to zero then it is fairly safe to assume that the
- // invocation is not a one-way, meaning that the sync_scope() method
- // is not available.
- if (inv != 0 && this->response_expected_ == 0)
- return inv->sync_scope ();
-
- ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14,
- CORBA::COMPLETED_NO),
- -1);
+ return this->invocation_->sync_scope ();
}
PortableInterceptor::ReplyStatus
@@ -561,7 +543,7 @@ TAO_ClientRequestInfo_i::forward_reference (ACE_ENV_SINGLE_ARG_DECL)
// TAO_GIOP_Invocation::forward_reference() already duplicates the
// reference before returning it so there is no need to duplicate it
// here.
- return this->invocation_->forward_reference ();
+ return this->invocation_->forwarded_reference ();
}
CORBA::Any *
@@ -629,15 +611,15 @@ TAO_ClientRequestInfo_i::get_service_context_i (
}
void
-TAO_ClientRequestInfo_i::reply_status (int invoke_status)
+TAO_ClientRequestInfo_i::reply_status (TAO::Invocation_Status invoke_status)
{
switch (invoke_status)
{
- case TAO_INVOKE_OK:
+ case TAO::TAO_INVOKE_SUCCESS:
this->reply_status_ = PortableInterceptor::SUCCESSFUL;
break;
- case TAO_INVOKE_RESTART:
- if (this->invocation_->received_location_forward ())
+ case TAO::TAO_INVOKE_RESTART:
+ if (this->invocation_->is_forwarded ())
this->reply_status_ = PortableInterceptor::LOCATION_FORWARD;
else
this->reply_status_ = PortableInterceptor::TRANSPORT_RETRY;
@@ -651,4 +633,9 @@ TAO_ClientRequestInfo_i::reply_status (int invoke_status)
}
}
+void
+TAO_ClientRequestInfo_i::reply_status (int )
+{
+}
+
#endif /* TAO_HAS_INTERCEPTORS == 1 */
diff --git a/TAO/tao/ClientRequestInfo_i.h b/TAO/tao/ClientRequestInfo_i.h
index 0417725ebfe..da0f2052832 100644
--- a/TAO/tao/ClientRequestInfo_i.h
+++ b/TAO/tao/ClientRequestInfo_i.h
@@ -30,10 +30,11 @@
#include "tao/PortableInterceptorC.h"
#include "tao/StringSeqC.h"
#include "tao/PICurrent.h"
+#include "tao/Invocation_Base.h"
-
-class TAO_GIOP_Invocation;
class TAO_Service_Context;
+class TAO_GIOP_Invocation;
+
/**
* @class TAO_ClientRequestInfo_i
@@ -46,11 +47,15 @@ class TAO_Export TAO_ClientRequestInfo_i
public:
/// Constructor from concrete interface.
- TAO_ClientRequestInfo_i (TAO_GIOP_Invocation *invocation,
+ TAO_ClientRequestInfo_i (TAO::Invocation_Base *invocation,
CORBA::Object_ptr target);
+ //// @@ NEED TO GO.... For backward compatibility
+ TAO_ClientRequestInfo_i (TAO_GIOP_Invocation *,
+ CORBA::Object_ptr ) {};
+
/// Constructor from abstract interface.
- TAO_ClientRequestInfo_i (TAO_GIOP_Invocation *invocation,
+ TAO_ClientRequestInfo_i (TAO::Invocation_Base *invocation,
CORBA::AbstractBase_ptr abstract_target);
/// Destructor.
@@ -213,7 +218,10 @@ public:
void response_expected (CORBA::Boolean flag);
/// Set the status of the received reply.
- void reply_status (int invoke_status);
+ void reply_status (TAO::Invocation_Status s);
+
+ // @@@@ NEEd to go
+ void reply_status (int s);
/// Extract the forward object reference from the
/// PortableInterceptor::ForwardRequest exception, and set the reply
@@ -237,7 +245,7 @@ protected:
protected:
/// Pointer to the GIOP invocation object.
- TAO_GIOP_Invocation *invocation_;
+ TAO::Invocation_Base *invocation_;
/// Reference to the target object.
CORBA::Object_ptr target_;
diff --git a/TAO/tao/Collocated_Invocation.cpp b/TAO/tao/Collocated_Invocation.cpp
new file mode 100644
index 00000000000..4bdb7dafc2a
--- /dev/null
+++ b/TAO/tao/Collocated_Invocation.cpp
@@ -0,0 +1,42 @@
+#include "Collocated_Invocation.h"
+#include "Collocation_Proxy_Broker.h"
+#include "operation_details.h"
+
+ACE_RCSID (tao,
+ Collocated_Invocation,
+ "$Id$")
+
+namespace TAO
+{
+
+ Collocated_Invocation::Collocated_Invocation (TAO_Stub *stub,
+ TAO_Operation_Details &detail)
+ : Invocation_Base (stub,
+ detail)
+ , forwarded_ (0)
+ {
+ }
+
+ Invocation_Status
+ Collocated_Invocation::invoke (Collocation_Proxy_Broker *cpb,
+ CORBA::Object *obj,
+ Collocation_Strategy strat
+ ACE_ENV_ARG_DECL)
+ {
+ // @@ Time to call interceptors...
+ cpb->dispatch (obj,
+ this->forwarded_to_.out (),
+ this->details_.args (),
+ this->details_.args_num (),
+ this->details_.opname (),
+ this->details_.opname_len (),
+ strat
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->forwarded_to_.in () != 0)
+ return TAO_INVOKE_RESTART;
+
+ return TAO_INVOKE_SUCCESS;
+ }
+}
diff --git a/TAO/tao/Collocated_Invocation.h b/TAO/tao/Collocated_Invocation.h
new file mode 100644
index 00000000000..cd311e4a437
--- /dev/null
+++ b/TAO/tao/Collocated_Invocation.h
@@ -0,0 +1,62 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Collocated_Invocation.h
+ *
+ * $Id$
+ *
+ *
+ * @author Balachandran Natarajan <bala@dre.vanderbilt.edu>
+ */
+//=============================================================================
+#ifndef TAO_COLLOCATED_INVOCATION_H
+#define TAO_COLLOCATED_INVOCATION_H
+#include "ace/pre.h"
+
+#include "tao/TAO_Export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Invocation_Base.h"
+#include "ace/CORBA_macros.h"
+
+
+class TAO_Operation_Details;
+class TAO_Stub;
+
+
+namespace TAO
+{
+ class Profile_Transport_Resolver;
+ class Argument;
+ class Collocation_Proxy_Broker;
+
+ /**
+ * @class Collocated_Invocation
+ *
+ * @brief Base class for ..
+ *
+ */
+ class TAO_Export Collocated_Invocation : protected Invocation_Base
+ {
+ public:
+ Collocated_Invocation (TAO_Stub *stub,
+ TAO_Operation_Details &detail);
+
+ Invocation_Status invoke (Collocation_Proxy_Broker *cpb,
+ CORBA::Object *obj,
+ Collocation_Strategy strat
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ private:
+ ACE_UNIMPLEMENTED_FUNC (Collocated_Invocation (void));
+ private:
+ CORBA::Object_var forwarded_;
+ };
+}
+#include "ace/post.h"
+#endif /*TAO_COLLOCATED_INVOCATION_H*/
diff --git a/TAO/tao/Collocation_Proxy_Broker.h b/TAO/tao/Collocation_Proxy_Broker.h
new file mode 100644
index 00000000000..c0601327a79
--- /dev/null
+++ b/TAO/tao/Collocation_Proxy_Broker.h
@@ -0,0 +1,50 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Collocation_Proxy_Broker.h
+ *
+ * $Id$
+ *
+ *
+ * @author Balachandran Natarajan <bala@dre.vanderbilt.edu>
+ */
+//=============================================================================
+#ifndef TAO_COLLOCATION_PROXY_BROKER_H
+#define TAO_COLLOCATION_PROXY_BROKER_H
+#include "ace/pre.h"
+
+#include "tao/corbafwd.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+namespace TAO
+{
+ /**
+ * @class Collocation_Proxy_Broker
+ */
+ class TAO_Export Collocation_Proxy_Broker
+ {
+
+ public:
+
+ virtual Collocation_Strategy get_strategy (CORBA::Object *obj
+ ACE_ENV_ARG_DECL) = 0;
+
+ virtual void dispatch (CORBA::Object *obj,
+ CORBA::Object_out forward_obj,
+ Argument **arg,
+ int num_args,
+ const char *op,
+ int op_len,
+ Collocation_Strategy strategy
+ ACE_ENV_ARG_DECL) = 0;
+ private:
+ };
+}
+
+
+#include "ace/post.h"
+#endif /*TAO_COLLOCATION_PROXY_BROKER_H */
diff --git a/TAO/tao/Invocation.cpp b/TAO/tao/Invocation.cpp
index 46af924c2ea..7feceffd393 100644
--- a/TAO/tao/Invocation.cpp
+++ b/TAO/tao/Invocation.cpp
@@ -203,7 +203,7 @@ TAO_GIOP_Invocation::start (ACE_ENV_SINGLE_ARG_DECL)
if (this->max_wait_time_ == 0)
{
- int has_timeout;
+ bool has_timeout = false;
this->orb_core_->call_timeout_hook (this->stub_,
has_timeout,
this->max_wait_time_value_);
@@ -263,7 +263,7 @@ TAO_GIOP_Invocation::perform_call (TAO_Transport_Descriptor_Interface &desc
ACE_Time_Value *max_wait_time = 0;
ACE_Time_Value connection_timeout;
- int is_conn_timeout = 0;
+ bool is_conn_timeout = false;
// Check for the connection timout policy in the ORB
this->orb_core ()->connection_timeout (this->stub (),
diff --git a/TAO/tao/Invocation_Adapter.cpp b/TAO/tao/Invocation_Adapter.cpp
new file mode 100644
index 00000000000..8f0628f52c1
--- /dev/null
+++ b/TAO/tao/Invocation_Adapter.cpp
@@ -0,0 +1,220 @@
+//$Id$
+#include "Invocation_Adapter.h"
+#include "Object.h"
+#include "Profile_Transport_Resolver.h"
+#include "operation_details.h"
+#include "Stub.h"
+#include "ORB_Core.h"
+//@@ Need to remove when we take care of the note below.
+#include "corbafwd.h"
+#include "Synch_Invocation.h"
+#include "Collocated_Invocation.h"
+#include "Transport.h"
+#include "Transport_Mux_Strategy.h"
+#include "Messaging_SyncScopeC.h"
+#include "Collocation_Proxy_Broker.h"
+
+ACE_RCSID (tao,
+ Invocation_Adapter,
+ "$Id$")
+
+
+namespace TAO
+{
+ Invocation_Adapter::Invocation_Adapter (CORBA::Object *target,
+ Argument **args,
+ int arg_number,
+ char *operation,
+ int op_len,
+ Collocation_Proxy_Broker *p,
+ Invocation_Type type,
+ Invocation_Mode mode)
+ : target_ (target)
+ , args_ (args)
+ , number_args_ (arg_number)
+ , operation_ (operation)
+ , op_len_ (op_len)
+ , cpb_ (p)
+ , type_ (type)
+ , mode_ (mode)
+ {
+ }
+
+
+ void
+ Invocation_Adapter::invoke (TAO_Exception_Data *ex_data,
+ unsigned long ex_count
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ // Should stub object be refcounted here?
+ TAO_Stub *stub =
+ this->target_->_stubobj ();
+
+ if (stub == 0)
+ ACE_THROW (CORBA::INTERNAL (
+ CORBA::SystemException::_tao_minor_code (
+ TAO_DEFAULT_MINOR_CODE,
+ EINVAL),
+ CORBA::COMPLETED_NO));
+
+ TAO_Operation_Details op_details (this->operation_,
+ this->op_len_,
+ this->number_args_ != 0,
+ this->args_,
+ this->number_args_,
+ ex_data,
+ ex_count);
+ if (this->cpb_)
+ {
+ this->invoke_collocated (stub,
+ op_details
+ ACE_ENV_ARG_DECL);
+ ACE_CHECK;
+
+ return;
+ }
+
+ this->invoke_remote (stub,
+ op_details
+ ACE_ENV_ARG_DECL);
+ ACE_CHECK;
+ }
+
+ void
+ Invocation_Adapter::invoke_collocated (TAO_Stub *stub,
+ TAO_Operation_Details &details
+ ACE_ENV_ARG_DECL)
+ {
+ CORBA::Object *local_target = this->target_;
+
+ // Initial state
+ TAO::Invocation_Status status = TAO_INVOKE_START;
+
+ while (status == TAO_INVOKE_START ||
+ status == TAO_INVOKE_RESTART)
+ {
+ Collocation_Strategy strat =
+ this->cpb_->get_strategy (local_target
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (strat == TAO_CS_REMOTE_STRATEGY ||
+ strat == TAO_CS_LAST)
+ {
+ this->invoke_remote (stub,
+ details
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK;
+
+ return;
+ }
+
+ Collocated_Invocation coll_inv (stub,
+ details);
+
+ status = coll_inv.invoke (this->cpb_,
+ local_target,
+ strat
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (status == TAO_INVOKE_RESTART)
+ local_target = coll_inv.steal_forwarded_reference ();
+ }
+ }
+
+ void
+ Invocation_Adapter::invoke_remote (TAO_Stub *stub,
+ TAO_Operation_Details &op
+ ACE_ENV_ARG_DECL)
+ {
+ CORBA::Object *local_target = this->target_;
+
+ ACE_Time_Value tmp_wait_time;
+ bool is_timeout =
+ this->get_timeout (tmp_wait_time);
+
+ ACE_Time_Value *max_wait_time = 0;
+
+ if (is_timeout)
+ max_wait_time = &tmp_wait_time;
+
+ // Initial state
+ TAO::Invocation_Status status = TAO_INVOKE_START;
+
+ while (status == TAO_INVOKE_START ||
+ status == TAO_INVOKE_RESTART)
+ {
+ Profile_Transport_Resolver resolver (local_target,
+ stub);
+
+ resolver.resolve (max_wait_time
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Update the request id now that we have a transport
+ op.request_id (resolver.transport ()->tms ()->request_id ());
+
+ if (this->type_ == TAO_ONEWAY_INVOCATION)
+ {
+ int has_synchronization = 0;
+ Messaging::SyncScope sync_scope;
+ stub->orb_core ()->call_sync_scope_hook (stub,
+ has_synchronization,
+ sync_scope);
+
+ op.response_flags (sync_scope);
+
+ TAO::Synch_Oneway_Invocation synch (resolver,
+ op);
+
+ status =
+ synch.remote_oneway (max_wait_time
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else if (this->type_ == TAO_TWOWAY_INVOCATION
+ && this->mode_ == TAO_SYNCHRONOUS_INVOCATION)
+ {
+ // @@ NOTE:Need to change this to something better. Too many
+ // hash defines meaning the same thing..
+ op.response_flags (TAO_TWOWAY_RESPONSE_FLAG);
+ TAO::Synch_Twoway_Invocation synch (resolver,
+ op);
+
+ status =
+ synch.remote_twoway (max_wait_time
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (status == TAO_INVOKE_RESTART)
+ local_target = synch.steal_forwarded_reference ();
+ }
+ else if (this->type_ == TAO_TWOWAY_INVOCATION
+ && this->mode_ == TAO_ASYNCHRONOUS_CALLBACK_INVOCATION)
+ {
+ // Should never get here..
+ ACE_THROW (CORBA::INTERNAL (
+ CORBA::SystemException::_tao_minor_code (
+ TAO_DEFAULT_MINOR_CODE,
+ EINVAL),
+ CORBA::COMPLETED_NO));
+ }
+
+ }
+ }
+
+ bool
+ Invocation_Adapter::get_timeout (ACE_Time_Value &timeout)
+ {
+ bool has_timeout;
+ this->target_->orb_core ()->call_timeout_hook (this->target_->_stubobj (),
+ has_timeout,
+ timeout);
+
+ return has_timeout;
+ }
+
+} // End namespace TAO
diff --git a/TAO/tao/Invocation_Adapter.h b/TAO/tao/Invocation_Adapter.h
new file mode 100644
index 00000000000..bddf0cd8106
--- /dev/null
+++ b/TAO/tao/Invocation_Adapter.h
@@ -0,0 +1,129 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Invocation_Adapter.h
+ *
+ * $Id$
+ *
+ *
+ * @author Balachandran Natarajan <bala@dre.vanderbilt.edu>
+ */
+//=============================================================================
+#ifndef TAO_INVOCATION_ADAPTER_H
+#define TAO_INVOCATION_ADAPTER_H
+#include "ace/pre.h"
+
+#include "tao/TAO_Export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/CORBA_macros.h"
+#include "ace/Global_Macros.h"
+
+
+struct TAO_Exception_Data;
+class TAO_Operation_Details;
+class TAO_Stub;
+class ACE_Time_Value;
+namespace CORBA
+{
+ class Object;
+ class Environment;
+ class SystemException;
+}
+
+namespace TAO
+{
+ class Argument;
+
+ class Collocation_Proxy_Broker;
+
+ /// Enums for invocation types
+ enum Invocation_Type {
+ TAO_ONEWAY_INVOCATION,
+ TAO_TWOWAY_INVOCATION
+ // , TAO_LOCATEREQUEST_INVOCATION
+ };
+
+ /// Enum for invocation modes
+ enum Invocation_Mode {
+ /// Standard synchronous twoway
+ TAO_SYNCHRONOUS_INVOCATION,
+ /// Asynchronous twoway with callback model for collecting the
+ /// replies.
+ TAO_ASYNCHRONOUS_CALLBACK_INVOCATION,
+ /// Asynchronous twoway with poller model for collecting the
+ /// replies.
+ /// @NOTE: This is not supported in TAO now
+ TAO_ASYNCHRONOUS_POLLER_INVOCATION
+ };
+
+ /**
+ * @class Invocation_Adapter
+ *
+ * @brief Generic interface for the invocation object visible to the
+ * IDL compiler.
+ *
+ */
+ class TAO_Export Invocation_Adapter
+ {
+ public:
+ Invocation_Adapter (CORBA::Object *target,
+ Argument **args,
+ int arg_number,
+ char *operation,
+ int op_len,
+ Collocation_Proxy_Broker *b,
+ TAO::Invocation_Type type = TAO_TWOWAY_INVOCATION,
+ TAO::Invocation_Mode mode = TAO_SYNCHRONOUS_INVOCATION);
+
+
+ void invoke (TAO_Exception_Data *ex,
+ unsigned long ex_count
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ protected:
+
+ void invoke_collocated (TAO_Stub *,
+ TAO_Operation_Details &op
+ ACE_ENV_ARG_DECL);
+
+ void invoke_remote (TAO_Stub *,
+ TAO_Operation_Details &op
+ ACE_ENV_ARG_DECL);
+
+ bool get_timeout (ACE_Time_Value &val);
+
+ private:
+ /// Dont allow default initializations
+ ACE_UNIMPLEMENTED_FUNC (Invocation_Adapter (void));
+
+ ACE_UNIMPLEMENTED_FUNC (Invocation_Adapter & operator= (const Invocation_Adapter &));
+
+ private:
+
+ CORBA::Object *target_;
+
+ Argument **args_;
+
+ int number_args_;
+
+ const char *operation_;
+
+ int op_len_;
+
+ Collocation_Proxy_Broker *cpb_;
+
+ Invocation_Type type_;
+
+ Invocation_Mode mode_;
+ };
+} // End namespace TAO
+
+
+#include "ace/post.h"
+#endif /*TAO_INVOCATION_ADAPTER_H*/
diff --git a/TAO/tao/Invocation_Base.cpp b/TAO/tao/Invocation_Base.cpp
index 0f8055274a7..d4357c8a019 100644
--- a/TAO/tao/Invocation_Base.cpp
+++ b/TAO/tao/Invocation_Base.cpp
@@ -1,131 +1,116 @@
-//$Id$
#include "Invocation_Base.h"
-#include "Object.h"
-#include "Profile_Transport_Resolver.h"
-#include "operation_details.h"
#include "Stub.h"
-#include "ORB_Core.h"
-//@@ Need to remove when we take care o fthe note below.
-#include "corbafwd.h"
-#include "Synch_Invocation.h"
-#include "Transport.h"
-#include "Transport_Mux_Strategy.h"
-#include "Messaging_SyncScopeC.h"
+#include "operation_details.h"
+#include "RequestInfo_Util.h"
ACE_RCSID (tao,
Invocation_Base,
"$Id$")
-
namespace TAO
{
-Invocation_Base::Invocation_Base (CORBA::Object *target,
- Argument **args,
- int arg_number,
- char *operation,
- int op_len,
- Invocation_Type type,
- Invocation_Mode mode)
- : target_ (target)
- , args_ (args)
- , number_args_ (arg_number)
- , operation_ (operation)
- , op_len_ (op_len)
- , type_ (type)
- , mode_ (mode)
+ // Need to move many methods in here to the inlined files..
+ Invocation_Base::Invocation_Base (TAO_Stub *stub,
+ TAO_Operation_Details &details)
+ : details_ (details)
+ , forwarded_to_ (0)
+ , stub_ (stub) // @@ Do we need to increment refcount
{
}
+ Invocation_Base::~Invocation_Base (void)
+ {
+ }
+
+ TAO_ORB_Core *
+ Invocation_Base::orb_core (void) const
+ {
+ return this->stub_->orb_core ();
+ }
void
- Invocation_Base::invoke (TAO_Exception_Data *ex_data,
- unsigned long ex_count
- ACE_ENV_ARG_DECL)
+ Invocation_Base::forwarded_reference (CORBA::Object_ptr o)
+ {
+ this->forwarded_to_ = CORBA::Object::_duplicate (o);
+ }
+
+ CORBA::Object_ptr
+ Invocation_Base::forwarded_reference (void)
+ {
+ return CORBA::Object::_duplicate (this->forwarded_to_.in ());
+ }
+
+ CORBA::Object_ptr
+ Invocation_Base::steal_forwarded_reference (void)
+ {
+ return this->forwarded_to_._retn ();
+ }
+
+ bool
+ Invocation_Base::is_forwarded (void) const
+ {
+ return (this->forwarded_to_.in () != 0);
+ }
+
+ char *
+ Invocation_Base::operation_name (void)
+ {
+ return ACE_const_cast (char *, this->details_.opname ());
+ }
+
+ Dynamic::ParameterList *
+ Invocation_Base::arguments (ACE_ENV_SINGLE_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException))
{
- // Should stub object be refcounted here?
- TAO_Stub *stub =
- this->target_->_stubobj ();
-
- if (stub == 0)
- ACE_THROW (CORBA::INTERNAL (
- CORBA::SystemException::_tao_minor_code (
- TAO_DEFAULT_MINOR_CODE,
- EINVAL),
- CORBA::COMPLETED_NO));
-
-
- // @@ Note: We may want somthing like this for FT
- /*if (stub->orb_core ()->is_service_invocation ())
- return stub->orb_core ()->invoke_services ();
- */
-
- // Initial state
- TAO::Invocation_Status status = TAO_INVOKE_START;
-
- TAO_Operation_Details op_details (this->operation_,
- this->op_len_,
- this->number_args_ != 0,
- ex_data,
- ex_count);
-
- while (status == TAO_INVOKE_START ||
- status == TAO_INVOKE_RESTART)
- {
- Profile_Transport_Resolver resolver (stub);
-
- resolver.resolve (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_CHECK;
-
- // Update the request id now that we have a transport
- op_details.request_id (resolver.transport ()->tms ()->request_id ());
-
- if (this->type_ == TAO_ONEWAY_INVOCATION)
- {
- int has_synchronization = 0;
- Messaging::SyncScope sync_scope;
- stub->orb_core ()->call_sync_scope_hook (stub,
- has_synchronization,
- sync_scope);
-
- op_details.response_flags (sync_scope);
-
- TAO::Synch_Oneway_Invocation synch (resolver,
- op_details);
-
- status =
- synch.remote_oneway (this->args_,
- this->number_args_
- ACE_ENV_ARG_PARAMETER);
- ACE_CHECK;
- }
- else if (this->type_ == TAO_TWOWAY_INVOCATION
- && this->mode_ == TAO_SYNCHRONOUS_INVOCATION)
- {
- // @@ NOTE:Need to change this to something better. Too many
- // hash defines meaning the same thing..
- op_details.response_flags (TAO_TWOWAY_RESPONSE_FLAG);
- TAO::Synch_Twoway_Invocation synch (resolver,
- op_details);
-
- status =
- synch.remote_twoway (this->args_,
- this->number_args_
- ACE_ENV_ARG_PARAMETER);
- ACE_CHECK;
- }
- else if (this->type_ == TAO_TWOWAY_INVOCATION
- && this->mode_ == TAO_ASYNCHRONOUS_CALLBACK_INVOCATION)
- {
- // Should never get here..
- ACE_THROW (CORBA::INTERNAL (
- CORBA::SystemException::_tao_minor_code (
- TAO_DEFAULT_MINOR_CODE,
- EINVAL),
- CORBA::COMPLETED_NO));
- }
- }
+ // Generate the argument list on demand.
+ Dynamic::ParameterList *parameter_list =
+ TAO_RequestInfo_Util::make_parameter_list (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ Dynamic::ParameterList_var safe_parameter_list = parameter_list;
+
+ if (this->details_.parameter_list (*parameter_list) == false)
+ ACE_THROW_RETURN (CORBA::MARSHAL (),
+ 0);
+
+ return safe_parameter_list._retn ();
}
+ Dynamic::ExceptionList *
+ Invocation_Base::exceptions (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ // Generate the argument list on demand.
+ Dynamic::ExceptionList *exception_list =
+ TAO_RequestInfo_Util::make_exception_list (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ Dynamic::ExceptionList_var safe_exception_list = exception_list;
+
+ if (this->details_.exception_list (*exception_list) == false)
+ ACE_THROW_RETURN (CORBA::MARSHAL (),
+ 0);
+
+ return safe_exception_list._retn ();
+ }
-} // End namespace TAO
+ CORBA::Octet
+ Invocation_Base::sync_scope (void) const
+ {
+ return this->details_.response_flags ();
+ }
+
+ TAO_Service_Context &
+ Invocation_Base::request_service_context (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ return this->details_.request_service_context ();
+ }
+
+ TAO_Service_Context &
+ Invocation_Base::reply_service_context (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ return this->details_.request_service_context ();
+ }
+}
diff --git a/TAO/tao/Invocation_Base.h b/TAO/tao/Invocation_Base.h
index 702b36c0028..7656ab976c5 100644
--- a/TAO/tao/Invocation_Base.h
+++ b/TAO/tao/Invocation_Base.h
@@ -14,97 +14,87 @@
#define TAO_INVOCATION_BASE_H
#include "ace/pre.h"
-#include "tao/TAO_Export.h"
+#include "tao/Object.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
-#include "ace/CORBA_macros.h"
-#include "ace/Global_Macros.h"
-
-
-struct TAO_Exception_Data;
-
-namespace CORBA
+namespace Dynamic
{
- class Object;
- class Environment;
- class SystemException;
+ class ExceptionList;
+ class ParameterList;
}
+class TAO_Service_Context;
+class TAO_Operation_Details;
+
namespace TAO
{
- class Argument;
-
- /// Enums for invocation types
- enum Invocation_Type {
- TAO_ONEWAY_INVOCATION,
- TAO_TWOWAY_INVOCATION
- // , TAO_LOCATEREQUEST_INVOCATION
- };
-
- /// Enum for invocation modes
- enum Invocation_Mode {
- /// Standard synchronous twoway
- TAO_SYNCHRONOUS_INVOCATION,
- /// Asynchronous twoway with callback model for collecting the
- /// replies.
- TAO_ASYNCHRONOUS_CALLBACK_INVOCATION,
- /// Asynchronous twoway with poller model for collecting the
- /// replies.
- /// @NOTE: This is not supported in TAO now
- TAO_ASYNCHRONOUS_POLLER_INVOCATION
- };
+ class Profile_Transport_Resolver;
+ class Invocation_Adapter;
+
+ enum Invocation_Status
+ {
+ TAO_INVOKE_START,
+ /// The request must be restarted, a temporary failure has ocurred.
+ TAO_INVOKE_RESTART,
+ /// invoke() call successful.
+ TAO_INVOKE_SUCCESS,
+ TAO_INVOKE_FAILURE
+ };
/**
* @class Invocation_Base
*
- * @brief Generic interface for the invocation object visible to the
- * IDL compiler.
+ * @brief
*
*/
class TAO_Export Invocation_Base
{
public:
- Invocation_Base (CORBA::Object *target,
- Argument **args,
- int arg_number,
- char *operation,
- int op_len,
- TAO::Invocation_Type type = TAO_TWOWAY_INVOCATION,
- TAO::Invocation_Mode mode = TAO_SYNCHRONOUS_INVOCATION);
-
-
- void invoke (TAO_Exception_Data *ex,
- unsigned long ex_count
- ACE_ENV_ARG_DECL)
+ friend class Invocation_Adapter;
+
+ virtual ~Invocation_Base (void);
+ TAO_ORB_Core *orb_core (void) const;
+
+ CORBA::Object_ptr forwarded_reference (void);
+
+ char *operation_name (void);
+ Dynamic::ParameterList *arguments (ACE_ENV_SINGLE_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException));
- private:
- /// Dont allow default initializations
- ACE_UNIMPLEMENTED_FUNC (Invocation_Base (void));
+ Dynamic::ExceptionList *exceptions (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
- ACE_UNIMPLEMENTED_FUNC (Invocation_Base & operator= (const Invocation_Base &));
+ TAO_Service_Context &request_service_context (void);
+ TAO_Service_Context &reply_service_context (void);
- private:
+ CORBA::Octet sync_scope (void) const;
+ CORBA::Object_ptr steal_forwarded_reference (void);
- CORBA::Object *target_;
+ bool is_forwarded (void) const;
- Argument **args_;
+ protected:
- int number_args_;
+ Invocation_Base (TAO_Stub *stub,
+ TAO_Operation_Details &op);
- const char *operation_;
+ void forwarded_reference (CORBA::Object_ptr o);
- int op_len_;
+ protected:
- Invocation_Type type_;
+ TAO_Operation_Details &details_;
+ CORBA::Object_var forwarded_to_;
- Invocation_Mode mode_;
- };
-} // End namespace TAO
+ private:
+
+ ACE_UNIMPLEMENTED_FUNC (Invocation_Base & operator= (const Invocation_Base &));
+ private:
+ TAO_Stub *stub_;
+ };
+}
#include "ace/post.h"
#endif /*TAO_INVOCATION_BASE_H*/
diff --git a/TAO/tao/Invocation_Endpoint_Selectors.cpp b/TAO/tao/Invocation_Endpoint_Selectors.cpp
index 08ec6219a21..18b5ed2dc75 100644
--- a/TAO/tao/Invocation_Endpoint_Selectors.cpp
+++ b/TAO/tao/Invocation_Endpoint_Selectors.cpp
@@ -63,8 +63,9 @@ TAO_Default_Endpoint_Selector::select_endpoint (
void
TAO_Default_Endpoint_Selector::select_endpoint (
- TAO::Profile_Transport_Resolver *r
- ACE_ENV_ARG_DECL)
+ TAO::Profile_Transport_Resolver *r,
+ ACE_Time_Value *max_wait_time
+ ACE_ENV_ARG_DECL)
{
do
{
@@ -79,7 +80,9 @@ TAO_Default_Endpoint_Selector::select_endpoint (
for (size_t i = 0; i < endpoint_count; ++i)
{
bool retval =
- r->try_connect (ep ACE_ENV_ARG_PARAMETER);
+ r->try_connect (ep,
+ max_wait_time
+ ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
// Check if the connect has completed.
diff --git a/TAO/tao/Invocation_Endpoint_Selectors.h b/TAO/tao/Invocation_Endpoint_Selectors.h
index 59edbe4f256..2bb8f1fc5f6 100644
--- a/TAO/tao/Invocation_Endpoint_Selectors.h
+++ b/TAO/tao/Invocation_Endpoint_Selectors.h
@@ -29,6 +29,7 @@
class TAO_MProfile;
class TAO_GIOP_Invocation;
+class ACE_Time_Value;
namespace TAO
{
@@ -63,7 +64,8 @@ public:
virtual void select_endpoint (TAO_GIOP_Invocation *invocation
ACE_ENV_ARG_DECL) = 0;
- virtual void select_endpoint (TAO::Profile_Transport_Resolver *r
+ virtual void select_endpoint (TAO::Profile_Transport_Resolver *r,
+ ACE_Time_Value *val
ACE_ENV_ARG_DECL) = 0;
/**
@@ -111,7 +113,8 @@ public:
virtual void select_endpoint (TAO_GIOP_Invocation *invocation
ACE_ENV_ARG_DECL);
- virtual void select_endpoint (TAO::Profile_Transport_Resolver *r
+ virtual void select_endpoint (TAO::Profile_Transport_Resolver *r,
+ ACE_Time_Value *val
ACE_ENV_ARG_DECL);
virtual void forward (TAO_GIOP_Invocation *invocation,
const TAO_MProfile &mprofile
diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp
index 8c3317622e4..764cb46eecf 100644
--- a/TAO/tao/ORB_Core.cpp
+++ b/TAO/tao/ORB_Core.cpp
@@ -2624,7 +2624,7 @@ TAO_ORB_Core::stubless_sync_scope (void)
void
TAO_ORB_Core::call_timeout_hook (TAO_Stub *stub,
- int &has_timeout,
+ bool &has_timeout,
ACE_Time_Value &time_value)
{
Timeout_Hook timeout_hook =
@@ -2632,10 +2632,11 @@ TAO_ORB_Core::call_timeout_hook (TAO_Stub *stub,
if (timeout_hook == 0)
{
- has_timeout = 0;
+ has_timeout = false;
return;
}
(*timeout_hook) (this, stub, has_timeout, time_value);
+ has_timeout = true;
}
void
@@ -2686,7 +2687,7 @@ TAO_ORB_Core::stubless_relative_roundtrip_timeout (void)
void
TAO_ORB_Core::connection_timeout (TAO_Stub *stub,
- int &has_timeout,
+ bool &has_timeout,
ACE_Time_Value &time_value)
{
Timeout_Hook connection_timeout_hook =
@@ -2694,11 +2695,12 @@ TAO_ORB_Core::connection_timeout (TAO_Stub *stub,
if (connection_timeout_hook == 0)
{
- has_timeout = 0;
+ has_timeout = false;
return;
}
(*connection_timeout_hook) (this, stub, has_timeout, time_value);
+ has_timeout = true;
}
void
@@ -2933,6 +2935,48 @@ TAO_ORB_Core_instance (void)
}
+TAO::Collocation_Strategy
+TAO_ORB_Core::collocation_strategy_new (CORBA::Object_ptr object
+ ACE_ENV_ARG_DECL)
+{
+
+ TAO_Stub *stub = object->_stubobj ();
+ if (!CORBA::is_nil (stub->servant_orb_var ().in ()) &&
+ stub->servant_orb_var ()->orb_core () != 0)
+ {
+ TAO_ORB_Core *orb_core =
+ stub->servant_orb_var ()->orb_core ();
+
+ int collocated =
+ orb_core->collocation_resolver ().is_collocated (object
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (collocated)
+ {
+ switch (stub->servant_orb_var ()->orb_core ()->get_collocation_strategy ())
+ {
+ case THRU_POA:
+ return TAO::TAO_CS_THRU_POA_STRATEGY;
+
+ case DIRECT:
+ {
+ /////////////////////////////////////////////////////////////
+ // If the servant is null and you are collocated this means
+ // that the POA policy NON-RETAIN is set, and with that policy
+ // using the DIRECT collocation strategy is just insane.
+ /////////////////////////////////////////////////////////////
+ ACE_ASSERT (object->_servant () != 0);
+ return TAO::TAO_CS_DIRECT_STRATEGY;
+ }
+ }
+ }
+ }
+
+ // In this case the Object is a client.
+ return TAO::TAO_CS_REMOTE_STRATEGY;
+}
+
int
TAO_ORB_Core::collocation_strategy (CORBA::Object_ptr object
ACE_ENV_ARG_DECL)
diff --git a/TAO/tao/ORB_Core.h b/TAO/tao/ORB_Core.h
index f309480a1d6..2561d91c567 100644
--- a/TAO/tao/ORB_Core.h
+++ b/TAO/tao/ORB_Core.h
@@ -276,6 +276,9 @@ public:
* @note
* No-Collocation is a special case of collocation.
*/
+ static TAO::Collocation_Strategy collocation_strategy_new (CORBA::Object_ptr object
+ ACE_ENV_ARG_DECL);
+
static int collocation_strategy (CORBA::Object_ptr object
ACE_ENV_ARG_DECL);
//@}
@@ -576,13 +579,13 @@ public:
* thread and current ORB.
*/
void call_timeout_hook (TAO_Stub *stub,
- int &has_timeout,
+ bool &has_timeout,
ACE_Time_Value &time_value);
/// Define the Timeout_Hook signature
typedef void (*Timeout_Hook) (TAO_ORB_Core *,
TAO_Stub *,
- int&,
+ bool&,
ACE_Time_Value&);
static void set_timeout_hook (Timeout_Hook hook);
@@ -603,7 +606,7 @@ public:
* thread and current ORB.
*/
void connection_timeout (TAO_Stub *stub,
- int &has_timeout,
+ bool &has_timeout,
ACE_Time_Value &time_value);
/// Define the Timeout_Hook signature
diff --git a/TAO/tao/Profile_Transport_Resolver.cpp b/TAO/tao/Profile_Transport_Resolver.cpp
index caf61e038bc..73d966ac81b 100644
--- a/TAO/tao/Profile_Transport_Resolver.cpp
+++ b/TAO/tao/Profile_Transport_Resolver.cpp
@@ -9,6 +9,8 @@
#include "Codeset_Manager.h"
#include "Connector_Registry.h"
#include "Transport_Connector.h"
+#include "Object.h"
+
ACE_RCSID (tao,
Profile_Transport_Resolver,
@@ -16,8 +18,10 @@ ACE_RCSID (tao,
namespace TAO
{
- Profile_Transport_Resolver::Profile_Transport_Resolver (TAO_Stub *stub)
- : stub_ (stub)
+ Profile_Transport_Resolver::Profile_Transport_Resolver (CORBA::Object *p,
+ TAO_Stub *stub)
+ : obj_ (p)
+ , stub_ (stub)
, transport_ (0)
, profile_ (0)
{
@@ -28,8 +32,11 @@ namespace TAO
if (this->profile_)
this->profile_->_decr_refcnt ();
- this->transport_->make_idle ();
- TAO_Transport::release (this->transport_);
+ if (this->transport_)
+ {
+ this->transport_->make_idle ();
+ TAO_Transport::release (this->transport_);
+ }
}
TAO_Stub *
@@ -38,6 +45,12 @@ namespace TAO
return this->stub_;
}
+ CORBA::Object_ptr
+ Profile_Transport_Resolver::object (void) const
+ {
+ return CORBA::Object::_duplicate (this->obj_);
+ }
+
void
Profile_Transport_Resolver::profile (TAO_Profile *p)
{
@@ -72,15 +85,19 @@ namespace TAO
void
- Profile_Transport_Resolver::resolve (ACE_ENV_SINGLE_ARG_DECL)
+ Profile_Transport_Resolver::resolve (ACE_Time_Value *max_time_val
+ ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException))
{
+ ACE_Countdown_Time countdown (max_time_val);
+
TAO_Invocation_Endpoint_Selector *es =
this->stub_->orb_core ()->endpoint_selector_factory ()->get_selector (
- ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
- es->select_endpoint (this
+ es->select_endpoint (this,
+ max_time_val
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
@@ -105,7 +122,8 @@ namespace TAO
}
bool
- Profile_Transport_Resolver::try_connect (TAO_Endpoint *ep
+ Profile_Transport_Resolver::try_connect (TAO_Endpoint *ep,
+ ACE_Time_Value *max_time_value
ACE_ENV_ARG_DECL)
{
TAO_Connector_Registry *conn_reg =
@@ -122,24 +140,19 @@ namespace TAO
0);
}
- // Get the max_wait_time
+ ACE_Time_Value connection_timeout;
+
+ bool is_conn_timeout =
+ this->get_connection_timeout (connection_timeout);
+
+
ACE_Time_Value *max_wait_time = 0;
-// ACE_Time_Value connection_timeout;
- int is_conn_timeout = 0;
-#if 0
- // Check for the connection timout policy in the ORB
- this->orb_core ()->connection_timeout (this->stub (),
- is_conn_timeout,
- connection_timeout);
-
- // If a connection timeout policy is set, use that as the timeout
- // value.
- if (!is_conn_timeout)
- max_wait_time =
- this->max_wait_time ();
- else
- max_wait_time = &connection_timeout;
-#endif /*fi 0*/
+
+ if (is_conn_timeout == true)
+ max_wait_time = &connection_timeout;
+ else
+ max_wait_time = max_time_value;
+
// Obtain a connection.
this->transport_ =
conn_reg->get_connector (ep)->connect (this,
@@ -149,20 +162,17 @@ namespace TAO
ACE_CHECK_RETURN (false);
// A timeout error occurred
- if (this->transport_ == 0 && errno == ETIME)
+ // If the user has set a roundtrip timeout policy, then throw a
+ // timeout exception, else just fall through and return false to
+ // look at the next endpoint
+ if (this->transport_ == 0 && errno == ETIME && is_conn_timeout == false)
{
- // If the user has set a roundtrip timeout policy, then throw a
- // timeout exception, else just fall through and return 0 to
- // look at the next endpoint
- if (!is_conn_timeout)
- {
- ACE_THROW_RETURN (CORBA::TIMEOUT (
- CORBA::SystemException::_tao_minor_code (
+ ACE_THROW_RETURN (CORBA::TIMEOUT (
+ CORBA::SystemException::_tao_minor_code (
TAO_TIMEOUT_CONNECT_MINOR_CODE,
errno),
- CORBA::COMPLETED_NO),
- false);
- }
+ CORBA::COMPLETED_NO),
+ false);
}
else if (this->transport_ == 0)
return false;
@@ -170,5 +180,17 @@ namespace TAO
return true;
}
+ bool
+ Profile_Transport_Resolver::get_connection_timeout (ACE_Time_Value &max_wait_time)
+ {
+ bool is_conn_timeout = false;
+
+ // Check for the connection timout policy in the ORB
+ this->stub_->orb_core ()->connection_timeout (this->stub_,
+ is_conn_timeout,
+ max_wait_time);
+
+ return is_conn_timeout;
+ }
}
diff --git a/TAO/tao/Profile_Transport_Resolver.h b/TAO/tao/Profile_Transport_Resolver.h
index a1b62222eb9..b5b1d7b5281 100644
--- a/TAO/tao/Profile_Transport_Resolver.h
+++ b/TAO/tao/Profile_Transport_Resolver.h
@@ -27,14 +27,18 @@ class TAO_Stub;
class TAO_Profile;
class TAO_Transport;
class TAO_Endpoint;
+class ACE_Time_Value;
namespace CORBA
{
class SystemException;
class Environment;
+ class Object;
}
namespace TAO
{
+ class Synch_Twoway_Invocation;
+
/**
* @class Connection_Resolver
*
@@ -42,11 +46,13 @@ namespace TAO
class TAO_Export Profile_Transport_Resolver
{
public:
- Profile_Transport_Resolver (TAO_Stub *);
+ Profile_Transport_Resolver (CORBA::Object *p,
+ TAO_Stub *);
~Profile_Transport_Resolver (void);
- void resolve (ACE_ENV_SINGLE_ARG_DECL)
+ void resolve (ACE_Time_Value *val
+ ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException));
void profile (TAO_Profile *pfile);
@@ -55,12 +61,21 @@ namespace TAO
TAO_Stub *stub (void) const;
- bool try_connect (TAO_Endpoint *
+ CORBA::Object *object (void) const;
+
+ bool try_connect (TAO_Endpoint *,
+ ACE_Time_Value *val
ACE_ENV_ARG_DECL);
TAO_Transport *transport (void) const;
private:
+
+ bool get_connection_timeout (ACE_Time_Value &max_wait_time);
+
+ private:
+ mutable CORBA::Object *obj_;
+
TAO_Stub *stub_;
TAO_Transport *transport_;
diff --git a/TAO/tao/Remote_Invocation.cpp b/TAO/tao/Remote_Invocation.cpp
index 984bda6386c..460e32b98a7 100644
--- a/TAO/tao/Remote_Invocation.cpp
+++ b/TAO/tao/Remote_Invocation.cpp
@@ -6,6 +6,7 @@
#include "IOP_IORC.h"
#include "Stub.h"
#include "Transport.h"
+#include "operation_details.h"
ACE_RCSID (tao,
Remote_Invocation,
@@ -15,8 +16,8 @@ namespace TAO
{
Remote_Invocation::Remote_Invocation (Profile_Transport_Resolver &resolver,
TAO_Operation_Details &detail)
- : resolver_ (resolver)
- , detail_ (detail)
+ : Invocation_Base (resolver.stub (), detail)
+ , resolver_ (resolver)
{
}
@@ -81,7 +82,7 @@ namespace TAO
ACE_ENV_ARG_DECL)
{
// Send the request for the header
- if (this->resolver_.transport ()->generate_request_header (this->detail_,
+ if (this->resolver_.transport ()->generate_request_header (this->details_,
spec,
out_stream)
== -1)
@@ -94,22 +95,20 @@ namespace TAO
}
void
- Remote_Invocation::marshal_data (Argument **args,
- int args_number,
- TAO_OutputCDR &out_stream
+ Remote_Invocation::marshal_data (TAO_OutputCDR &out_stream
ACE_ENV_ARG_DECL)
{
- for (int i = 0; i != args_number; ++i)
- {
- if (!((*args[i]).marshal (out_stream)))
- ACE_THROW (CORBA::MARSHAL ());
- }
+ if (this->details_.marshal_args (out_stream) == false)
+ ACE_THROW (CORBA::MARSHAL ());
+
+ return;
}
Invocation_Status
Remote_Invocation::send_message (TAO_OutputCDR &cdr,
- short message_semantics
- ACE_ENV_ARG_DECL_NOT_USED)
+ short message_semantics,
+ ACE_Time_Value *max_wait_time
+ ACE_ENV_ARG_DECL)
{
int retval =
this->resolver_.transport ()->send_request (
@@ -117,19 +116,36 @@ namespace TAO
this->resolver_.stub ()->orb_core (),
cdr,
message_semantics,
- 0);
+ max_wait_time);
- if (retval != 0)
+ if (retval == -1)
{
+ if (errno == ETIME)
+ {
+ ACE_THROW_RETURN (
+ CORBA::TIMEOUT (
+ CORBA::SystemException::_tao_minor_code (
+ TAO_TIMEOUT_SEND_MINOR_CODE,
+ errno
+ ),
+ CORBA::COMPLETED_NO
+ ),
+ TAO_INVOKE_FAILURE
+ );
+ }
if (TAO_debug_level > 2)
ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("(%P|%t) Synch_Twoway_Invocation::send_message - ")
+ ACE_TEXT ("(%P|%t) Remote_Invocation::send_message - ")
ACE_TEXT ("failure while sending message \n")));
- // Need to close connections..
+ // Close the transport and all the associated stuff along with
+ // it.
+ this->resolver_.transport ()->close_connection ();
return TAO_INVOKE_RESTART;
}
+
+ this->resolver_.stub ()->set_valid_profile ();
return TAO_INVOKE_SUCCESS;
}
}
diff --git a/TAO/tao/Remote_Invocation.h b/TAO/tao/Remote_Invocation.h
index 7285a49abc5..a53ae3b0b63 100644
--- a/TAO/tao/Remote_Invocation.h
+++ b/TAO/tao/Remote_Invocation.h
@@ -20,6 +20,7 @@
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
+#include "tao/Invocation_Base.h"
#include "ace/CORBA_macros.h"
@@ -38,22 +39,14 @@ namespace TAO
class Argument;
- enum Invocation_Status
- {
- TAO_INVOKE_START,
- /// The request must be restarted, a temporary failure has ocurred.
- TAO_INVOKE_RESTART,
- /// invoke() call successful.
- TAO_INVOKE_SUCCESS,
- TAO_INVOKE_FAILURE
- };
+
/**
- * @class Synch_Invocation
+ * @class Remote_Invocation
*
* @brief Base class for Twoway_Invocation and Oneway_Invocation.
*
*/
- class TAO_Export Remote_Invocation
+ class TAO_Export Remote_Invocation : protected Invocation_Base
{
public:
Remote_Invocation (Profile_Transport_Resolver &resolver,
@@ -68,17 +61,16 @@ namespace TAO
TAO_OutputCDR &out_stream
ACE_ENV_ARG_DECL);
- void marshal_data (Argument **args,
- int args_number,
- TAO_OutputCDR &cdr
+ void marshal_data (TAO_OutputCDR &cdr
ACE_ENV_ARG_DECL);
Invocation_Status send_message (TAO_OutputCDR &cdr,
- short message_semantics
+ short message_semantics,
+ ACE_Time_Value *max_wait_time
ACE_ENV_ARG_DECL);
+
protected:
Profile_Transport_Resolver &resolver_;
- TAO_Operation_Details &detail_;
};
}
diff --git a/TAO/tao/Stub.h b/TAO/tao/Stub.h
index 7709074a34f..ff6196b1c60 100644
--- a/TAO/tao/Stub.h
+++ b/TAO/tao/Stub.h
@@ -67,6 +67,9 @@ struct TAO_Exception_Data
/// The allocator for this exception.
TAO_Exception_Alloc alloc;
+
+ /// The typecode pointer for this exception.
+ CORBA::TypeCode_ptr tc_ptr;
};
/**
diff --git a/TAO/tao/Synch_Invocation.cpp b/TAO/tao/Synch_Invocation.cpp
index a2c6b49bce4..0825460449c 100644
--- a/TAO/tao/Synch_Invocation.cpp
+++ b/TAO/tao/Synch_Invocation.cpp
@@ -25,16 +25,17 @@ namespace TAO
}
Invocation_Status
- Synch_Twoway_Invocation::remote_twoway (Argument **args,
- int args_number
- ACE_ENV_ARG_DECL)
+ Synch_Twoway_Invocation::remote_twoway (ACE_Time_Value *max_wait_time
+ ACE_ENV_SINGLE_ARG_DECL)
{
+ ACE_Countdown_Time countdown (max_wait_time);
+
TAO_Synch_Reply_Dispatcher rd (this->resolver_.stub ()->orb_core (),
- this->detail_.reply_service_info ());
+ this->details_.reply_service_info ());
// Register a reply dispatcher for this invocation. Use the
// preallocated reply dispatcher.
- TAO_Bind_Dispatcher_Guard dispatch_guard (this->detail_.request_id (),
+ TAO_Bind_Dispatcher_Guard dispatch_guard (this->details_.request_id (),
&rd,
this->resolver_.transport ()->tms ());
@@ -61,22 +62,25 @@ namespace TAO
ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (TAO_INVOKE_FAILURE);
- this->marshal_data (args,
- args_number,
- cdr
+ this->marshal_data (cdr
ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (TAO_INVOKE_FAILURE);
+ countdown.update ();
+
Invocation_Status s =
this->send_message (cdr,
- TAO_Transport::TAO_TWOWAY_REQUEST
+ TAO_Transport::TAO_TWOWAY_REQUEST,
+ max_wait_time
ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (s);
if (s != TAO_INVOKE_SUCCESS)
return s;
+ countdown.update ();
+
// @@ In all MT environments, there's a cancellation point lurking
// here; need to investigate. Client threads would frequently be
// canceled sometime during recv_request ... the correct action to
@@ -94,22 +98,90 @@ namespace TAO
// (explicitly coded) handlers called. We assume a POSIX.1c/C/C++
// environment.
- this->resolver_.transport ()->wait_strategy ()->wait (0,
- rd);
+ s =
+ this->wait_for_reply (max_wait_time,
+ rd,
+ dispatch_guard
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (TAO_INVOKE_FAILURE);
+
- return this->check_reply_status (rd,
- args,
- args_number
+ return this->check_reply_status (rd
ACE_ENV_ARG_PARAMETER);
}
+ Invocation_Status
+ Synch_Twoway_Invocation::wait_for_reply (ACE_Time_Value *max_wait_time,
+ TAO_Synch_Reply_Dispatcher &rd,
+ TAO_Bind_Dispatcher_Guard &bd
+ ACE_ENV_ARG_DECL)
+ {
+ int reply_error =
+ this->resolver_.transport ()->wait_strategy ()->wait (max_wait_time,
+ rd);
+ if (TAO_debug_level > 0 && max_wait_time != 0)
+ {
+ CORBA::ULong msecs = max_wait_time->msec ();
+
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO (%P|%t) - Synch_Twoway_Invocation::wait_for_reply, "
+ "timeout after recv is <%u> status <%d>\n",
+ msecs,
+ reply_error));
+ }
+
+ // Check the reply error.
+ if (reply_error == -1)
+ {
+ // Unbind the dispatcher, since its of no use at this point of
+ // time
+ if (TAO_debug_level > 3)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO (%P|%t) - Synch_Twoway_Invocation::wait_for_reply , "
+ "recovering after an error \n"));
+
+ if (errno == ETIME)
+ {
+ // If the unbind succeeds then thrown an exception to the
+ // application, else just collect the reply and dispatch that to the
+ // application.
+ // NOTE: A fragile synchronization is provided when using the Muxed
+ // Transport strategy. We could infact be a follower thread getting
+ // timedout in the LF whereas the dispatching thread could be
+ // on the reply_dispatcher that we created. This would lead bad
+ // crashes. To get around that, the call to unbind_dispatcher ()
+ // will wait on the lock on the Muxed_Transport_Strategy if
+ // dispatching has started. This is fragile.
+ if (bd.unbind_dispatcher () == 0)
+ {
+ // 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_FAILURE);
+ }
+ }
+
+ this->resolver_.transport ()->close_connection ();
+ this->resolver_.stub ()->reset_profiles ();
+
+ ACE_THROW_RETURN (CORBA::COMM_FAILURE (
+ CORBA::SystemException::_tao_minor_code (
+ TAO_INVOCATION_RECV_REQUEST_MINOR_CODE,
+ errno),
+ CORBA::COMPLETED_MAYBE),
+ TAO_INVOKE_FAILURE);
+ }
+ return TAO_INVOKE_SUCCESS;
+ }
Invocation_Status
- Synch_Twoway_Invocation::check_reply_status (TAO_Synch_Reply_Dispatcher &rd,
- Argument **args,
- int args_number
+ Synch_Twoway_Invocation::check_reply_status (TAO_Synch_Reply_Dispatcher &rd
ACE_ENV_ARG_DECL)
{
// Grab the reply CDR
@@ -129,12 +201,9 @@ namespace TAO
switch (rd.reply_status ())
{
case TAO_PLUGGABLE_MESSAGE_NO_EXCEPTION:
- for (i = 0; i != args_number; ++i)
- {
- if (!((*args[i]).demarshal (rd.reply_cdr ())))
- ACE_THROW_RETURN (CORBA::MARSHAL (),
- TAO_INVOKE_FAILURE);
- }
+ if (this->details_.demarshal_args (rd.reply_cdr ()) == false)
+ ACE_THROW_RETURN (CORBA::MARSHAL (),
+ TAO_INVOKE_FAILURE);
break;
case TAO_PLUGGABLE_MESSAGE_LOCATION_FORWARD:
// Handle the forwarding and return so the stub restarts the
@@ -204,8 +273,6 @@ namespace TAO
return TAO_INVOKE_OK;
}
// NOTREACHED.
-
-
case TAO_PLUGGABLE_MESSAGE_NEEDS_ADDRESSING_MODE:
{
// We have received an exception with a request to change the
@@ -241,9 +308,7 @@ namespace TAO
ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException))
{
- CORBA::Object_var forward_reference;
-
- if ((inp_stream >> forward_reference.out ()) == 0)
+ if ((inp_stream >> this->forwarded_to_.out ()) == 0)
{
ACE_THROW_RETURN (CORBA::MARSHAL (),
TAO_INVOKE_FAILURE);
@@ -251,7 +316,8 @@ namespace TAO
// The object pointer has to be changed to a TAO_Stub pointer
// in order to obtain the profiles.
- TAO_Stub *stubobj = forward_reference->_stubobj ();
+ TAO_Stub *stubobj =
+ this->forwarded_to_->_stubobj ();
if (stubobj == 0)
ACE_THROW_RETURN (CORBA::INTERNAL (),
@@ -290,7 +356,7 @@ namespace TAO
}
CORBA::Exception *exception =
- this->detail_.corba_exception (buf.in ()
+ this->details_.corba_exception (buf.in ()
ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (TAO_INVOKE_FAILURE);
@@ -335,21 +401,20 @@ namespace TAO
Invocation_Status
- Synch_Oneway_Invocation::remote_oneway (Argument **args,
- int args_number
+ Synch_Oneway_Invocation::remote_oneway (ACE_Time_Value *max_wait_time
ACE_ENV_ARG_DECL)
{
+ ACE_Countdown_Time countdown (max_wait_time);
+
const CORBA::Octet response_flags =
- this->detail_.response_flags ();
+ this->details_.response_flags ();
if (response_flags == CORBA::Octet (Messaging::SYNC_WITH_SERVER) ||
response_flags == CORBA::Octet (Messaging::SYNC_WITH_TARGET))
- return Synch_Twoway_Invocation::remote_twoway (args,
- args_number
+ return Synch_Twoway_Invocation::remote_twoway (max_wait_time
ACE_ENV_ARG_PARAMETER);
-
TAO_Target_Specification tspec;
this->init_target_spec (tspec ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (TAO_INVOKE_FAILURE);
@@ -362,22 +427,23 @@ namespace TAO
ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (TAO_INVOKE_FAILURE);
- this->marshal_data (args,
- args_number,
- cdr
+ this->marshal_data (cdr
ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (TAO_INVOKE_FAILURE);
+ countdown.update ();
if (response_flags == CORBA::Octet (Messaging::SYNC_WITH_TRANSPORT))
{
return this->send_message (cdr,
- TAO_Transport::TAO_TWOWAY_REQUEST
+ TAO_Transport::TAO_TWOWAY_REQUEST,
+ max_wait_time
ACE_ENV_ARG_PARAMETER);
}
return this->send_message (cdr,
- TAO_Transport::TAO_ONEWAY_REQUEST
+ TAO_Transport::TAO_ONEWAY_REQUEST,
+ max_wait_time
ACE_ENV_ARG_PARAMETER);
}
diff --git a/TAO/tao/Synch_Invocation.h b/TAO/tao/Synch_Invocation.h
index bef1ae3bd5f..656c85f7dcd 100644
--- a/TAO/tao/Synch_Invocation.h
+++ b/TAO/tao/Synch_Invocation.h
@@ -14,18 +14,20 @@
#define TAO_SYNCH_INVOCATION_H
#include "ace/pre.h"
-#include "tao/TAO_Export.h"
+#include "tao/Remote_Invocation.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
-#include "tao/Remote_Invocation.h"
#include "ace/Global_Macros.h"
class TAO_Operation_Details;
class TAO_Synch_Reply_Dispatcher;
class TAO_InputCDR;
+class ACE_Time_Value;
+class TAO_Synch_Reply_Dispatcher;
+class TAO_Bind_Dispatcher_Guard;
namespace CORBA
{
@@ -36,14 +38,13 @@ namespace TAO
{
class Profile_Transport_Resolver;
- class TAO_Export Synch_Twoway_Invocation: public Remote_Invocation
+ class TAO_Export Synch_Twoway_Invocation: protected Remote_Invocation
{
public:
Synch_Twoway_Invocation (Profile_Transport_Resolver &resolver,
TAO_Operation_Details &detail);
- Invocation_Status remote_twoway (Argument **args,
- int args_number
+ Invocation_Status remote_twoway (ACE_Time_Value *max_wait_time
ACE_ENV_ARG_DECL);
protected:
@@ -56,24 +57,28 @@ namespace TAO
ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException));
+ Invocation_Status wait_for_reply (ACE_Time_Value *max_wait_time,
+ TAO_Synch_Reply_Dispatcher &rd,
+ TAO_Bind_Dispatcher_Guard &bd
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+
private:
- Invocation_Status check_reply_status (TAO_Synch_Reply_Dispatcher &rd,
- Argument **args,
- int args_number
+ Invocation_Status check_reply_status (TAO_Synch_Reply_Dispatcher &rd
ACE_ENV_ARG_DECL);
};
- class TAO_Export Synch_Oneway_Invocation: public Synch_Twoway_Invocation
+ class TAO_Export Synch_Oneway_Invocation: private Synch_Twoway_Invocation
{
public:
Synch_Oneway_Invocation (Profile_Transport_Resolver &resolver,
TAO_Operation_Details &detail);
- Invocation_Status remote_oneway (Argument **args,
- int args_number
+ Invocation_Status remote_oneway (ACE_Time_Value *max_wait_time
ACE_ENV_ARG_DECL);
};
}
diff --git a/TAO/tao/TODO b/TAO/tao/TODO
index 63ac211feec..ec0cebd93ba 100644
--- a/TAO/tao/TODO
+++ b/TAO/tao/TODO
@@ -8,6 +8,29 @@
. Test Location forwards
+. Test location forwards with collocated servants for remote servants
+ AND collcoated servants for collcoated servants.
+
. test user exceptions
. Move TAO_Exception_Data elsewhere
+
+. Remove extraneous calls and enums for collocation from
+corbafwd.h. and _new form ORB_Core.h
+
+. Test case for forwarded objects in collocated mode being remote
+. Messaging is broken
+
+
+. Work on connection timeout
+
+. Work on exception list for interceptoss in operation_details.cpp
+
+. Remove tao_queryinterface
+
+. Recursive location forwards is broken still.
+
+. Oneways and location forwards
+
+.
+
diff --git a/TAO/tao/corbafwd.h b/TAO/tao/corbafwd.h
index 7eb25bb0968..6eec56a43c3 100644
--- a/TAO/tao/corbafwd.h
+++ b/TAO/tao/corbafwd.h
@@ -71,8 +71,30 @@
#endif /* _MSC_VER */
/// Define symbolic names for the ORB collocation strategies.
-namespace TAO_Collocation_Strategies
+namespace TAO
{
+ enum Collocation_Strategy {
+ /// i.e no collocation.
+ TAO_CS_REMOTE_STRATEGY,
+
+ /// Calls to the collocated object are forwarded by the POA.
+ TAO_CS_THRU_POA_STRATEGY,
+
+ /// Calls to the collocated object are made directly to its
+ /// servant.
+ TAO_CS_DIRECT_STRATEGY,
+
+ /// This value should always be the last value in the enumeration.
+ /// It provides the count for the number of collocation
+ /// strategies.
+ TAO_CS_LAST
+ };
+}
+
+/// Define symbolic names for the ORB collocation strategies.
+/// @@Backward compatibililty to get things compiling.Needs removal.
+namespace TAO_Collocation_Strategies {
+
enum {
/// i.e no collocation.
CS_REMOTE_STRATEGY,
diff --git a/TAO/tao/operation_details.cpp b/TAO/tao/operation_details.cpp
index 5f932f8da23..7b64ca00a7a 100644
--- a/TAO/tao/operation_details.cpp
+++ b/TAO/tao/operation_details.cpp
@@ -1,6 +1,7 @@
//$Id$
-#include "tao/operation_details.h"
-#include "tao/Stub.h"
+#include "operation_details.h"
+#include "Stub.h"
+#include "Argument.h"
#if !defined (__ACE_INLINE__)
# include "tao/operation_details.i"
@@ -39,3 +40,56 @@ TAO_Operation_Details::corba_exception (const char *id
CORBA::COMPLETED_YES),
0);
}
+
+
+bool
+TAO_Operation_Details::marshal_args (TAO_OutputCDR &cdr)
+{
+ for (int i = 0; i != this->num_args_; ++i)
+ {
+ if (!((*this->args_[i]).marshal (cdr)))
+ return false;
+ }
+
+ return true;
+}
+
+bool
+TAO_Operation_Details::demarshal_args (TAO_InputCDR &cdr)
+{
+ for (int i = 0; i != this->num_args_; ++i)
+ {
+ if (!((*this->args_[i]).demarshal (cdr)))
+ return false;
+ }
+
+ return true;
+}
+
+bool
+TAO_Operation_Details::parameter_list (Dynamic::ParameterList &list)
+{
+ list.length (this->num_args_);
+
+ for (int i = 0; i != this->num_args_; ++i)
+ (*this->args_[i]).interceptor_param (list[i]);
+
+ return true;
+}
+
+
+bool
+TAO_Operation_Details::exception_list (Dynamic::ExceptionList &list)
+{
+ /*if (this->ex_count_)
+ {
+ list.length (this->ex_count_);
+
+ for (int i = 0; i != this->ex_count_; ++i)
+ {
+ if (!((*this->args_[i]).interceptor_param (list[i])))
+ return false;
+ }
+ }*/
+ return true;
+}
diff --git a/TAO/tao/operation_details.h b/TAO/tao/operation_details.h
index f5c424036cd..e2e8844eea4 100644
--- a/TAO/tao/operation_details.h
+++ b/TAO/tao/operation_details.h
@@ -29,6 +29,17 @@ namespace CORBA
{
class Exception;
}
+
+namespace Dynamic
+{
+ class ParameterList;
+ class ExceptionList;
+}
+namespace TAO
+{
+ class Argument;
+}
+
/**
* @class TAO_Operation_Details
*
@@ -48,6 +59,8 @@ public:
TAO_Operation_Details (const char *name,
CORBA::ULong len,
CORBA::Boolean argument_flag,
+ TAO::Argument **args = 0,
+ CORBA::ULong num_args = 0,
TAO_Exception_Data *ex_data = 0,
CORBA::Long ex_count = 0);
@@ -109,6 +122,13 @@ public:
CORBA::Exception *corba_exception (const char *ex
ACE_ENV_ARG_DECL);
+ bool marshal_args (TAO_OutputCDR &cdr);
+ bool demarshal_args (TAO_InputCDR &cdr);
+ bool parameter_list (Dynamic::ParameterList &);
+ bool exception_list (Dynamic::ExceptionList &);
+ TAO::Argument **args (void);
+ CORBA::ULong args_num (void) const ;
+
private:
/// Name of the operation being invoked.
@@ -138,15 +158,13 @@ private:
/// valid when sending a request.
TAO_Service_Context reply_service_info_;
- // The first element of header is service context list;
- // transactional context would be acquired here using the
- // transaction service APIs. Other kinds of context are as yet
- // undefined.
- //
-
/// Addressing mode for this request.
TAO_Target_Specification::TAO_Target_Address addressing_mode_;
+ TAO::Argument **args_;
+
+ CORBA::ULong num_args_;
+
/// The type of exceptions that the operations can throw.
TAO_Exception_Data *ex_data_;
diff --git a/TAO/tao/operation_details.i b/TAO/tao/operation_details.i
index b873a3b0dac..b13aa16c503 100644
--- a/TAO/tao/operation_details.i
+++ b/TAO/tao/operation_details.i
@@ -6,6 +6,8 @@ ACE_INLINE
TAO_Operation_Details::TAO_Operation_Details (const char *name,
CORBA::ULong len,
CORBA::Boolean argument_flag,
+ TAO::Argument **args,
+ CORBA::ULong num,
TAO_Exception_Data *data,
CORBA::Long count)
: opname_ (name)
@@ -14,6 +16,8 @@ TAO_Operation_Details::TAO_Operation_Details (const char *name,
, argument_flag_ (argument_flag)
, response_flags_ (0)
, addressing_mode_ (TAO_Target_Specification::Key_Addr)
+ , args_ (args)
+ , num_args_ (num)
, ex_data_ (data)
, ex_count_ (count)
{
@@ -161,3 +165,15 @@ TAO_Operation_Details::addressing_mode (CORBA::Short mode)
else if (mode == 2)
this->addressing_mode_ = TAO_Target_Specification::Reference_Addr;
}
+
+ACE_INLINE TAO::Argument **
+TAO_Operation_Details::args (void)
+{
+ return this->args_;
+}
+
+ACE_INLINE CORBA::ULong
+TAO_Operation_Details::args_num (void) const
+{
+ return this->num_args_;
+}