summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TAO/tao/GIOP_Server_Request.cpp268
-rw-r--r--TAO/tao/GIOP_Server_Request.h45
-rw-r--r--TAO/tao/GIOP_Server_Request.i54
-rw-r--r--TAO/tao/IIOP_Acceptor.cpp9
-rw-r--r--TAO/tao/IIOP_Acceptor.h6
-rw-r--r--TAO/tao/IIOP_Connect.cpp62
-rw-r--r--TAO/tao/IIOP_Connect.h21
-rw-r--r--TAO/tao/IIOP_Connector.cpp41
-rw-r--r--TAO/tao/IIOP_Connector.h12
-rw-r--r--TAO/tao/IIOP_Factory.h1
-rw-r--r--TAO/tao/IIOP_Profile.cpp3
-rw-r--r--TAO/tao/IIOP_Profile.h4
-rw-r--r--TAO/tao/IIOP_Profile.i2
-rw-r--r--TAO/tao/IIOP_Transport.cpp178
-rw-r--r--TAO/tao/IIOP_Transport.h48
-rw-r--r--TAO/tao/Invocation.cpp81
-rw-r--r--TAO/tao/Invocation.h20
-rw-r--r--TAO/tao/Invocation.i8
-rw-r--r--TAO/tao/ORB_Core.cpp16
-rw-r--r--TAO/tao/ORB_Core.h3
-rw-r--r--TAO/tao/ORB_Core.i1
-rw-r--r--TAO/tao/Pluggable.cpp16
-rw-r--r--TAO/tao/Pluggable.h30
-rw-r--r--TAO/tao/Pluggable.i1
-rw-r--r--TAO/tao/Reply_Dispatcher.cpp21
-rw-r--r--TAO/tao/Reply_Dispatcher.h17
-rw-r--r--TAO/tao/Reply_Dispatcher.i9
-rw-r--r--TAO/tao/SHMIOP_Acceptor.cpp9
-rw-r--r--TAO/tao/SHMIOP_Acceptor.h5
-rw-r--r--TAO/tao/SHMIOP_Connect.cpp46
-rw-r--r--TAO/tao/SHMIOP_Connect.h18
-rw-r--r--TAO/tao/SHMIOP_Connector.cpp31
-rw-r--r--TAO/tao/SHMIOP_Connector.h10
-rw-r--r--TAO/tao/SHMIOP_Transport.cpp172
-rw-r--r--TAO/tao/SHMIOP_Transport.h44
-rw-r--r--TAO/tao/UIOP_Acceptor.cpp11
-rw-r--r--TAO/tao/UIOP_Acceptor.h7
-rw-r--r--TAO/tao/UIOP_Connect.cpp57
-rw-r--r--TAO/tao/UIOP_Connect.h21
-rw-r--r--TAO/tao/UIOP_Connect.i1
-rw-r--r--TAO/tao/UIOP_Connector.cpp35
-rw-r--r--TAO/tao/UIOP_Connector.h12
-rw-r--r--TAO/tao/UIOP_Transport.cpp177
-rw-r--r--TAO/tao/UIOP_Transport.h52
-rw-r--r--TAO/tao/params.cpp3
-rw-r--r--TAO/tao/params.h6
-rw-r--r--TAO/tao/params.i3
47 files changed, 1116 insertions, 581 deletions
diff --git a/TAO/tao/GIOP_Server_Request.cpp b/TAO/tao/GIOP_Server_Request.cpp
index 9f43adf1eef..3661ccf4708 100644
--- a/TAO/tao/GIOP_Server_Request.cpp
+++ b/TAO/tao/GIOP_Server_Request.cpp
@@ -1,5 +1,6 @@
// $Id$
+
// Implementation of the Dynamic Server Skeleton Interface (for GIOP)
#include "tao/GIOP_Server_Request.h"
@@ -43,197 +44,43 @@ ACE_TIMEPROBE_EVENT_DESCRIPTIONS (TAO_Server_Request_Timeprobe_Description,
#endif /* ACE_ENABLE_TIMEPROBES */
TAO_GIOP_ServerRequest::
- TAO_GIOP_ServerRequest (TAO_InputCDR &input,
+ TAO_GIOP_ServerRequest (TAO_Pluggable_Messaging_Interface *mesg_base,
+ TAO_InputCDR &input,
TAO_OutputCDR &output,
TAO_ORB_Core *orb_core,
- const TAO_GIOP_Version &version,
- int &parse_error)
- : incoming_ (&input),
- outgoing_ (&output),
- response_expected_ (0),
- sync_with_server_ (0),
- lazy_evaluation_ (0),
-
+ const TAO_GIOP_Version &version)
+ :mesg_base_ (mesg_base),
+ incoming_ (&input),
+ outgoing_ (&output),
+ response_expected_ (0),
+ sync_with_server_ (0),
+ lazy_evaluation_ (0),
+
#if !defined (TAO_HAS_MINIMUM_CORBA)
-
- params_ (0),
-
+
+ params_ (0),
+
#endif /* TAO_HAS_MINIMUM_CORBA */
-
- retval_ (0),
- exception_ (0),
- exception_type_ (TAO_GIOP_NO_EXCEPTION),
- orb_core_ (orb_core),
- version_ (version),
- service_info_ (),
- request_id_ (0),
- object_key_ (),
- requesting_principal_ (0)
+
+ retval_ (0),
+ exception_ (0),
+ exception_type_ (TAO_GIOP_NO_EXCEPTION),
+ orb_core_ (orb_core),
+ version_ (version),
+ service_info_ (),
+ request_id_ (0),
+ object_key_ (),
+ requesting_principal_ (0)
{
ACE_FUNCTION_TIMEPROBE (TAO_SERVER_REQUEST_START);
-
- parse_error = this->parse_header ();
-}
-
-int
-TAO_GIOP_ServerRequest::parse_header_std (void)
-{
- // Tear out the service context ... we currently ignore it, but it
- // should probably be passed to each ORB service as appropriate
- // (e.g. transactions, security).
- //
- // NOTE: As security support kicks in, this is a good place to
- // verify a digital signature, if that is required in this security
- // environment. It may be required even when using IPSEC security
- // infrastructure.
-
- TAO_InputCDR& input = *this->incoming_;
-
- input >> this->service_info_;
- CORBA::Boolean hdr_status = (CORBA::Boolean) input.good_bit ();
-
- // Get the rest of the request header ...
-
- hdr_status = hdr_status && input.read_ulong (this->request_id_);
-
- CORBA::Octet response_flags;
- hdr_status = hdr_status && input.read_octet (response_flags);
- this->response_expected_ = (response_flags != 0);
-
- // The high bit of the octet has been set if the SyncScope policy
- // value is SYNC_WITH_SERVER. This is a temporary hack until all
- // of GIOP 1.2 is in place. Then we can check the version in the
- // message header instead.
- this->sync_with_server_ = (response_flags == 129);
-
- // We use ad-hoc demarshalling here: there is no need to increase
- // the reference count on the CDR message block, because this key
- // will not outlive the request (or the message block).
-
- CORBA::Long key_length = 0;
- hdr_status = hdr_status && input.read_long (key_length);
- if (hdr_status)
- {
- this->object_key_.replace (key_length, key_length,
- (CORBA::Octet*)input.rd_ptr (),
- 0);
- input.skip_bytes (key_length);
- }
-
- if (input.char_translator () == 0)
- {
- CORBA::ULong length = 0;
- hdr_status = hdr_status && input.read_ulong (length);
- if (hdr_status)
- {
- // Do not include NULL character at the end.
- // @@ This is not getting demarshaled using the codeset
- // translators!
- this->operation_.set (input.rd_ptr (),
- length - 1,
- 0);
- hdr_status = input.skip_bytes (length);
- }
- }
- else
- {
- // @@ We could optimize for this case too, i.e. do in-place
- // demarshaling of the string... But there is an issue
- // pending on the OMG as to whether the operation should be
- // sent in the connection negotiated codeset or always in
- // ISO8859-1.
- CORBA::String_var tmp;
- hdr_status = hdr_status && input.read_string (tmp.inout ());
- this->operation_.set (tmp._retn (), 1);
- }
-
- if (hdr_status)
- {
- input >> this->requesting_principal_.out ();
- hdr_status = (CORBA::Boolean) input.good_bit ();
- }
-
- return hdr_status ? 0 : -1;
-}
-
-int
-TAO_GIOP_ServerRequest::parse_header_lite (void)
-{
- TAO_InputCDR& input = *this->incoming_;
-
- CORBA::Boolean hdr_status = (CORBA::Boolean) input.good_bit ();
-
- // Get the rest of the request header ...
-
- hdr_status = hdr_status && input.read_ulong (this->request_id_);
-
- CORBA::Octet response_flags;
- hdr_status = hdr_status && input.read_octet (response_flags);
- this->response_expected_ = (response_flags != 0);
-
- // The high bit of the octet has been set if the SyncScope policy
- // value is SYNC_WITH_SERVER. This is a temporary hack until all
- // of GIOP 1.2 is in place. Then we can check the version in the
- // message header instead.
- this->sync_with_server_ = (response_flags == 129);
-
- // We use ad-hoc demarshalling here: there is no need to increase
- // the reference count on the CDR message block, because this key
- // will not outlive the request (or the message block).
-
- CORBA::Long key_length = 0;
- hdr_status = hdr_status && input.read_long (key_length);
- if (hdr_status)
- {
- this->object_key_.replace (key_length, key_length,
- (CORBA::Octet*)input.rd_ptr (),
- 0);
- input.skip_bytes (key_length);
- }
-
- if (input.char_translator () == 0)
- {
- CORBA::ULong length = 0;
- hdr_status = hdr_status && input.read_ulong (length);
- if (hdr_status)
- {
- // Do not include NULL character at the end.
- // @@ This is not getting demarshaled using the codeset
- // translators!
- this->operation_.set (input.rd_ptr (),
- length - 1,
- 0);
- hdr_status = input.skip_bytes (length);
- }
- }
- else
- {
- // @@ We could optimize for this case too, i.e. do in-place
- // demarshaling of the string... But there is an issue
- // pending on the OMG as to whether the operation should be
- // sent in the connection negotiated codeset or always in
- // ISO8859-1.
- CORBA::String_var tmp;
- hdr_status = hdr_status && input.read_string (tmp.inout ());
- this->operation_.set (tmp._retn (), 1);
- }
-
- return hdr_status ? 0 : -1;
-}
-
-int
-TAO_GIOP_ServerRequest::parse_header (void)
-{
- if (this->orb_core_->orb_params ()->use_lite_protocol ())
- return this->parse_header_lite ();
- else
- return this->parse_header_std ();
+ //no-op
}
// This constructor is used, by the locate request code
TAO_GIOP_ServerRequest::
- TAO_GIOP_ServerRequest (CORBA::ULong &request_id,
+ TAO_GIOP_ServerRequest (TAO_Pluggable_Messaging_Interface *mesg_base,
+ CORBA::ULong &request_id,
CORBA::Boolean &response_expected,
TAO_ObjectKey &object_key,
const ACE_CString &operation,
@@ -241,28 +88,29 @@ TAO_GIOP_ServerRequest::
TAO_ORB_Core *orb_core,
const TAO_GIOP_Version &version,
int &parse_error)
- : operation_ (operation),
- incoming_ (0),
- outgoing_ (&output),
- response_expected_ (response_expected),
- sync_with_server_ (0),
- lazy_evaluation_ (0),
-
+ : mesg_base_ (mesg_base),
+ operation_ (operation),
+ incoming_ (0),
+ outgoing_ (&output),
+ response_expected_ (response_expected),
+ sync_with_server_ (0),
+ lazy_evaluation_ (0),
+
#if !defined (TAO_HAS_MINIMUM_CORBA)
-
- params_ (0),
-
+
+ params_ (0),
+
#endif /* TAO_HAS_MINIMUM_CORBA */
-
- retval_ (0),
- exception_ (0),
- exception_type_ (TAO_GIOP_NO_EXCEPTION),
- orb_core_ (orb_core),
- version_ (version),
- service_info_ (),
- request_id_ (request_id),
- object_key_ (object_key),
- requesting_principal_ (0)
+
+ retval_ (0),
+ exception_ (0),
+ exception_type_ (TAO_GIOP_NO_EXCEPTION),
+ orb_core_ (orb_core),
+ version_ (version),
+ service_info_ (),
+ request_id_ (request_id),
+ object_key_ (object_key),
+ requesting_principal_ (0)
{
parse_error = 0;
}
@@ -371,6 +219,7 @@ TAO_GIOP_ServerRequest::set_exception (const CORBA::Any &value,
CORBA::Any (value),
CORBA::NO_MEMORY ());
ACE_CHECK;
+
this->exception_type_ = TAO_GIOP_USER_EXCEPTION;
if (value.value ())
@@ -574,10 +423,8 @@ void
TAO_GIOP_ServerRequest::init_reply (CORBA::Environment &ACE_TRY_ENV)
{
// Construct a REPLY header.
- TAO_GIOP::start_message (this->version_,
- TAO_GIOP::Reply,
- *this->outgoing_,
- this->orb_core_);
+ this->mesg_base_->write_protocol_header (TAO_PLUGGABLE_MESSAGE_REPLY,
+ *this->outgoing_);
#if defined (TAO_HAS_MINIMUM_CORBA)
*this->outgoing_ << this->service_info_;
@@ -737,10 +584,8 @@ TAO_GIOP_ServerRequest::exception_type (void)
void
TAO_GIOP_ServerRequest::send_no_exception_reply (TAO_Transport *transport)
{
- TAO_GIOP::start_message (this->version_,
- TAO_GIOP::Reply,
- *this->outgoing_,
- this->orb_core_);
+ this->mesg_base_->write_protocol_header (TAO_PLUGGABLE_MESSAGE_REPLY,
+ *this->outgoing_);
IOP::ServiceContextList resp_ctx;
resp_ctx.length (0);
@@ -749,9 +594,10 @@ TAO_GIOP_ServerRequest::send_no_exception_reply (TAO_Transport *transport)
this->outgoing_->write_ulong (this->request_id_);
this->outgoing_->write_ulong (TAO_GIOP_NO_EXCEPTION);
- int result = TAO_GIOP::send_message (transport,
- *this->outgoing_,
- this->orb_core_);
+ int result = this->mesg_base_->send_message (transport,
+ *this->outgoing_);
+
+
if (result == -1)
{
diff --git a/TAO/tao/GIOP_Server_Request.h b/TAO/tao/GIOP_Server_Request.h
index c389c88ebe5..50337e61a52 100644
--- a/TAO/tao/GIOP_Server_Request.h
+++ b/TAO/tao/GIOP_Server_Request.h
@@ -22,6 +22,8 @@
#define TAO_GIOP_SERVER_REQUEST_H
#include "tao/corbafwd.h"
+//#include "tao/GIOP_Utils.h"
+#include "tao/GIOP_Message_Base.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
@@ -37,13 +39,15 @@ class TAO_Export TAO_GIOP_ServerRequest : public CORBA_ServerRequest
// Class representing an GIOP ServerRequest object.
public:
// = Initialization and termination methods.
- TAO_GIOP_ServerRequest (TAO_InputCDR &input,
+ TAO_GIOP_ServerRequest (TAO_Pluggable_Messaging_Interface *mesg_base,
+ TAO_InputCDR &input,
TAO_OutputCDR &output,
TAO_ORB_Core *orb_core,
- const TAO_GIOP_Version &version,
- int &parse_error);
+ const TAO_GIOP_Version &version);
+
// Constructor
- TAO_GIOP_ServerRequest (CORBA::ULong &request_id,
+ TAO_GIOP_ServerRequest (TAO_Pluggable_Messaging_Interface *mesg_base,
+ CORBA::ULong &request_id,
CORBA::Boolean &response_expected,
TAO_ObjectKey &object_key,
const ACE_CString &operation,
@@ -82,6 +86,14 @@ public:
const char *operation (void) const;
// return the operation name
+ void operation (ACE_CString &operation);
+ // set the operation name
+
+ void operation (const char * name,
+ int release);
+ // set the operation name
+
+
unsigned int operation_length (void) const;
// return the legnth of the operation
@@ -127,9 +139,15 @@ public:
virtual CORBA::Boolean response_expected (void) const;
// Is the response expected?
+ virtual void response_expected (CORBA::Boolean response);
+ // Set the response expected flag
+
virtual CORBA::Boolean sync_with_server (void) const;
// Should we return before dispatching the servant?
+ virtual void sync_with_server (CORBA::Boolean sync_flag);
+ // Set the sync_with_server flag
+
virtual void _tao_lazy_evaluation (int lazy_evaluation);
// Set the lazy evaluation flag
@@ -138,13 +156,14 @@ public:
virtual CORBA::Principal_ptr principal (void) const;
- virtual const TAO_ObjectKey &object_key (void) const;
+ virtual TAO_ObjectKey &object_key (void);
virtual CORBA::Object_ptr objref (CORBA_Environment &ACE_TRY_ENV =
TAO_default_environment ());
// Return the object reference of the request.
virtual IOP::ServiceContextList &service_info (void);
+ virtual void service_info (IOP::ServiceContextList &service_info);
// The pseudo object methods, not really needed because the class is
// not in the spec, but we add them for the sake of completeness.
@@ -155,6 +174,7 @@ public:
// a method returning the request_id_ is needed.
virtual CORBA::ULong request_id (void);
+ virtual void request_id (CORBA::ULong req);
CORBA::Object_ptr forward_location (void);
// get the forward_location
@@ -162,19 +182,16 @@ public:
CORBA::ULong exception_type (void);
// get the exception type
-private:
- int parse_header (void);
- // Parse the request header and store the result on this object.
+ void requesting_principal (CORBA_Principal_ptr principal);
+ // set the requesting principal
- int parse_header_std (void);
- // Parse the standard GIOP request header and store the result on
- // this object.
+ void header_length (size_t len);
- int parse_header_lite (void);
- // Parse the lightweight version of the GIOP request header and
- // store the result on this object.
+ void message_size_offset (size_t len);
private:
+ TAO_Pluggable_Messaging_Interface *mesg_base_;
+
ACE_CString operation_;
// Operation name.
diff --git a/TAO/tao/GIOP_Server_Request.i b/TAO/tao/GIOP_Server_Request.i
index fdc040182f6..29da92ded95 100644
--- a/TAO/tao/GIOP_Server_Request.i
+++ b/TAO/tao/GIOP_Server_Request.i
@@ -31,6 +31,11 @@ TAO_GIOP_ServerRequest::operation (void) const
return this->operation_.c_str ();
}
+ACE_INLINE void
+TAO_GIOP_ServerRequest::operation (ACE_CString &operation)
+{
+ this->operation_ = operation;
+}
// get the length of the operation name.
ACE_INLINE unsigned int
TAO_GIOP_ServerRequest::operation_length (void) const
@@ -53,6 +58,13 @@ TAO_GIOP_ServerRequest::response_expected (void) const
return this->response_expected_;
}
+ACE_INLINE void
+TAO_GIOP_ServerRequest::
+response_expected (CORBA::Boolean response)
+{
+ this->response_expected_ = response;
+}
+
ACE_INLINE CORBA::Boolean
TAO_GIOP_ServerRequest::sync_with_server (void) const
{
@@ -60,6 +72,12 @@ TAO_GIOP_ServerRequest::sync_with_server (void) const
}
ACE_INLINE void
+TAO_GIOP_ServerRequest::sync_with_server (CORBA::Boolean sync_flag)
+{
+ this->sync_with_server_ = sync_flag;
+}
+
+ACE_INLINE void
TAO_GIOP_ServerRequest::_tao_lazy_evaluation (int lazy_evaluation)
{
this->lazy_evaluation_ = lazy_evaluation;
@@ -71,8 +89,8 @@ TAO_GIOP_ServerRequest::principal (void) const
return this->requesting_principal_.ptr ();
}
-ACE_INLINE const TAO_ObjectKey &
-TAO_GIOP_ServerRequest::object_key (void) const
+ACE_INLINE TAO_ObjectKey &
+TAO_GIOP_ServerRequest::object_key (void)
{
return this->object_key_;
}
@@ -93,8 +111,40 @@ TAO_GIOP_ServerRequest::service_info (void)
return this->service_info_;
}
+ACE_INLINE void
+TAO_GIOP_ServerRequest::
+service_info (IOP::ServiceContextList &service_info)
+{
+ this->service_info_ = service_info;
+}
+
ACE_INLINE CORBA::ULong
TAO_GIOP_ServerRequest::request_id (void)
{
return this->request_id_;
}
+
+ACE_INLINE void
+TAO_GIOP_ServerRequest::request_id (CORBA::ULong req)
+{
+ this->request_id_ = req;
+}
+
+ACE_INLINE void
+TAO_GIOP_ServerRequest::requesting_principal (CORBA_Principal_ptr
+ principal)
+{
+ this->requesting_principal_ = principal;
+}
+
+//ACE_INLINE void
+//TAO_GIOP_ServerRequest::header_length (size_t len)
+//{
+// this->header_len_ = len;
+//}
+//
+//ACE_INLINE void
+//TAO_GIOP_ServerRequest::message_size_offset (size_t len)
+//{
+// this->message_size_offset_ = len;
+//}
diff --git a/TAO/tao/IIOP_Acceptor.cpp b/TAO/tao/IIOP_Acceptor.cpp
index 3f30c643955..fe3645acfd8 100644
--- a/TAO/tao/IIOP_Acceptor.cpp
+++ b/TAO/tao/IIOP_Acceptor.cpp
@@ -6,7 +6,6 @@
#include "tao/MProfile.h"
#include "tao/ORB_Core.h"
#include "tao/Server_Strategy_Factory.h"
-#include "tao/GIOP.h"
#include "tao/debug.h"
#include "ace/Auto_Ptr.h"
@@ -43,7 +42,7 @@ template class TAO_Accept_Strategy<TAO_IIOP_Server_Connection_Handler, ACE_SOCK_
#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
-TAO_IIOP_Acceptor::TAO_IIOP_Acceptor (void)
+TAO_IIOP_Acceptor::TAO_IIOP_Acceptor (CORBA::Boolean flag)
: TAO_Acceptor (TAO_TAG_IIOP_PROFILE),
addrs_ (0),
hosts_ (0),
@@ -53,7 +52,8 @@ TAO_IIOP_Acceptor::TAO_IIOP_Acceptor (void)
base_acceptor_ (),
creation_strategy_ (0),
concurrency_strategy_ (0),
- accept_strategy_ (0)
+ accept_strategy_ (0),
+ lite_flag_ (flag)
{
}
@@ -357,7 +357,8 @@ TAO_IIOP_Acceptor::open_i (TAO_ORB_Core* orb_core,
this->orb_core_ = orb_core;
ACE_NEW_RETURN (this->creation_strategy_,
- TAO_IIOP_CREATION_STRATEGY (this->orb_core_),
+ TAO_IIOP_CREATION_STRATEGY (this->orb_core_,
+ this->lite_flag_),
-1);
ACE_NEW_RETURN (this->concurrency_strategy_,
diff --git a/TAO/tao/IIOP_Acceptor.h b/TAO/tao/IIOP_Acceptor.h
index c4ab088ef56..a9270ee80b3 100644
--- a/TAO/tao/IIOP_Acceptor.h
+++ b/TAO/tao/IIOP_Acceptor.h
@@ -1,6 +1,7 @@
// This may look like C, but it's really -*- C++ -*-
// $Id$
+
//============================================================================
//
// = LIBRARY
@@ -43,7 +44,7 @@ class TAO_Export TAO_IIOP_Acceptor : public TAO_Acceptor
// The IIOP-specific bridge class for the concrete acceptor.
//
public:
- TAO_IIOP_Acceptor (void);
+ TAO_IIOP_Acceptor (CORBA::Boolean flag = 0);
// Constructor.
~TAO_IIOP_Acceptor (void);
@@ -113,6 +114,9 @@ private:
TAO_IIOP_CONCURRENCY_STRATEGY *concurrency_strategy_;
TAO_IIOP_ACCEPT_STRATEGY *accept_strategy_;
// Acceptor strategies.
+
+ CORBA::Boolean lite_flag_;
+ // Should we use GIOP lite??
};
diff --git a/TAO/tao/IIOP_Connect.cpp b/TAO/tao/IIOP_Connect.cpp
index ec7663896e0..963eff518bd 100644
--- a/TAO/tao/IIOP_Connect.cpp
+++ b/TAO/tao/IIOP_Connect.cpp
@@ -6,9 +6,10 @@
#include "tao/ORB_Core.h"
#include "tao/ORB.h"
#include "tao/CDR.h"
-#include "tao/GIOP.h"
-
#include "tao/Messaging_Policy_i.h"
+#include "tao/GIOP_Message_Lite.h"
+#include "tao/GIOP_Message_Acceptors.h"
+
#if !defined (__ACE_INLINE__)
# include "tao/IIOP_Connect.i"
@@ -16,6 +17,8 @@
ACE_RCSID(tao, IIOP_Connect, "$Id$")
+
+
#if defined (ACE_ENABLE_TIMEPROBES)
static const char *TAO_IIOP_Connect_Timeprobe_Description[] =
@@ -67,10 +70,11 @@ TAO_IIOP_Handler_Base::TAO_IIOP_Handler_Base (ACE_Thread_Manager *t)
TAO_IIOP_Server_Connection_Handler::TAO_IIOP_Server_Connection_Handler (ACE_Thread_Manager *t)
: TAO_IIOP_Handler_Base (t),
transport_ (this, 0),
+ acceptor_factory_ (0),
orb_core_ (0),
tss_resources_ (0),
- refcount_ (1)
-
+ refcount_ (1),
+ lite_flag_ (0)
{
// This constructor should *never* get called, it is just here to
// make the compiler happy: the default implementation of the
@@ -80,17 +84,32 @@ TAO_IIOP_Server_Connection_Handler::TAO_IIOP_Server_Connection_Handler (ACE_Thre
ACE_ASSERT (this->orb_core_ != 0);
}
-TAO_IIOP_Server_Connection_Handler::TAO_IIOP_Server_Connection_Handler (TAO_ORB_Core *orb_core)
+TAO_IIOP_Server_Connection_Handler::TAO_IIOP_Server_Connection_Handler (TAO_ORB_Core *orb_core,
+ CORBA::Boolean flag)
: TAO_IIOP_Handler_Base (orb_core),
transport_ (this, orb_core),
+ acceptor_factory_ (0),
orb_core_ (orb_core),
tss_resources_ (orb_core->get_tss_resources ()),
- refcount_ (1)
+ refcount_ (1),
+ lite_flag_ (flag)
{
+ if (lite_flag_)
+ {
+ ACE_NEW (this->acceptor_factory_,
+ TAO_GIOP_Message_Lite (orb_core));
+ }
+ else
+ {
+ ACE_NEW (this->acceptor_factory_,
+ TAO_GIOP_Message_Acceptors (orb_core));
+ }
+
}
TAO_IIOP_Server_Connection_Handler::~TAO_IIOP_Server_Connection_Handler (void)
{
+ delete this->acceptor_factory_;
}
int
@@ -264,11 +283,11 @@ TAO_IIOP_Server_Connection_Handler::handle_input_i (ACE_HANDLE,
{
this->refcount_++;
- int result = TAO_GIOP::handle_input (this->transport (),
- this->orb_core_,
- this->transport_.message_state_,
- max_wait_time);
-
+ int result = this->acceptor_factory_->handle_input (this->transport (),
+ this->orb_core_,
+ this->transport_.message_state_,
+ max_wait_time);
+
if (result == -1 && TAO_debug_level > 0)
{
ACE_DEBUG ((LM_DEBUG,
@@ -307,12 +326,12 @@ TAO_IIOP_Server_Connection_Handler::handle_input_i (ACE_HANDLE,
// Reset the message state.
this->transport_.message_state_.reset (0);
+ result =
+ this->acceptor_factory_->process_connector_messages (this->transport (),
+ this->orb_core_,
+ input_cdr,
+ message_type);
- result = TAO_GIOP::process_server_message (this->transport (),
- this->orb_core_,
- input_cdr,
- message_type,
- giop_version);
if (result != -1)
result = 0;
@@ -328,15 +347,20 @@ TAO_IIOP_Server_Connection_Handler::handle_input_i (ACE_HANDLE,
// transport obj.
TAO_IIOP_Client_Connection_Handler::
TAO_IIOP_Client_Connection_Handler (ACE_Thread_Manager *t,
- TAO_ORB_Core* orb_core)
+ TAO_ORB_Core* orb_core,
+ CORBA::Boolean flag)
: TAO_IIOP_Handler_Base (t),
transport_ (this, orb_core),
- orb_core_ (orb_core)
+ orb_core_ (orb_core),
+ lite_flag_ (flag)
{
+ // Set the lite flag in the client transport
+ this->transport_.use_lite (flag);
}
TAO_IIOP_Client_Connection_Handler::~TAO_IIOP_Client_Connection_Handler (void)
{
+ //no-op
}
@@ -526,6 +550,8 @@ TAO_IIOP_Client_Connection_Handler::handle_cleanup (void)
return 0;
}
+
+
// ****************************************************************
#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
diff --git a/TAO/tao/IIOP_Connect.h b/TAO/tao/IIOP_Connect.h
index 1f58f5d2ab3..dee430ffb10 100644
--- a/TAO/tao/IIOP_Connect.h
+++ b/TAO/tao/IIOP_Connect.h
@@ -32,6 +32,11 @@
#include "tao/Wait_Strategy.h"
#include "tao/IIOP_Transport.h"
+#include "tao/Pluggable_Messaging.h"
+
+
+
+
// Forward Decls
class TAO_ORB_Core;
@@ -49,7 +54,6 @@ public:
TAO_IIOP_Handler_Base (ACE_Thread_Manager *t);
TAO_IIOP_Handler_Base (TAO_ORB_Core *orb_core);
- virtual TAO_Transport *transport (void) = 0;
};
class TAO_Export TAO_IIOP_Client_Connection_Handler : public TAO_IIOP_Handler_Base
@@ -60,7 +64,8 @@ class TAO_Export TAO_IIOP_Client_Connection_Handler : public TAO_IIOP_Handler_Ba
public:
// = Intialization method.
TAO_IIOP_Client_Connection_Handler (ACE_Thread_Manager *t = 0,
- TAO_ORB_Core* orb_core = 0);
+ TAO_ORB_Core* orb_core = 0,
+ CORBA::Boolean flag = 0);
virtual ~TAO_IIOP_Client_Connection_Handler (void);
@@ -100,6 +105,9 @@ protected:
TAO_ORB_Core *orb_core_;
// Cached ORB Core.
+
+ CORBA::Boolean lite_flag_;
+ // Are we using GIOP lite?
};
// ****************************************************************
@@ -111,7 +119,8 @@ class TAO_Export TAO_IIOP_Server_Connection_Handler : public TAO_IIOP_Handler_Ba
public:
TAO_IIOP_Server_Connection_Handler (ACE_Thread_Manager* t = 0);
- TAO_IIOP_Server_Connection_Handler (TAO_ORB_Core *orb_core);
+ TAO_IIOP_Server_Connection_Handler (TAO_ORB_Core *orb_core,
+ CORBA::Boolean flag);
~TAO_IIOP_Server_Connection_Handler (void);
// Constructor.
@@ -160,6 +169,9 @@ protected:
TAO_IIOP_Server_Transport transport_;
// @@ New transport object reference.
+ TAO_Pluggable_Messaging_Interface *acceptor_factory_;
+ // Messaging acceptor factory
+
TAO_ORB_Core *orb_core_;
// Cached ORB Core.
@@ -168,6 +180,9 @@ protected:
u_long refcount_;
// Reference count, to avoid early deletes...
+
+ CORBA::Boolean lite_flag_;
+ // Should we use GIOP or GIOPlite
};
#if defined (__ACE_INLINE__)
diff --git a/TAO/tao/IIOP_Connector.cpp b/TAO/tao/IIOP_Connector.cpp
index b887d26dbe9..f0db86ef2e3 100644
--- a/TAO/tao/IIOP_Connector.cpp
+++ b/TAO/tao/IIOP_Connector.cpp
@@ -3,7 +3,6 @@
#include "tao/IIOP_Connector.h"
#include "tao/IIOP_Profile.h"
-#include "tao/GIOP.h"
#include "tao/debug.h"
#include "tao/ORB_Core.h"
#include "tao/Client_Strategy_Factory.h"
@@ -309,9 +308,11 @@ template class ACE_Refcounted_Recyclable_Handler_Caching_Utility<TAO_ADDR, TAO_C
TAO_IIOP_Connect_Creation_Strategy::
TAO_IIOP_Connect_Creation_Strategy (ACE_Thread_Manager* t,
- TAO_ORB_Core *orb_core)
+ TAO_ORB_Core *orb_core,
+ CORBA::Boolean flag)
: ACE_Creation_Strategy<TAO_IIOP_Client_Connection_Handler> (t),
- orb_core_ (orb_core)
+ orb_core_ (orb_core),
+ lite_flag_ (flag)
{
}
@@ -323,7 +324,8 @@ TAO_IIOP_Connect_Creation_Strategy::make_svc_handler
ACE_NEW_RETURN (sh,
TAO_IIOP_Client_Connection_Handler
(this->orb_core_->thr_mgr (),
- this->orb_core_),
+ this->orb_core_,
+ this->lite_flag_),
-1);
return 0;
}
@@ -337,10 +339,13 @@ typedef ACE_Cached_Connect_Strategy<TAO_IIOP_Client_Connection_Handler,
TAO_CACHED_CONNECT_STRATEGY;
#endif /* ! TAO_USES_ROBUST_CONNECTION_MGMT */
-TAO_IIOP_Connector::TAO_IIOP_Connector (void)
+
+TAO_IIOP_Connector::TAO_IIOP_Connector (CORBA::Boolean flag)
: TAO_Connector (TAO_TAG_IIOP_PROFILE),
+
orb_core_ (0),
- base_connector_ ()
+ base_connector_ (),
+ lite_flag_ (flag)
#if defined (TAO_USES_ROBUST_CONNECTION_MGMT)
,
cached_connect_strategy_ (0),
@@ -364,7 +369,8 @@ TAO_IIOP_Connector::open (TAO_ORB_Core *orb_core)
ACE_NEW_RETURN (connect_creation_strategy,
TAO_IIOP_Connect_Creation_Strategy
(this->orb_core_->thr_mgr (),
- this->orb_core_),
+ this->orb_core_,
+ this->lite_flag_),
-1);
auto_ptr<TAO_IIOP_Connect_Creation_Strategy>
@@ -505,6 +511,22 @@ TAO_IIOP_Connector::connect (TAO_Profile *profile,
}
transport = svc_handler->transport ();
+
+ // Now that we have the client connection handler object we need to
+ // set the right messaging protocol for in the client side transport.
+ const TAO_GIOP_Version& version = iiop_profile->version ();
+ int ret_val = transport->messaging_init (version.major,
+ version.minor);
+ if (ret_val == -1)
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ASYS_TEXT ("(%N|%l|%p|%t) init_mesg_protocol () failed \n")));
+ }
+ return -1;
+ }
+
return 0;
}
@@ -673,7 +695,7 @@ TAO_IIOP_Connector::create_profile (TAO_InputCDR& cdr)
pfile->_decr_refcnt ();
pfile = 0;
}
-
+
return pfile;
}
@@ -694,7 +716,8 @@ TAO_IIOP_Connector::make_profile (const char *endpoint,
CORBA::NO_MEMORY ());
ACE_CHECK;
-}
+
+ }
int
TAO_IIOP_Connector::check_prefix (const char *endpoint)
diff --git a/TAO/tao/IIOP_Connector.h b/TAO/tao/IIOP_Connector.h
index 569619ce7b5..7d0c7fbdc9c 100644
--- a/TAO/tao/IIOP_Connector.h
+++ b/TAO/tao/IIOP_Connector.h
@@ -57,7 +57,8 @@ class TAO_Export TAO_IIOP_Connect_Creation_Strategy : public ACE_Creation_Strate
//
public:
TAO_IIOP_Connect_Creation_Strategy (ACE_Thread_Manager * = 0,
- TAO_ORB_Core* orb_core = 0);
+ TAO_ORB_Core* orb_core = 0,
+ CORBA::Boolean flag = 0);
virtual int make_svc_handler (TAO_IIOP_Client_Connection_Handler *&sh);
// Makes TAO_IIOP_Client_Connection_Handlers
@@ -65,6 +66,9 @@ public:
private:
TAO_ORB_Core* orb_core_;
// The ORB
+
+ CORBA::Boolean lite_flag_;
+ // Are we using GIOP?
};
// ****************************************************************
@@ -81,7 +85,7 @@ class TAO_Export TAO_IIOP_Connector : public TAO_Connector
//
public:
// = Initialization and termination methods.
- TAO_IIOP_Connector (void);
+ TAO_IIOP_Connector (CORBA::Boolean flag = 0);
// Constructor.
// = The TAO_Connector methods, please check the documentation on
@@ -191,6 +195,9 @@ private:
TAO_IIOP_BASE_CONNECTOR base_connector_;
// The connector initiating connection requests for IIOP.
+ CORBA::Boolean lite_flag_;
+ // Do we need to use a GIOP_Lite for sending messages?
+
#if defined (TAO_USES_ROBUST_CONNECTION_MGMT)
TAO_CACHED_CONNECT_STRATEGY *cached_connect_strategy_;
// Cached connect strategy.
@@ -200,6 +207,7 @@ private:
// from the connection cache.
#endif /* TAO_USES_ROBUST_CONNECTION_MGMT */
+
};
#endif /* TAO_IIOP_CONNECTOR_H */
diff --git a/TAO/tao/IIOP_Factory.h b/TAO/tao/IIOP_Factory.h
index 36030c650e2..867a0ccf59c 100644
--- a/TAO/tao/IIOP_Factory.h
+++ b/TAO/tao/IIOP_Factory.h
@@ -1,5 +1,6 @@
// -*- C++ -*-
// $Id$
+
// ============================================================================
//
// = LIBRARY
diff --git a/TAO/tao/IIOP_Profile.cpp b/TAO/tao/IIOP_Profile.cpp
index 24e23372347..691c49cca2d 100644
--- a/TAO/tao/IIOP_Profile.cpp
+++ b/TAO/tao/IIOP_Profile.cpp
@@ -2,10 +2,8 @@
// $Id$
-
#include "tao/IIOP_Profile.h"
#include "tao/IIOP_Connect.h"
-#include "tao/GIOP.h"
#include "tao/CDR.h"
#include "tao/Environment.h"
#include "tao/ORB.h"
@@ -29,6 +27,7 @@ TAO_IIOP_Profile::object_key_delimiter (void) const
return TAO_IIOP_Profile::object_key_delimiter_;
}
+
TAO_IIOP_Profile::TAO_IIOP_Profile (const ACE_INET_Addr &addr,
const TAO_ObjectKey &object_key,
const TAO_GIOP_Version &version,
diff --git a/TAO/tao/IIOP_Profile.h b/TAO/tao/IIOP_Profile.h
index 252285d9314..513090cb1f3 100644
--- a/TAO/tao/IIOP_Profile.h
+++ b/TAO/tao/IIOP_Profile.h
@@ -1,6 +1,7 @@
// This may look like C, but it's really -*- C++ -*-
// $Id$
+
// ============================================================================
//
// = LIBRARY
@@ -21,14 +22,13 @@
#define TAO_IIOP_PROFILE_H
#include "tao/Profile.h"
-
+#include "tao/GIOP_Utils.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
#include "tao/ORB.h"
#include "tao/Object_KeyC.h"
-#include "tao/GIOP.h"
#include "ace/Synch.h"
#include "ace/INET_Addr.h"
diff --git a/TAO/tao/IIOP_Profile.i b/TAO/tao/IIOP_Profile.i
index 85121915ff3..bc461ad8c0d 100644
--- a/TAO/tao/IIOP_Profile.i
+++ b/TAO/tao/IIOP_Profile.i
@@ -57,7 +57,7 @@ TAO_IIOP_Profile::version (void) const
}
ACE_INLINE TAO_IIOP_Client_Connection_Handler *&
-TAO_IIOP_Profile::hint(void)
+TAO_IIOP_Profile::hint (void)
{
return this->hint_;
}
diff --git a/TAO/tao/IIOP_Transport.cpp b/TAO/tao/IIOP_Transport.cpp
index 79a928fd3b1..949ae2937ac 100644
--- a/TAO/tao/IIOP_Transport.cpp
+++ b/TAO/tao/IIOP_Transport.cpp
@@ -13,6 +13,13 @@
#include "tao/ORB_Core.h"
#include "tao/debug.h"
+
+#include "tao/GIOP_Message_Connectors.h"
+#include "tao/GIOP_Message_Lite.h"
+
+#if !defined (__ACE_INLINE__)
+# include "tao/IIOP_Transport.i"
+#endif /* ! __ACE_INLINE__ */
#if defined (ACE_ENABLE_TIMEPROBES)
static const char *TAO_Transport_Timeprobe_Description[] =
@@ -99,6 +106,7 @@ TAO_IIOP_Transport::event_handler (void)
return this->handler_;
}
+
// ****************************************************************
TAO_IIOP_Server_Transport::
@@ -121,7 +129,11 @@ TAO_IIOP_Client_Transport::
TAO_ORB_Core *orb_core)
: TAO_IIOP_Transport (handler,
orb_core),
- client_handler_ (handler)
+ client_handler_ (handler),
+ client_mesg_factory_ (0),
+ orb_core_ (orb_core),
+ lite_flag_ (0),
+ params_ ()
{
}
@@ -129,6 +141,8 @@ TAO_IIOP_Client_Transport::~TAO_IIOP_Client_Transport (void)
{
}
+
+
TAO_IIOP_Client_Connection_Handler *
TAO_IIOP_Client_Transport::client_handler (void)
{
@@ -136,15 +150,15 @@ TAO_IIOP_Client_Transport::client_handler (void)
}
void
-TAO_IIOP_Client_Transport::start_request (TAO_ORB_Core *orb_core,
- const TAO_Profile* pfile,
+TAO_IIOP_Client_Transport::start_request (TAO_ORB_Core */*orb_core*/,
+ TAO_Target_Specification & /*spec */,
TAO_OutputCDR &output,
CORBA::Environment &ACE_TRY_ENV)
ACE_THROW_SPEC ((CORBA::SystemException))
{
TAO_FUNCTION_PP_TIMEPROBE (TAO_IIOP_CLIENT_TRANSPORT_START_REQUEST_START);
- const TAO_IIOP_Profile* profile =
+ /*const TAO_IIOP_Profile* profile =
ACE_dynamic_cast(const TAO_IIOP_Profile*, pfile);
// @@ This should be implemented in the transport object, which
@@ -152,36 +166,32 @@ TAO_IIOP_Client_Transport::start_request (TAO_ORB_Core *orb_core,
if (TAO_GIOP::start_message (profile->version (),
TAO_GIOP::Request,
output,
- orb_core) == 0)
+ orb_core) == 0)*/
+ if (this->client_mesg_factory_->write_protocol_header
+ (TAO_PLUGGABLE_MESSAGE_REQUEST,
+ output) == 0)
ACE_THROW (CORBA::MARSHAL ());
}
void
-TAO_IIOP_Client_Transport::start_locate (TAO_ORB_Core *orb_core,
- const TAO_Profile* pfile,
- CORBA::ULong request_id,
+TAO_IIOP_Client_Transport::start_locate (TAO_ORB_Core */*orb_core*/,
+ TAO_Target_Specification &spec,
+ TAO_Operation_Details &opdetails,
TAO_OutputCDR &output,
CORBA::Environment &ACE_TRY_ENV)
ACE_THROW_SPEC ((CORBA::SystemException))
{
- const TAO_IIOP_Profile* profile =
- ACE_dynamic_cast(const TAO_IIOP_Profile*, pfile);
-
- // Obtain object key.
- const TAO_ObjectKey& key = profile->object_key ();
-
- // @@ This should be implemented in the transport object, which
- // would query the profile to obtain the version...
- if (TAO_GIOP::start_message (profile->version (),
- TAO_GIOP::LocateRequest,
- output,
- orb_core) == 0)
+ // See this is GIOP way of doing this..But anyway IIOP will be tied
+ // up with GIOP.
+ if (this->client_mesg_factory_->write_protocol_header
+ (TAO_PLUGGABLE_MESSAGE_LOCATEREQUEST,
+ output) == 0)
ACE_THROW (CORBA::MARSHAL ());
-
-
- if (TAO_GIOP::write_locate_request_header (request_id,
- key,
- output) == 0)
+
+ if (this->client_mesg_factory_->write_message_header (opdetails,
+ TAO_PLUGGABLE_MESSAGE_LOCATE_REQUEST_HEADER,
+ spec,
+ output) == 0)
ACE_THROW (CORBA::MARSHAL ());
}
@@ -196,12 +206,11 @@ TAO_IIOP_Client_Transport::send_request (TAO_Stub *stub,
two_way) == -1)
return -1;
- if (TAO_GIOP::send_message (this,
- stream,
- orb_core,
- max_wait_time,
- stub,
- two_way) == -1)
+ if (this->client_mesg_factory_->send_message (this,
+ stream,
+ max_wait_time,
+ stub,
+ two_way) == -1)
return -1;
return this->idle_after_send ();
@@ -232,10 +241,11 @@ TAO_IIOP_Client_Transport::handle_client_input (int /* block */,
return -1;
}
- int result = TAO_GIOP::handle_input (this,
- this->orb_core_,
- *message_state,
- max_wait_time);
+
+ int result = this->client_mesg_factory_->handle_input (this,
+ this->orb_core_,
+ *message_state,
+ max_wait_time);
if (result == -1)
{
if (TAO_debug_level > 0)
@@ -249,16 +259,8 @@ TAO_IIOP_Client_Transport::handle_client_input (int /* block */,
// OK, the complete message is here...
- IOP::ServiceContextList reply_ctx;
- CORBA::ULong request_id;
- CORBA::ULong reply_status;
-
- result = TAO_GIOP::parse_reply (this,
- this->orb_core_,
- *message_state,
- reply_ctx,
- request_id,
- reply_status);
+ result = this->client_mesg_factory_->parse_reply (*message_state,
+ this->params_);
if (result == -1)
{
if (TAO_debug_level > 0)
@@ -270,10 +272,10 @@ TAO_IIOP_Client_Transport::handle_client_input (int /* block */,
}
result =
- this->tms_->dispatch_reply (request_id,
- reply_status,
+ this->tms_->dispatch_reply (this->params_.request_id_,
+ this->params_.reply_status_,
message_state->giop_version,
- reply_ctx,
+ this->params_.svc_ctx_,
message_state);
if (result == -1)
@@ -313,6 +315,74 @@ TAO_IIOP_Client_Transport::register_handler (void)
ACE_Event_Handler::READ_MASK);
}
+int
+TAO_IIOP_Client_Transport::messaging_init (CORBA::Octet major,
+ CORBA::Octet minor)
+{
+ if (this->client_mesg_factory_ == 0)
+ {
+ if (this->lite_flag_)
+ {
+ ACE_NEW_RETURN (this->client_mesg_factory_,
+ TAO_GIOP_Message_Lite (this->orb_core_),
+ -1);
+ }
+ else if (major == TAO_DEF_GIOP_MAJOR)
+ {
+ if (minor > TAO_DEF_GIOP_MINOR)
+ minor = TAO_DEF_GIOP_MINOR;
+ switch (minor)
+ {
+ case 0:
+ ACE_NEW_RETURN (this->client_mesg_factory_,
+ TAO_GIOP_Message_Connector_10,
+ 0);
+ break;
+ case 1:
+ ACE_NEW_RETURN (this->client_mesg_factory_,
+ TAO_GIOP_Message_Connector_11,
+ 0);
+ break;
+ default:
+ if (TAO_debug_level > 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ASYS_TEXT ("(%N|%l|%p|%t) No matching minor version number \n")),
+ 0);
+ }
+ }
+ }
+ else
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ASYS_TEXT ("(%N|%l|%p|%t) No matching major version number \n")),
+ 0);
+ }
+ }
+ }
+
+ return 1;
+}
+
+CORBA::Boolean
+TAO_IIOP_Client_Transport::send_request_header (TAO_Operation_Details &opdetails,
+ TAO_Target_Specification &spec,
+ TAO_OutputCDR & msg)
+{
+ // We are going to pass on this request to the underlying messaging
+ // layer. It should take care of this request
+ CORBA::Boolean retval =
+ this->client_mesg_factory_->write_message_header (opdetails,
+ TAO_PLUGGABLE_MESSAGE_REQUEST_HEADER,
+ spec,
+ msg);
+
+ return retval;
+}
+
+
// *********************************************************************
ssize_t
@@ -382,3 +452,15 @@ TAO_IIOP_Transport::send_request (TAO_Stub *,
{
return -1;
}
+
+
+
+CORBA::Boolean
+TAO_IIOP_Transport::send_request_header (TAO_Operation_Details & /**/,
+ TAO_Target_Specification & /*spec */ ,
+ TAO_OutputCDR & /*msg*/)
+{
+ // We should never be here. So return an error.
+ return 0;
+}
+
diff --git a/TAO/tao/IIOP_Transport.h b/TAO/tao/IIOP_Transport.h
index e7d402004d4..08a2adf3e0b 100644
--- a/TAO/tao/IIOP_Transport.h
+++ b/TAO/tao/IIOP_Transport.h
@@ -22,11 +22,15 @@
#include "tao/Pluggable.h"
+// BALA Temporrary inclusion
+#include "tao/GIOP_Utils.h"
+#include "tao/operation_details.h"
+
+
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
-#include "tao/GIOP.h"
// Forward decls.
class TAO_IIOP_Handler_Base;
@@ -79,6 +83,10 @@ public:
int twoway,
ACE_Time_Value *max_wait_time);
+ virtual CORBA::Boolean
+ send_request_header (TAO_Operation_Details &opdetails,
+ TAO_Target_Specification &spec,
+ TAO_OutputCDR &msg);
protected:
TAO_IIOP_Handler_Base *handler_;
// the connection service handler used for accessing lower layer
@@ -111,28 +119,55 @@ public:
// = The TAO_Transport methods, please check the documentation in
// "tao/Pluggable.h" for more details.
virtual void start_request (TAO_ORB_Core *orb_core,
- const TAO_Profile *profile,
+ TAO_Target_Specification &spec,
TAO_OutputCDR &output,
CORBA::Environment &ACE_TRY_ENV = TAO_default_environment ())
ACE_THROW_SPEC ((CORBA::SystemException));
+
virtual void start_locate (TAO_ORB_Core *orb_core,
- const TAO_Profile *profile,
- CORBA::ULong request_id,
+ TAO_Target_Specification &spec,
+ TAO_Operation_Details &opdetails,
TAO_OutputCDR &output,
CORBA::Environment &ACE_TRY_ENV = TAO_default_environment ())
ACE_THROW_SPEC ((CORBA::SystemException));
+
virtual int send_request (TAO_Stub *stub,
TAO_ORB_Core *orb_core,
TAO_OutputCDR &stream,
int twoway,
ACE_Time_Value *max_wait_time);
+
virtual int handle_client_input (int block = 0,
ACE_Time_Value *max_time_value = 0);
virtual int register_handler (void);
+ virtual CORBA::Boolean
+ send_request_header (TAO_Operation_Details &opdetails,
+ TAO_Target_Specification &spec,
+ TAO_OutputCDR &msg);
+
+ int messaging_init (CORBA::Octet major,
+ CORBA::Octet minor);
+ // Initialising the messaging object
+
+ void use_lite (CORBA::Boolean flag);
+ // Sets the lite flag
private:
TAO_IIOP_Client_Connection_Handler *client_handler_;
// pointer to the corresponding client side connection handler.
+
+ TAO_Pluggable_Messaging_Interface *client_mesg_factory_;
+ // The message_factor instance specific for this particular
+ // transport protocol.
+
+ TAO_ORB_Core *orb_core_;
+ // Our ORB core
+
+ CORBA::Boolean lite_flag_;
+ // Are we using lite?
+
+ TAO_Pluggable_Connector_Params params_;
+ // The reply data that is sent back by the server
};
// ****************************************************************
@@ -162,6 +197,11 @@ public:
TAO_GIOP_Message_State message_state_;
// This keep the state of the current message, to enable
// non-blocking reads, fragment reassembly, etc.
+ // @@Bala. Should not be here like this
};
+#if defined (__ACE_INLINE__)
+#include "tao/IIOP_Transport.i"
+#endif /* __ACE_INLINE__ */
+
#endif /* TAO_IIOP_TRANSPORT_H */
diff --git a/TAO/tao/Invocation.cpp b/TAO/tao/Invocation.cpp
index e7e03d1a227..fe11607cb03 100644
--- a/TAO/tao/Invocation.cpp
+++ b/TAO/tao/Invocation.cpp
@@ -14,6 +14,7 @@
#include "tao/Messaging_Policy_i.h"
#include "tao/Client_Priority_Policy.h"
+#include "tao/target_identifier.h"
#if !defined (__ACE_INLINE__)
# include "tao/Invocation.i"
@@ -73,9 +74,7 @@ TAO_GIOP_Invocation::TAO_GIOP_Invocation (TAO_Stub *stub,
CORBA::ULong opname_len,
TAO_ORB_Core* orb_core)
: stub_ (stub),
- opname_ (operation),
- opname_len_ (opname_len),
- request_id_ (0),
+ op_details_ (operation, opname_len),
out_stream_ (buffer, sizeof buffer, /* ACE_CDR::DEFAULT_BUFSIZE */
TAO_ENCAP_BYTE_ORDER,
orb_core->output_cdr_buffer_allocator (),
@@ -296,7 +295,9 @@ TAO_GIOP_Invocation::start (CORBA::Environment &ACE_TRY_ENV)
}
// Obtain unique request id from the RMS.
- this->request_id_ = this->transport_->tms ()->request_id ();
+ this->op_details_.request_id (
+ this->transport_->tms ()->request_id ());
+
}
void
@@ -306,31 +307,20 @@ TAO_GIOP_Invocation::prepare_header (CORBA::Octet response_flags,
{
// Then fill in the rest of the RequestHeader
//
- // 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.
- //
- // Last element of request header is the principal; no portable way
- // to get it, we just pass empty principal (convention: indicates
- // "anybody"). Steps upward in security include passing an
- // unverified user ID, and then verifying the message (i.e. a dummy
- // service context entry is set up to hold a digital signature for
- // this message, then patched shortly before it's sent).
- static CORBA::Principal_ptr principal = 0;
-
- if (TAO_GIOP::write_request_header (this->service_info_,
- this->request_id_,
- response_flags,
- this->profile_->object_key (),
- this->opname_,
- this->opname_len_,
- principal,
- this->out_stream_,
- this->orb_core_) == 0)
+ // The target specification mode
+ this->target_spec_.target_specifier (this->profile_->object_key ());
+
+ // Update the response flags
+ this->op_details_.response_flags (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 ());
}
+
// Send request.
int
TAO_GIOP_Invocation::invoke (CORBA::Boolean is_roundtrip,
@@ -537,8 +527,9 @@ TAO_GIOP_Twoway_Invocation::start (CORBA::Environment &ACE_TRY_ENV)
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->profile_,
+ this->target_spec_,
this->out_stream_,
ACE_TRY_ENV);
}
@@ -722,7 +713,7 @@ TAO_GIOP_Twoway_Invocation::invoke_i (CORBA::Environment &ACE_TRY_ENV)
// Bind.
int retval =
- this->transport_->tms ()->bind_dispatcher (this->request_id_,
+ this->transport_->tms ()->bind_dispatcher (this->op_details_.request_id (),
&this->rd_);
if (retval == -1)
{
@@ -830,15 +821,15 @@ TAO_GIOP_Twoway_Invocation::invoke_i (CORBA::Environment &ACE_TRY_ENV)
switch (reply_status)
{
- case TAO_GIOP_NO_EXCEPTION:
+ case TAO_PLUGGABLE_MESSAGE_NO_EXCEPTION:
// Return so that the STUB can demarshal the reply.
return TAO_INVOKE_OK;
- case TAO_GIOP_USER_EXCEPTION:
+ case TAO_PLUGGABLE_MESSAGE_USER_EXCEPTION:
// Return so the exception can be handled.
return TAO_INVOKE_EXCEPTION;
- case TAO_GIOP_SYSTEM_EXCEPTION:
+ case TAO_PLUGGABLE_MESSAGE_SYSTEM_EXCEPTION:
{
// @@ Add the location macros for this exceptions...
@@ -889,7 +880,7 @@ TAO_GIOP_Twoway_Invocation::invoke_i (CORBA::Environment &ACE_TRY_ENV)
}
// NOTREACHED.
- case TAO_GIOP_LOCATION_FORWARD:
+ 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);
@@ -932,8 +923,11 @@ TAO_GIOP_Oneway_Invocation::start (CORBA::Environment &ACE_TRY_ENV)
this->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->profile_,
+ this->target_spec_,
this->out_stream_,
ACE_TRY_ENV);
}
@@ -953,13 +947,13 @@ TAO_GIOP_Oneway_Invocation::invoke (CORBA::Environment &ACE_TRY_ENV)
// Create this only if a reply is required.
TAO_Synch_Reply_Dispatcher rd (this->orb_core_,
- this->service_info_);
+ 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.
int retval =
- this->transport_->tms ()->bind_dispatcher (this->request_id_,
+ this->transport_->tms ()->bind_dispatcher (this->op_details_.request_id (),
&rd);
if (retval == -1)
{
@@ -1034,11 +1028,11 @@ TAO_GIOP_Oneway_Invocation::invoke (CORBA::Environment &ACE_TRY_ENV)
switch (reply_status)
{
- case TAO_GIOP_NO_EXCEPTION:
+ case TAO_PLUGGABLE_MESSAGE_NO_EXCEPTION:
// Return so that the STUB can demarshal the reply.
return TAO_INVOKE_OK;
- case TAO_GIOP_USER_EXCEPTION:
+ case TAO_PLUGGABLE_MESSAGE_USER_EXCEPTION:
{
// Pull the exception from the stream.
CORBA::String_var buf;
@@ -1059,7 +1053,7 @@ TAO_GIOP_Oneway_Invocation::invoke (CORBA::Environment &ACE_TRY_ENV)
TAO_INVOKE_EXCEPTION);
}
- case TAO_GIOP_SYSTEM_EXCEPTION:
+ case TAO_PLUGGABLE_MESSAGE_SYSTEM_EXCEPTION:
{
// @@ Add the location macros for these exceptions...
@@ -1108,7 +1102,7 @@ TAO_GIOP_Oneway_Invocation::invoke (CORBA::Environment &ACE_TRY_ENV)
return TAO_INVOKE_OK;
}
- case TAO_GIOP_LOCATION_FORWARD:
+ case TAO_PLUGGABLE_MESSAGE_LOCATION_FORWARD:
// Handle the forwarding and return so the stub restarts the
// request!
return this->location_forward (rd.reply_cdr (),
@@ -1134,9 +1128,12 @@ TAO_GIOP_Locate_Request_Invocation::start (CORBA::Environment &ACE_TRY_ENV)
this->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->profile_,
- this->request_id_,
+ this->target_spec_,
+ this->op_details_,
this->out_stream_,
ACE_TRY_ENV);
}
@@ -1157,7 +1154,7 @@ TAO_GIOP_Locate_Request_Invocation::invoke (CORBA::Environment &ACE_TRY_ENV)
// Bind.
int retval =
- this->transport_->tms ()->bind_dispatcher (this->request_id_,
+ this->transport_->tms ()->bind_dispatcher (this->op_details_.request_id (),
&this->rd_);
if (retval == -1)
{
diff --git a/TAO/tao/Invocation.h b/TAO/tao/Invocation.h
index b843567904f..e76d39803fe 100644
--- a/TAO/tao/Invocation.h
+++ b/TAO/tao/Invocation.h
@@ -36,10 +36,10 @@
#endif /* ACE_LACKS_PRAGMA_ONCE */
#include "tao/ORB_Core.h"
-#include "tao/GIOP.h"
#include "tao/Any.h"
#include "tao/Reply_Dispatcher.h"
#include "tao/TAOC.h"
+#include "tao/operation_details.h"
struct TAO_Exception_Data;
class TAO_Profile;
@@ -148,19 +148,15 @@ protected:
TAO_Stub *stub_;
// The object on which this invocation is going.
- const char *opname_;
- // Name of the operation being invoked.
-
- CORBA::ULong opname_len_;
- // Precalculated length of opname_.
-
- CORBA::ULong request_id_;
- // Request ID of this operation.
-
char buffer [ACE_CDR::DEFAULT_BUFSIZE];
// Buffer used for both the output and input CDR streams, this is
// "safe" because we only one of the streams at a time.
+ TAO_Operation_Details op_details_;
+ // The relevant operation detail
+
+ TAO_Target_Specification target_spec_;
+
TAO_OutputCDR out_stream_;
// Stream into which the response is placed.
@@ -173,10 +169,6 @@ protected:
TAO_Profile *profile_;
// This invocation is using this transport, may change...
- IOP::ServiceContextList service_info_;
- // The ServiceContextList sent to the server side. Only valid
- // when sending a request.
-
ACE_Time_Value max_wait_time_value_;
ACE_Time_Value *max_wait_time_;
// The timeout remaining for this request, it is initialized in
diff --git a/TAO/tao/Invocation.i b/TAO/tao/Invocation.i
index b3ed0d09ef2..9f210b5069c 100644
--- a/TAO/tao/Invocation.i
+++ b/TAO/tao/Invocation.i
@@ -6,13 +6,13 @@
ACE_INLINE IOP::ServiceContextList &
TAO_GIOP_Invocation::service_info (void)
{
- return this->service_info_;
+ return this->op_details_.service_info ();
}
ACE_INLINE CORBA::ULong
TAO_GIOP_Invocation::request_id (void)
{
- return this->request_id_;
+ return this->op_details_.request_id ();
}
ACE_INLINE TAO_OutputCDR &
@@ -30,7 +30,7 @@ TAO_GIOP_Twoway_Invocation (TAO_Stub *stub,
CORBA::ULong opname_len,
TAO_ORB_Core *orb_core)
: TAO_GIOP_Invocation (stub, operation, opname_len, orb_core),
- rd_ (orb_core, this->service_info_)
+ rd_ (orb_core, this->op_details_.service_info ())
{
}
@@ -55,7 +55,7 @@ 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->service_info_)
+ rd_ (orb_core, this->op_details_.service_info ())
{
}
diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp
index 9eb79749fb3..980eb6b9402 100644
--- a/TAO/tao/ORB_Core.cpp
+++ b/TAO/tao/ORB_Core.cpp
@@ -1,5 +1,6 @@
// $Id$
+
#include "tao/ORB_Core.h"
#include "ace/Env_Value_T.h"
@@ -225,7 +226,7 @@ TAO_ORB_Core::init (int &argc, char *argv[], CORBA::Environment &ACE_TRY_ENV)
CORBA::UShort port = 0;
// @@ GIOPLite should be an alternative ORB Messaging protocols, fredk
- int giop_lite = 0;
+ // int giop_lite = 0;
CORBA::Boolean use_ior = 1;
int cdr_tradeoff = ACE_DEFAULT_CDR_MEMCPY_TRADEOFF;
@@ -327,8 +328,11 @@ TAO_ORB_Core::init (int &argc, char *argv[], CORBA::Environment &ACE_TRY_ENV)
// @@ This will have to change since gioplite
// will be considered as an alternate ORB
// messaging protocols.
- giop_lite = 1;
-
+ // giop_lite = 1;
+ ACE_DEBUG ((LM_WARNING,
+ ASYS_TEXT ("(%P|%t) This option has been deprecated \n")
+ ASYS_TEXT ("Please use svc.conf file to load the protcol \n")));
+
arg_shifter.consume_arg ();
}
else if (arg_shifter.cur_arg_strncasecmp ("-ORBDebug") == 0)
@@ -337,7 +341,6 @@ TAO_ORB_Core::init (int &argc, char *argv[], CORBA::Environment &ACE_TRY_ENV)
// warning this turns on a daemon
ACE::debug (1);
TAO_orbdebug = 1;
-
arg_shifter.consume_arg ();
}
@@ -1154,8 +1157,6 @@ TAO_ORB_Core::init (int &argc, char *argv[], CORBA::Environment &ACE_TRY_ENV)
if (cdr_tradeoff >= 0)
this->orb_params ()->cdr_memcpy_tradeoff (cdr_tradeoff);
- this->orb_params ()->use_lite_protocol (giop_lite);
-
this->orb_params ()->std_profile_components (std_profile_components);
// Set up the pluggable protocol infrastructure. First get a
@@ -1282,12 +1283,14 @@ TAO_ORB_Core::fini (void)
// is statically added to the service configurator, fredk
if (!this->resource_factory_from_service_config_)
delete resource_factory_;
+
// @@ This is not needed since the default client factory
// is statically added to the service configurator, fredk
if (!this->client_factory_from_service_config_)
delete client_factory_;
+
// @@ This is not needed since the default server factory
// is statically added to the service configurator, fredk
if (!this->server_factory_from_service_config_)
@@ -1300,6 +1303,7 @@ TAO_ORB_Core::fini (void)
}
delete this->reactor_registry_;
+
#if (TAO_HAS_RT_CORBA == 1)
delete this->priority_mapping_;
#endif /* TAO_HAS_RT_CORBA == 1 */
diff --git a/TAO/tao/ORB_Core.h b/TAO/tao/ORB_Core.h
index 2620ebe0e54..27b7a7036ab 100644
--- a/TAO/tao/ORB_Core.h
+++ b/TAO/tao/ORB_Core.h
@@ -28,7 +28,8 @@
#include "tao/Resource_Factory.h"
#include "tao/params.h"
#include "tao/POAC.h"
-#include "tao/GIOP.h"
+
+
#include "ace/Map_Manager.h"
#include "ace/Singleton.h"
diff --git a/TAO/tao/ORB_Core.i b/TAO/tao/ORB_Core.i
index 06bc2a075b3..b850edd8915 100644
--- a/TAO/tao/ORB_Core.i
+++ b/TAO/tao/ORB_Core.i
@@ -1,6 +1,7 @@
// -*- C++ -*-
// $Id$
+
#include "ace/Dynamic_Service.h"
ACE_INLINE ACE_Thread_Manager *
diff --git a/TAO/tao/Pluggable.cpp b/TAO/tao/Pluggable.cpp
index 578204cf5e3..e3ec12bc2b6 100644
--- a/TAO/tao/Pluggable.cpp
+++ b/TAO/tao/Pluggable.cpp
@@ -4,7 +4,6 @@
#include "tao/Pluggable.h"
#include "tao/Stub.h"
#include "tao/Environment.h"
-#include "tao/GIOP.h"
#include "tao/ORB_Core.h"
#include "tao/Client_Strategy_Factory.h"
#include "tao/Wait_Strategy.h"
@@ -13,11 +12,13 @@
#include "tao/debug.h"
#include "ace/ACE.h"
+#include "tao/target_identifier.h"
#if !defined (__ACE_INLINE__)
# include "tao/Pluggable.i"
#endif /* __ACE_INLINE__ */
+
ACE_RCSID(tao, Pluggable, "$Id$")
// ****************************************************************
@@ -172,6 +173,13 @@ TAO_Transport::reset_message (ACE_Message_Block *message_block,
}
}
+int
+TAO_Transport::messaging_init (CORBA::Octet /*major*/,
+ CORBA::Octet /*minor*/)
+{
+ ACE_NOTSUP_RETURN (-1);
+}
+
// Read and handle the reply. Returns 0 when there is Short Read on
// the connection. Returns 1 when the full reply is read and
// handled. Returns -1 on errors.
@@ -216,7 +224,7 @@ TAO_Transport::leader_follower_condition_variable (void)
void
TAO_Transport::start_request (TAO_ORB_Core *,
- const TAO_Profile *,
+ TAO_Target_Specification & /*spec */,
TAO_OutputCDR &,
CORBA::Environment &ACE_TRY_ENV)
ACE_THROW_SPEC ((CORBA::SystemException))
@@ -226,8 +234,8 @@ TAO_Transport::start_request (TAO_ORB_Core *,
void
TAO_Transport::start_locate (TAO_ORB_Core *,
- const TAO_Profile *,
- CORBA::ULong,
+ TAO_Target_Specification & /*spec */,
+ TAO_Operation_Details & /* */,
TAO_OutputCDR &,
CORBA::Environment &ACE_TRY_ENV)
ACE_THROW_SPEC ((CORBA::SystemException))
diff --git a/TAO/tao/Pluggable.h b/TAO/tao/Pluggable.h
index 439b4038f3f..699ee8b8021 100644
--- a/TAO/tao/Pluggable.h
+++ b/TAO/tao/Pluggable.h
@@ -31,6 +31,7 @@
#include "tao/Typecode.h"
#include "tao/IOPC.h"
+
// Forward declarations.
class ACE_Addr;
class ACE_Reactor;
@@ -45,6 +46,10 @@ class TAO_Reply_Dispatcher;
class TAO_Transport_Mux_Strategy;
class TAO_Wait_Strategy;
+class TAO_Pluggable_Messaging_Interface;
+class TAO_Target_Specification;
+class TAO_Operation_Details;
+
typedef ACE_Message_Queue<ACE_NULL_SYNCH> TAO_Transport_Buffering_Queue;
class TAO_Export TAO_Transport
@@ -110,20 +115,21 @@ public:
// not clear this this is the best place to specify this. The actual
// timeout values will be kept in the Policies.
+
virtual void start_request (TAO_ORB_Core *orb_core,
- const TAO_Profile *profile,
+ TAO_Target_Specification &spec,
TAO_OutputCDR &output,
CORBA::Environment &ACE_TRY_ENV =
- TAO_default_environment ())
+ TAO_default_environment ())
ACE_THROW_SPEC ((CORBA::SystemException));
// Fill into <output> the right headers to make a request.
virtual void start_locate (TAO_ORB_Core *orb_core,
- const TAO_Profile *profile,
- CORBA::ULong request_id,
+ TAO_Target_Specification &spec,
+ TAO_Operation_Details &opdetails,
TAO_OutputCDR &output,
CORBA::Environment &ACE_TRY_ENV =
- TAO_default_environment ())
+ TAO_default_environment ())
ACE_THROW_SPEC ((CORBA::SystemException));
// Fill into <output> the right headers to make a locate request.
@@ -138,6 +144,13 @@ public:
// Using this method, instead of send(), allows the transport (and
// wait strategy) to take appropiate action.
+ virtual CORBA::Boolean
+ send_request_header (TAO_Operation_Details &op_details,
+ TAO_Target_Specification &spec,
+ TAO_OutputCDR &msg) = 0;
+ // This is a request for the transport object to write a request
+ // header before it sends out a request
+
TAO_ORB_Core *orb_core (void) const;
// Access the ORB that owns this connection.
@@ -190,6 +203,13 @@ public:
ssize_t send_buffered_messages (const ACE_Time_Value *max_wait_time = 0);
// Send any messages that have been buffered.
+ virtual int
+ messaging_init (CORBA::Octet major,
+ CORBA::Octet minor);
+ // Initialising the messaging object. This would be used by the
+ // connector side. On the acceptor side the connection handler
+ // would take care of the messaging objects.
+
protected:
void dequeue_head (void);
diff --git a/TAO/tao/Pluggable.i b/TAO/tao/Pluggable.i
index 8a67c8aed7a..5e24cb367e5 100644
--- a/TAO/tao/Pluggable.i
+++ b/TAO/tao/Pluggable.i
@@ -1,6 +1,7 @@
// -*- C++ -*-
// $Id$
+
// ****************************************************************
ACE_INLINE TAO_ORB_Core *
diff --git a/TAO/tao/Reply_Dispatcher.cpp b/TAO/tao/Reply_Dispatcher.cpp
index 88a74281179..d58b09c496a 100644
--- a/TAO/tao/Reply_Dispatcher.cpp
+++ b/TAO/tao/Reply_Dispatcher.cpp
@@ -1,5 +1,6 @@
// $Id$
+
#include "tao/Reply_Dispatcher.h"
#include "tao/ORB_Core.h"
#include "tao/Leader_Follower.h"
@@ -53,14 +54,14 @@ TAO_Synch_Reply_Dispatcher::~TAO_Synch_Reply_Dispatcher (void)
// Dispatch the reply.
int
TAO_Synch_Reply_Dispatcher::dispatch_reply (CORBA::ULong reply_status,
- const TAO_GIOP_Version &version,
+ const TAO_GIOP_Version & /*version*/,
IOP::ServiceContextList &reply_ctx,
TAO_GIOP_Message_State *message_state)
{
this->reply_received_ = 1;
this->reply_status_ = reply_status;
- this->version_ = version;
+ //this->version_ = version;
// Steal the buffer, that way we don't do any unnecesary copies of
// this data.
@@ -158,12 +159,12 @@ 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,
+ const TAO_GIOP_Version & /*version*/,
IOP::ServiceContextList &reply_ctx,
TAO_GIOP_Message_State *message_state)
{
this->reply_status_ = reply_status;
- this->version_ = version;
+ // this->version_ = version;
this->message_state_ = message_state;
// Steal the buffer, that way we don't do any unnecesary copies of
@@ -183,17 +184,17 @@ TAO_Asynch_Reply_Dispatcher::dispatch_reply (CORBA::ULong reply_status,
CORBA::ULong reply_error = TAO_AMI_REPLY_NOT_OK;
switch (reply_status)
{
- case TAO_GIOP_NO_EXCEPTION:
+ case TAO_PLUGGABLE_MESSAGE_NO_EXCEPTION:
reply_error = TAO_AMI_REPLY_OK;
break;
- case TAO_GIOP_USER_EXCEPTION:
+ case TAO_PLUGGABLE_MESSAGE_USER_EXCEPTION:
reply_error = TAO_AMI_REPLY_USER_EXCEPTION;
break;
- case TAO_GIOP_SYSTEM_EXCEPTION:
+ case TAO_PLUGGABLE_MESSAGE_SYSTEM_EXCEPTION:
reply_error = TAO_AMI_REPLY_SYSTEM_EXCEPTION;
break;
default:
- case TAO_GIOP_LOCATION_FORWARD:
+ case TAO_PLUGGABLE_MESSAGE_LOCATION_FORWARD:
// @@ Michael: Not even the spec mentions this case.
// We have to think about this case.
// Handle the forwarding and return so the stub restarts the
@@ -258,13 +259,13 @@ TAO_DII_Deferred_Reply_Dispatcher::~TAO_DII_Deferred_Reply_Dispatcher (void)
int
TAO_DII_Deferred_Reply_Dispatcher::dispatch_reply (
CORBA::ULong reply_status,
- const TAO_GIOP_Version &version,
+ const TAO_GIOP_Version & /*version*/,
IOP::ServiceContextList &reply_ctx,
TAO_GIOP_Message_State *message_state
)
{
this->reply_status_ = reply_status;
- this->version_ = version;
+ //this->version_ = version;
this->message_state_ = message_state;
// Steal the buffer, that way we don't do any unnecesary copies of
diff --git a/TAO/tao/Reply_Dispatcher.h b/TAO/tao/Reply_Dispatcher.h
index 6ac37cd0245..e1400576ad2 100644
--- a/TAO/tao/Reply_Dispatcher.h
+++ b/TAO/tao/Reply_Dispatcher.h
@@ -1,6 +1,7 @@
// This may look like C, but it's really -*- C++ -*-
// $Id$
+
// ============================================================================
//
// = LIBRARY
@@ -20,9 +21,11 @@
#ifndef TAO_REPLY_DISPATCHER_H
#define TAO_REPLY_DISPATCHER_H
-#include "tao/GIOP.h"
#include "tao/Request.h"
+#include "tao/GIOP_Utils.h"
+// This should not be here. Please see below for reasons
+
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
@@ -121,12 +124,16 @@ private:
CORBA::ULong reply_status_;
// Reply or LocateReply status.
- TAO_GIOP_Version version_;
+ // 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
+ // (Reply_despatcher) are aware of the underlying messaging
+ // protocol. But for the present let us close our eyes till we are
+ // able to iterate on a use case - Bala.
+
int reply_received_;
// Flag that indicates the reply has been received.
@@ -194,7 +201,7 @@ private:
CORBA::ULong reply_status_;
// Reply or LocateReply status.
- TAO_GIOP_Version version_;
+ // TAO_GIOP_Version version_;
// The version
TAO_GIOP_Message_State *message_state_;
@@ -269,7 +276,7 @@ private:
CORBA::ULong reply_status_;
// Reply or LocateReply status.
- TAO_GIOP_Version version_;
+ //TAO_GIOP_Version version_;
// The version
TAO_GIOP_Message_State *message_state_;
diff --git a/TAO/tao/Reply_Dispatcher.i b/TAO/tao/Reply_Dispatcher.i
index ad5b11296ee..7f4dd63d0d8 100644
--- a/TAO/tao/Reply_Dispatcher.i
+++ b/TAO/tao/Reply_Dispatcher.i
@@ -1,16 +1,19 @@
// $Id$
+
ACE_INLINE CORBA::ULong
TAO_Synch_Reply_Dispatcher::reply_status (void) const
{
return this->reply_status_;
}
+#if 0
ACE_INLINE const TAO_GIOP_Version&
TAO_Synch_Reply_Dispatcher::version (void) const
{
return this->version_;
}
+#endif /*if 0*/
#if (TAO_HAS_CORBA_MESSAGING == 1)
@@ -22,12 +25,13 @@ 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)
{
@@ -48,12 +52,15 @@ 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)
{
diff --git a/TAO/tao/SHMIOP_Acceptor.cpp b/TAO/tao/SHMIOP_Acceptor.cpp
index 2faf5b9c382..0a3dc351921 100644
--- a/TAO/tao/SHMIOP_Acceptor.cpp
+++ b/TAO/tao/SHMIOP_Acceptor.cpp
@@ -9,7 +9,6 @@
#include "tao/MProfile.h"
#include "tao/ORB_Core.h"
#include "tao/Server_Strategy_Factory.h"
-#include "tao/GIOP.h"
#include "tao/debug.h"
#if !defined(__ACE_INLINE__)
@@ -44,7 +43,7 @@ template class TAO_Accept_Strategy<TAO_SHMIOP_Server_Connection_Handler, ACE_MEM
#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
-TAO_SHMIOP_Acceptor::TAO_SHMIOP_Acceptor (void)
+TAO_SHMIOP_Acceptor::TAO_SHMIOP_Acceptor (CORBA::Boolean flag)
: TAO_Acceptor (TAO_TAG_SHMEM_PROFILE),
version_ (TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR),
orb_core_ (0),
@@ -53,7 +52,8 @@ TAO_SHMIOP_Acceptor::TAO_SHMIOP_Acceptor (void)
concurrency_strategy_ (0),
accept_strategy_ (0),
mmap_file_prefix_ (0),
- mmap_size_ (1024 * 1024)
+ mmap_size_ (1024 * 1024),
+ lite_flag_ (flag)
{
}
@@ -176,7 +176,8 @@ TAO_SHMIOP_Acceptor::open_i (TAO_ORB_Core* orb_core)
this->orb_core_ = orb_core;
ACE_NEW_RETURN (this->creation_strategy_,
- TAO_SHMIOP_CREATION_STRATEGY (this->orb_core_),
+ TAO_SHMIOP_CREATION_STRATEGY (this->orb_core_,
+ this->lite_flag_),
-1);
ACE_NEW_RETURN (this->concurrency_strategy_,
diff --git a/TAO/tao/SHMIOP_Acceptor.h b/TAO/tao/SHMIOP_Acceptor.h
index 985b907e804..7a8102796ec 100644
--- a/TAO/tao/SHMIOP_Acceptor.h
+++ b/TAO/tao/SHMIOP_Acceptor.h
@@ -45,7 +45,7 @@ class TAO_Export TAO_SHMIOP_Acceptor : public TAO_Acceptor
// The IIOP-specific bridge class for the concrete acceptor.
//
public:
- TAO_SHMIOP_Acceptor (void);
+ TAO_SHMIOP_Acceptor (CORBA::Boolean flag = 0);
// Constructor.
~TAO_SHMIOP_Acceptor (void);
@@ -111,6 +111,9 @@ private:
off_t mmap_size_;
// Determine the minimum size of mmap file. This dictate the
// maximum size of a CORBA method invocation.
+
+ CORBA::Boolean lite_flag_;
+ // Should we use GIOP lite??
};
#if defined(__ACE_INLINE__)
diff --git a/TAO/tao/SHMIOP_Connect.cpp b/TAO/tao/SHMIOP_Connect.cpp
index 24022e2c6ae..5f447825277 100644
--- a/TAO/tao/SHMIOP_Connect.cpp
+++ b/TAO/tao/SHMIOP_Connect.cpp
@@ -9,7 +9,8 @@
#include "tao/ORB_Core.h"
#include "tao/ORB.h"
#include "tao/CDR.h"
-#include "tao/GIOP.h"
+#include "tao/GIOP_Message_Acceptors.h"
+#include "tao/GIOP_Message_Lite.h"
#if !defined (__ACE_INLINE__)
# include "tao/SHMIOP_Connect.i"
@@ -68,6 +69,7 @@ TAO_SHMIOP_Handler_Base::TAO_SHMIOP_Handler_Base (ACE_Thread_Manager *t)
TAO_SHMIOP_Server_Connection_Handler::TAO_SHMIOP_Server_Connection_Handler (ACE_Thread_Manager *t)
: TAO_SHMIOP_Handler_Base (t),
transport_ (this, 0),
+ acceptor_factory_ (0),
orb_core_ (0),
tss_resources_ (0),
refcount_ (1)
@@ -81,13 +83,26 @@ TAO_SHMIOP_Server_Connection_Handler::TAO_SHMIOP_Server_Connection_Handler (ACE_
ACE_ASSERT (this->orb_core_ != 0);
}
-TAO_SHMIOP_Server_Connection_Handler::TAO_SHMIOP_Server_Connection_Handler (TAO_ORB_Core *orb_core)
+TAO_SHMIOP_Server_Connection_Handler::TAO_SHMIOP_Server_Connection_Handler (TAO_ORB_Core *orb_core,
+ CORBA::Boolean flag)
: TAO_SHMIOP_Handler_Base (orb_core),
transport_ (this, orb_core),
+ acceptor_factory_ (0),
orb_core_ (orb_core),
tss_resources_ (orb_core->get_tss_resources ()),
- refcount_ (1)
+ refcount_ (1),
+ lite_flag_ (flag)
{
+ if (lite_flag_)
+ {
+ ACE_NEW (this->acceptor_factory_,
+ TAO_GIOP_Message_Lite (orb_core));
+ }
+ else
+ {
+ ACE_NEW (this->acceptor_factory_,
+ TAO_GIOP_Message_Acceptors (orb_core));
+ }
}
TAO_SHMIOP_Server_Connection_Handler::~TAO_SHMIOP_Server_Connection_Handler (void)
@@ -268,10 +283,10 @@ TAO_SHMIOP_Server_Connection_Handler::handle_input_i (ACE_HANDLE,
{
this->refcount_++;
- int result = TAO_GIOP::handle_input (this->transport (),
- this->orb_core_,
- this->transport_.message_state_,
- max_wait_time);
+ int result = this->acceptor_factory_->handle_input (this->transport (),
+ this->orb_core_,
+ this->transport_.message_state_,
+ max_wait_time);
if (result == -1 && TAO_debug_level > 0)
{
@@ -312,11 +327,11 @@ TAO_SHMIOP_Server_Connection_Handler::handle_input_i (ACE_HANDLE,
// Reset the message state.
this->transport_.message_state_.reset (0);
- result = TAO_GIOP::process_server_message (this->transport (),
- this->orb_core_,
- input_cdr,
- message_type,
- giop_version);
+ result =
+ this->acceptor_factory_->process_connector_messages (this->transport (),
+ this->orb_core_,
+ input_cdr,
+ message_type);
if (result != -1)
result = 0;
@@ -332,11 +347,14 @@ TAO_SHMIOP_Server_Connection_Handler::handle_input_i (ACE_HANDLE,
// transport obj.
TAO_SHMIOP_Client_Connection_Handler::
TAO_SHMIOP_Client_Connection_Handler (ACE_Thread_Manager *t,
- TAO_ORB_Core* orb_core)
+ TAO_ORB_Core* orb_core,
+ CORBA::Boolean flag)
: TAO_SHMIOP_Handler_Base (t),
transport_ (this, orb_core),
- orb_core_ (orb_core)
+ orb_core_ (orb_core),
+ lite_flag_ (flag)
{
+ this->transport_.use_lite (lite_flag_);
}
TAO_SHMIOP_Client_Connection_Handler::~TAO_SHMIOP_Client_Connection_Handler (void)
diff --git a/TAO/tao/SHMIOP_Connect.h b/TAO/tao/SHMIOP_Connect.h
index b35e958b79d..54fb390d729 100644
--- a/TAO/tao/SHMIOP_Connect.h
+++ b/TAO/tao/SHMIOP_Connect.h
@@ -63,7 +63,8 @@ class TAO_Export TAO_SHMIOP_Client_Connection_Handler : public TAO_SHMIOP_Handle
public:
// = Intialization method.
TAO_SHMIOP_Client_Connection_Handler (ACE_Thread_Manager *t = 0,
- TAO_ORB_Core* orb_core = 0);
+ TAO_ORB_Core* orb_core = 0,
+ CORBA::Boolean flag = 0);
virtual ~TAO_SHMIOP_Client_Connection_Handler (void);
@@ -103,6 +104,12 @@ protected:
TAO_ORB_Core *orb_core_;
// Cached ORB Core.
+
+ TAO_Pluggable_Messaging_Interface *mesg_factory_;
+ // The Connector messaging factory
+
+ CORBA::Boolean lite_flag_;
+ // Are we using lite?
};
// ****************************************************************
@@ -114,7 +121,8 @@ class TAO_Export TAO_SHMIOP_Server_Connection_Handler : public TAO_SHMIOP_Handle
public:
TAO_SHMIOP_Server_Connection_Handler (ACE_Thread_Manager* t = 0);
- TAO_SHMIOP_Server_Connection_Handler (TAO_ORB_Core *orb_core);
+ TAO_SHMIOP_Server_Connection_Handler (TAO_ORB_Core *orb_core,
+ CORBA::Boolean flag);
~TAO_SHMIOP_Server_Connection_Handler (void);
// Constructor.
@@ -163,6 +171,9 @@ protected:
TAO_SHMIOP_Server_Transport transport_;
// @@ New transport object reference.
+ TAO_Pluggable_Messaging_Interface *acceptor_factory_;
+ // Messaging acceptor factory
+
TAO_ORB_Core *orb_core_;
// Cached ORB Core.
@@ -171,6 +182,9 @@ protected:
u_long refcount_;
// Reference count, to avoid early deletes...
+
+ CORBA::Boolean lite_flag_;
+ // Should we use GIOP or GIOPlite
};
#if defined (__ACE_INLINE__)
diff --git a/TAO/tao/SHMIOP_Connector.cpp b/TAO/tao/SHMIOP_Connector.cpp
index c8fe1994bba..36501849f49 100644
--- a/TAO/tao/SHMIOP_Connector.cpp
+++ b/TAO/tao/SHMIOP_Connector.cpp
@@ -6,7 +6,6 @@
#if defined (TAO_HAS_SHMIOP) && (TAO_HAS_SHMIOP != 0)
#include "tao/SHMIOP_Profile.h"
-#include "tao/GIOP.h"
#include "tao/debug.h"
#include "tao/ORB_Core.h"
#include "tao/Client_Strategy_Factory.h"
@@ -295,9 +294,11 @@ template class ACE_Refcounted_Recyclable_Handler_Caching_Utility<TAO_ADDR, TAO_C
TAO_SHMIOP_Connect_Creation_Strategy::
TAO_SHMIOP_Connect_Creation_Strategy (ACE_Thread_Manager* t,
- TAO_ORB_Core *orb_core)
+ TAO_ORB_Core *orb_core,
+ CORBA::Boolean flag)
: ACE_Creation_Strategy<TAO_SHMIOP_Client_Connection_Handler> (t),
- orb_core_ (orb_core)
+ orb_core_ (orb_core),
+ lite_flag_ (flag)
{
}
@@ -323,10 +324,11 @@ typedef ACE_Cached_Connect_Strategy<TAO_SHMIOP_Client_Connection_Handler,
TAO_CACHED_CONNECT_STRATEGY;
#endif /* ! TAO_USES_ROBUST_CONNECTION_MGMT */
-TAO_SHMIOP_Connector::TAO_SHMIOP_Connector (void)
+TAO_SHMIOP_Connector::TAO_SHMIOP_Connector (CORBA::Octet flag)
: TAO_Connector (TAO_TAG_SHMEM_PROFILE),
orb_core_ (0),
- base_connector_ ()
+ base_connector_ (),
+ lite_flag_ (flag)
#if defined (TAO_USES_ROBUST_CONNECTION_MGMT)
,
cached_connect_strategy_ (0),
@@ -350,7 +352,8 @@ TAO_SHMIOP_Connector::open (TAO_ORB_Core *orb_core)
ACE_NEW_RETURN (connect_creation_strategy,
TAO_SHMIOP_Connect_Creation_Strategy
(this->orb_core_->thr_mgr (),
- this->orb_core_),
+ this->orb_core_,
+ this->lite_flag_),
-1);
auto_ptr<TAO_SHMIOP_Connect_Creation_Strategy>
@@ -491,6 +494,22 @@ TAO_SHMIOP_Connector::connect (TAO_Profile *profile,
}
transport = svc_handler->transport ();
+
+ // Now that we have the client connection handler object we need to
+ // set the right messaging protocol for the connection handler.
+ const TAO_GIOP_Version& version = shmiop_profile->version ();
+ int ret_val = transport->messaging_init (version.major,
+ version.minor);
+ if (ret_val == -1)
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ASYS_TEXT ("(%N|%l|%p|%t) init_mesg_protocol () failed \n")));
+ }
+ return -1;
+ }
+
return 0;
}
diff --git a/TAO/tao/SHMIOP_Connector.h b/TAO/tao/SHMIOP_Connector.h
index 2136a874d26..30a546d1774 100644
--- a/TAO/tao/SHMIOP_Connector.h
+++ b/TAO/tao/SHMIOP_Connector.h
@@ -60,7 +60,8 @@ class TAO_Export TAO_SHMIOP_Connect_Creation_Strategy : public ACE_Creation_Stra
//
public:
TAO_SHMIOP_Connect_Creation_Strategy (ACE_Thread_Manager * = 0,
- TAO_ORB_Core* orb_core = 0);
+ TAO_ORB_Core* orb_core = 0,
+ CORBA::Boolean flag = 0);
virtual int make_svc_handler (TAO_SHMIOP_Client_Connection_Handler *&sh);
// Makes TAO_SHMIOP_Client_Connection_Handlers
@@ -68,6 +69,9 @@ public:
private:
TAO_ORB_Core* orb_core_;
// The ORB
+
+ CORBA::Boolean lite_flag_;
+ // Are we using lite?
};
// ****************************************************************
@@ -84,7 +88,7 @@ class TAO_Export TAO_SHMIOP_Connector : public TAO_Connector
//
public:
// = Initialization and termination methods.
- TAO_SHMIOP_Connector (void);
+ TAO_SHMIOP_Connector (CORBA::Boolean flag = 0);
// Constructor.
// = The TAO_Connector methods, please check the documentation on
@@ -197,6 +201,8 @@ private:
TAO_SHMIOP_BASE_CONNECTOR base_connector_;
// The connector initiating connection requests for SHMIOP.
+ CORBA::Boolean lite_flag_;
+ // Do we need to use a GIOP_Lite for sending messages?
#if defined (TAO_USES_ROBUST_CONNECTION_MGMT)
TAO_CACHED_CONNECT_STRATEGY *cached_connect_strategy_;
// Cached connect strategy.
diff --git a/TAO/tao/SHMIOP_Transport.cpp b/TAO/tao/SHMIOP_Transport.cpp
index 73adeab19cb..a346fa5fe74 100644
--- a/TAO/tao/SHMIOP_Transport.cpp
+++ b/TAO/tao/SHMIOP_Transport.cpp
@@ -16,6 +16,13 @@
#include "tao/ORB_Core.h"
#include "tao/debug.h"
+#include "tao/GIOP_Message_Lite.h"
+#include "tao/GIOP_Message_Connectors.h"
+
+#if !defined (__ACE_INLINE__)
+# include "tao/SHMIOP_Transport.i"
+#endif /* ! __ACE_INLINE__ */
+
#if defined (ACE_ENABLE_TIMEPROBES)
static const char *TAO_Transport_Timeprobe_Description[] =
@@ -119,7 +126,11 @@ TAO_SHMIOP_Client_Transport::
TAO_ORB_Core *orb_core)
: TAO_SHMIOP_Transport (handler,
orb_core),
- client_handler_ (handler)
+ client_handler_ (handler),
+ client_mesg_factory_ (0),
+ orb_core_ (orb_core),
+ lite_flag_ (0),
+ params_ ()
{
}
@@ -134,15 +145,14 @@ TAO_SHMIOP_Client_Transport::client_handler (void)
}
void
-TAO_SHMIOP_Client_Transport::start_request (TAO_ORB_Core *orb_core,
- const TAO_Profile* pfile,
+TAO_SHMIOP_Client_Transport::start_request (TAO_ORB_Core * /*orb_core*/,
+ TAO_Target_Specification & /*spec */,
TAO_OutputCDR &output,
CORBA::Environment &ACE_TRY_ENV)
ACE_THROW_SPEC ((CORBA::SystemException))
{
TAO_FUNCTION_PP_TIMEPROBE (TAO_SHMIOP_CLIENT_TRANSPORT_START_REQUEST_START);
-
- const TAO_SHMIOP_Profile* profile =
+ /*const TAO_SHMIOP_Profile* profile =
ACE_dynamic_cast(const TAO_SHMIOP_Profile*, pfile);
// @@ This should be implemented in the transport object, which
@@ -151,35 +161,32 @@ TAO_SHMIOP_Client_Transport::start_request (TAO_ORB_Core *orb_core,
TAO_GIOP::Request,
output,
orb_core) == 0)
+ ACE_THROW (CORBA::MARSHAL ());*/
+ if (this->client_mesg_factory_->write_protocol_header
+ (TAO_PLUGGABLE_MESSAGE_REQUEST,
+ output) == 0)
ACE_THROW (CORBA::MARSHAL ());
}
void
-TAO_SHMIOP_Client_Transport::start_locate (TAO_ORB_Core *orb_core,
- const TAO_Profile* pfile,
- CORBA::ULong request_id,
+TAO_SHMIOP_Client_Transport::start_locate (TAO_ORB_Core * /*orb_core*/,
+ TAO_Target_Specification &spec,
+ TAO_Operation_Details &opdetails,
TAO_OutputCDR &output,
CORBA::Environment &ACE_TRY_ENV)
ACE_THROW_SPEC ((CORBA::SystemException))
{
- const TAO_SHMIOP_Profile* profile =
- ACE_dynamic_cast(const TAO_SHMIOP_Profile*, pfile);
-
- // Obtain object key.
- const TAO_ObjectKey& key = profile->object_key ();
-
- // @@ This should be implemented in the transport object, which
- // would query the profile to obtain the version...
- if (TAO_GIOP::start_message (profile->version (),
- TAO_GIOP::LocateRequest,
- output,
- orb_core) == 0)
+ // See this is GIOP way of doing this..But anyway SHMIOP will be tied
+ // up with GIOP.
+ if (this->client_mesg_factory_->write_protocol_header
+ (TAO_PLUGGABLE_MESSAGE_LOCATEREQUEST,
+ output) == 0)
ACE_THROW (CORBA::MARSHAL ());
-
-
- if (TAO_GIOP::write_locate_request_header (request_id,
- key,
- output) == 0)
+
+ if (this->client_mesg_factory_->write_message_header (opdetails,
+ TAO_PLUGGABLE_MESSAGE_LOCATE_REQUEST_HEADER,
+ spec,
+ output) == 0)
ACE_THROW (CORBA::MARSHAL ());
}
@@ -194,13 +201,12 @@ TAO_SHMIOP_Client_Transport::send_request (TAO_Stub *stub,
two_way) == -1)
return -1;
- if (TAO_GIOP::send_message (this,
- stream,
- orb_core,
- max_wait_time,
- stub) == -1)
+ if (this->client_mesg_factory_->send_message (this,
+ stream,
+ max_wait_time,
+ stub,
+ two_way) == -1)
return -1;
-
return this->idle_after_send ();
}
@@ -229,10 +235,10 @@ TAO_SHMIOP_Client_Transport::handle_client_input (int /* block */,
return -1;
}
- int result = TAO_GIOP::handle_input (this,
- this->orb_core_,
- *message_state,
- max_wait_time);
+ int result = this->client_mesg_factory_->handle_input (this,
+ this->orb_core_,
+ *message_state,
+ max_wait_time);
if (result == -1)
{
if (TAO_debug_level > 0)
@@ -246,16 +252,9 @@ TAO_SHMIOP_Client_Transport::handle_client_input (int /* block */,
// OK, the complete message is here...
- IOP::ServiceContextList reply_ctx;
- CORBA::ULong request_id;
- CORBA::ULong reply_status;
-
- result = TAO_GIOP::parse_reply (this,
- this->orb_core_,
- *message_state,
- reply_ctx,
- request_id,
- reply_status);
+ result = this->client_mesg_factory_->parse_reply (*message_state,
+ this->params_);
+
if (result == -1)
{
if (TAO_debug_level > 0)
@@ -267,10 +266,10 @@ TAO_SHMIOP_Client_Transport::handle_client_input (int /* block */,
}
result =
- this->tms_->dispatch_reply (request_id,
- reply_status,
+ this->tms_->dispatch_reply (this->params_.request_id_,
+ this->params_.reply_status_,
message_state->giop_version,
- reply_ctx,
+ this->params_.svc_ctx_,
message_state);
if (result == -1)
@@ -310,6 +309,73 @@ TAO_SHMIOP_Client_Transport::register_handler (void)
ACE_Event_Handler::READ_MASK);
}
+int
+TAO_SHMIOP_Client_Transport::messaging_init (CORBA::Octet major,
+ CORBA::Octet minor)
+{
+ if (this->client_mesg_factory_ == 0)
+ {
+ if (this->lite_flag_)
+ {
+ ACE_NEW_RETURN (this->client_mesg_factory_,
+ TAO_GIOP_Message_Lite (this->orb_core_),
+ -1);
+ }
+ else if (major == TAO_DEF_GIOP_MAJOR)
+ {
+ if (minor > TAO_DEF_GIOP_MINOR)
+ minor = TAO_DEF_GIOP_MINOR;
+ switch (minor)
+ {
+ case 0:
+ ACE_NEW_RETURN (this->client_mesg_factory_,
+ TAO_GIOP_Message_Connector_10,
+ 0);
+ break;
+ case 1:
+ ACE_NEW_RETURN (this->client_mesg_factory_,
+ TAO_GIOP_Message_Connector_11,
+ 0);
+ break;
+ default:
+ if (TAO_debug_level > 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ASYS_TEXT ("(%N|%l|%p|%t) No matching minor version number \n")),
+ 0);
+ }
+ }
+ }
+ else
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ASYS_TEXT ("(%N|%l|%p|%t) No matching major version number \n")),
+ 0);
+ }
+ }
+ }
+
+ return 1;
+}
+
+CORBA::Boolean
+TAO_SHMIOP_Client_Transport::send_request_header (TAO_Operation_Details &opdetails,
+ TAO_Target_Specification &spec,
+ TAO_OutputCDR & msg)
+{
+ // We are going to pass on this request to the underlying messaging
+ // layer. It should take care of this request
+ CORBA::Boolean retval =
+ this->client_mesg_factory_->write_message_header (opdetails,
+ TAO_PLUGGABLE_MESSAGE_REQUEST_HEADER,
+ spec,
+ msg);
+
+ return retval;
+}
+
// *********************************************************************
ssize_t
@@ -378,4 +444,14 @@ TAO_SHMIOP_Transport::send_request (TAO_Stub *,
return -1;
}
+CORBA::Boolean
+TAO_SHMIOP_Transport::send_request_header (TAO_Operation_Details & /**/,
+ TAO_Target_Specification & /*spec */ ,
+ TAO_OutputCDR & /*msg*/)
+{
+ // We should never be here. So return an error.
+ return 0;
+}
+
+
#endif /* TAO_HAS_SHMIOP && TAO_HAS_SHMIOP != 0 */
diff --git a/TAO/tao/SHMIOP_Transport.h b/TAO/tao/SHMIOP_Transport.h
index 830b7d6c02d..8216336a303 100644
--- a/TAO/tao/SHMIOP_Transport.h
+++ b/TAO/tao/SHMIOP_Transport.h
@@ -29,7 +29,7 @@
#if defined (TAO_HAS_SHMIOP) && (TAO_HAS_SHMIOP != 0)
#include "tao/Pluggable.h"
-#include "tao/GIOP.h"
+#include "tao/GIOP_Utils.h"
// Forward decls.
class TAO_SHMIOP_Handler_Base;
@@ -81,6 +81,10 @@ public:
TAO_OutputCDR &stream,
int twoway,
ACE_Time_Value *max_wait_time);
+ virtual CORBA::Boolean
+ send_request_header (TAO_Operation_Details &opdetails,
+ TAO_Target_Specification &spec,
+ TAO_OutputCDR &msg);
protected:
TAO_SHMIOP_Handler_Base *handler_;
@@ -114,13 +118,14 @@ public:
// = The TAO_Transport methods, please check the documentation in
// "tao/Pluggable.h" for more details.
virtual void start_request (TAO_ORB_Core *orb_core,
- const TAO_Profile *profile,
+ TAO_Target_Specification & /*spec */,
TAO_OutputCDR &output,
CORBA::Environment &ACE_TRY_ENV = TAO_default_environment ())
ACE_THROW_SPEC ((CORBA::SystemException));
+
virtual void start_locate (TAO_ORB_Core *orb_core,
- const TAO_Profile *profile,
- CORBA::ULong request_id,
+ TAO_Target_Specification &spec,
+ TAO_Operation_Details &opdetails,
TAO_OutputCDR &output,
CORBA::Environment &ACE_TRY_ENV = TAO_default_environment ())
ACE_THROW_SPEC ((CORBA::SystemException));
@@ -133,9 +138,34 @@ public:
ACE_Time_Value *max_time_value = 0);
virtual int register_handler (void);
+ virtual CORBA::Boolean
+ send_request_header (TAO_Operation_Details &opdetails,
+ TAO_Target_Specification &spec,
+ TAO_OutputCDR &msg);
+
+ int messaging_init (CORBA::Octet major,
+ CORBA::Octet minor);
+ // Initialising the messaging object
+
+ void use_lite (CORBA::Boolean flag);
+ // Sets the lite flag
+
private:
TAO_SHMIOP_Client_Connection_Handler *client_handler_;
// pointer to the corresponding client side connection handler.
+
+ TAO_Pluggable_Messaging_Interface *client_mesg_factory_;
+ // The message_factor instance specific for this particular
+ // transport protocol.
+
+ TAO_ORB_Core *orb_core_;
+ // Our ORB core
+
+ CORBA::Boolean lite_flag_;
+ // Are we using lite?
+
+ TAO_Pluggable_Connector_Params params_;
+ // The reply data that is sent back by the server
};
// ****************************************************************
@@ -158,7 +188,7 @@ public:
~TAO_SHMIOP_Server_Transport (void);
// Default destructor
-
+
TAO_SHMIOP_Server_Connection_Handler *server_handler_;
// Pointer to the corresponding connection handler.
@@ -167,6 +197,10 @@ public:
// non-blocking reads, fragment reassembly, etc.
};
+#if defined (__ACE_INLINE__)
+#include "tao/SHMIOP_Transport.i"
+#endif /* __ACE_INLINE__ */
+
#endif /* TAO_HAS_SHMIOP && TAO_HAS_SHMIOP != 0 */
#endif /* TAO_SHMIOP_TRANSPORT_H */
diff --git a/TAO/tao/UIOP_Acceptor.cpp b/TAO/tao/UIOP_Acceptor.cpp
index 4fcc42f7188..c7ea477dec9 100644
--- a/TAO/tao/UIOP_Acceptor.cpp
+++ b/TAO/tao/UIOP_Acceptor.cpp
@@ -24,10 +24,10 @@
#include "tao/UIOP_Profile.h"
#include "tao/MProfile.h"
#include "tao/ORB_Core.h"
-#include "tao/GIOP.h"
#include "tao/Server_Strategy_Factory.h"
#include "tao/debug.h"
+
ACE_RCSID(tao, UIOP_Acceptor, "$Id$")
#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
@@ -56,7 +56,8 @@ template class TAO_Accept_Strategy<TAO_UIOP_Server_Connection_Handler, ACE_LSOCK
#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
-TAO_UIOP_Acceptor::TAO_UIOP_Acceptor (void)
+
+TAO_UIOP_Acceptor::TAO_UIOP_Acceptor (CORBA::Boolean flag)
: TAO_Acceptor (TAO_TAG_UIOP_PROFILE),
base_acceptor_ (),
creation_strategy_ (0),
@@ -64,7 +65,8 @@ TAO_UIOP_Acceptor::TAO_UIOP_Acceptor (void)
accept_strategy_ (0),
version_ (TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR),
orb_core_ (0),
- unlink_on_close_ (1)
+ unlink_on_close_ (1),
+ lite_flag_ (flag)
{
}
@@ -196,7 +198,8 @@ TAO_UIOP_Acceptor::open_i (TAO_ORB_Core *orb_core,
this->orb_core_ = orb_core;
ACE_NEW_RETURN (this->creation_strategy_,
- TAO_UIOP_CREATION_STRATEGY (this->orb_core_),
+ TAO_UIOP_CREATION_STRATEGY (this->orb_core_,
+ this->lite_flag_),
-1);
ACE_NEW_RETURN (this->concurrency_strategy_,
diff --git a/TAO/tao/UIOP_Acceptor.h b/TAO/tao/UIOP_Acceptor.h
index 2a1145c6053..7a3f9893f0f 100644
--- a/TAO/tao/UIOP_Acceptor.h
+++ b/TAO/tao/UIOP_Acceptor.h
@@ -1,6 +1,7 @@
// This may look like C, but it's really -*- C++ -*-
// $Id$
+
// ============================================================================
//
// = LIBRARY
@@ -22,6 +23,7 @@
#define TAO_UIOP_ACCEPTOR_H
#include "tao/Pluggable.h"
+#include "tao/GIOP_Utils.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
@@ -47,7 +49,7 @@ public:
// TAO_UIOP_Acceptor (ACE_UNIX_Addr &addr);
// Create Acceptor object using addr.
- TAO_UIOP_Acceptor (void);
+ TAO_UIOP_Acceptor (CORBA::Boolean flag = 0);
// Create Acceptor object using addr.
virtual ~TAO_UIOP_Acceptor (void);
@@ -103,6 +105,9 @@ private:
// Flag that determines whether or not the rendezvous point should
// be unlinked on close. This is really only used when an error
// occurs.
+
+ CORBA::Boolean lite_flag_;
+ // Should we use GIOP lite??
};
# endif /* TAO_HAS_UIOP == 1 */
diff --git a/TAO/tao/UIOP_Connect.cpp b/TAO/tao/UIOP_Connect.cpp
index 05dda5f23f5..c11308ff822 100644
--- a/TAO/tao/UIOP_Connect.cpp
+++ b/TAO/tao/UIOP_Connect.cpp
@@ -1,11 +1,11 @@
// $Id$
+
#include "tao/UIOP_Connect.h"
#if TAO_HAS_UIOP == 1
#include "tao/UIOP_Transport.h"
-#include "tao/GIOP.h"
#include "tao/debug.h"
#include "tao/ORB_Core.h"
#include "tao/ORB.h"
@@ -20,6 +20,9 @@
ACE_RCSID(tao, UIOP_Connect, "$Id$")
+#include "tao/GIOP_Message_Acceptors.h"
+#include "tao/GIOP_Message_Lite.h"
+
#if defined (ACE_ENABLE_TIMEPROBES)
static const char *TAO_UIOP_Connect_Timeprobe_Description[] =
@@ -74,7 +77,8 @@ TAO_UIOP_Server_Connection_Handler::TAO_UIOP_Server_Connection_Handler (ACE_Thre
transport_ (this, 0),
orb_core_ (0),
tss_resources_ (0),
- refcount_ (1)
+ refcount_ (1),
+ lite_flag_ (0)
{
// This constructor should *never* get called, it is just here to
// make the compiler happy: the default implementation of the
@@ -84,17 +88,31 @@ TAO_UIOP_Server_Connection_Handler::TAO_UIOP_Server_Connection_Handler (ACE_Thre
ACE_ASSERT (this->orb_core_ != 0);
}
-TAO_UIOP_Server_Connection_Handler::TAO_UIOP_Server_Connection_Handler (TAO_ORB_Core *orb_core)
+TAO_UIOP_Server_Connection_Handler::TAO_UIOP_Server_Connection_Handler (TAO_ORB_Core *orb_core,
+ CORBA::Boolean flag)
: TAO_UIOP_Handler_Base (orb_core),
transport_ (this, orb_core),
orb_core_ (orb_core),
tss_resources_ (orb_core->get_tss_resources ()),
- refcount_ (1)
+ refcount_ (1),
+ lite_flag_ (flag)
{
+ if (lite_flag_)
+ {
+ ACE_NEW (this->acceptor_factory_,
+ TAO_GIOP_Message_Lite (orb_core));
+ }
+ else
+ {
+ ACE_NEW (this->acceptor_factory_,
+ TAO_GIOP_Message_Acceptors (orb_core));
+ }
}
TAO_UIOP_Server_Connection_Handler::~TAO_UIOP_Server_Connection_Handler (void)
{
+
+ delete this->acceptor_factory_;
}
int
@@ -249,11 +267,12 @@ TAO_UIOP_Server_Connection_Handler::handle_input_i (ACE_HANDLE,
{
this->refcount_++;
- int result = TAO_GIOP::handle_input (this->transport (),
- this->orb_core_,
- this->transport_.message_state_,
- max_wait_time);
-
+ int result =
+ this->acceptor_factory_->handle_input (this->transport (),
+ this->orb_core_,
+ this->transport_.message_state_,
+ max_wait_time);
+
if (result == -1 && TAO_debug_level > 0)
{
ACE_DEBUG ((LM_DEBUG,
@@ -293,11 +312,12 @@ TAO_UIOP_Server_Connection_Handler::handle_input_i (ACE_HANDLE,
// Reset the message state.
this->transport_.message_state_.reset (0);
- result = TAO_GIOP::process_server_message (this->transport (),
- this->orb_core_,
- input_cdr,
- message_type,
- giop_version);
+ result =
+ this->acceptor_factory_->process_connector_messages (this->transport (),
+ this->orb_core_,
+ input_cdr,
+ message_type);
+
if (result != -1)
result = 0;
@@ -312,15 +332,19 @@ TAO_UIOP_Server_Connection_Handler::handle_input_i (ACE_HANDLE,
TAO_UIOP_Client_Connection_Handler::
TAO_UIOP_Client_Connection_Handler (ACE_Thread_Manager *t,
- TAO_ORB_Core* orb_core)
+ TAO_ORB_Core* orb_core,
+ CORBA::Boolean flag)
: TAO_UIOP_Handler_Base (t),
transport_ (this, orb_core),
- orb_core_ (orb_core)
+ orb_core_ (orb_core),
+ lite_flag_ (flag)
{
+ this->transport_.use_lite (flag);
}
TAO_UIOP_Client_Connection_Handler::~TAO_UIOP_Client_Connection_Handler (void)
{
+ delete this->mesg_factory_;
}
// @@ Should I do something here to enable non-blocking?? (Alex).
@@ -495,6 +519,7 @@ TAO_UIOP_Client_Connection_Handler::handle_cleanup (void)
return 0;
}
+
// ****************************************************************
#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
diff --git a/TAO/tao/UIOP_Connect.h b/TAO/tao/UIOP_Connect.h
index 9a6f8f4ef0c..986ac8e28ab 100644
--- a/TAO/tao/UIOP_Connect.h
+++ b/TAO/tao/UIOP_Connect.h
@@ -1,6 +1,7 @@
// This may look like C, but it's really -*- C++ -*-
// $Id$
+
// ============================================================================
//
// = LIBRARY
@@ -33,7 +34,7 @@
#include "tao/corbafwd.h"
#include "tao/Wait_Strategy.h"
-
+#include "tao/Pluggable_Messaging.h"
// Forward Decls
class TAO_ORB_Core;
@@ -62,7 +63,8 @@ class TAO_Export TAO_UIOP_Client_Connection_Handler : public TAO_UIOP_Handler_Ba
public:
// = Intialization method.
TAO_UIOP_Client_Connection_Handler (ACE_Thread_Manager *t = 0,
- TAO_ORB_Core* orb_core = 0);
+ TAO_ORB_Core* orb_core = 0,
+ CORBA::Boolean flag = 0);
virtual ~TAO_UIOP_Client_Connection_Handler (void);
@@ -101,6 +103,12 @@ protected:
TAO_ORB_Core *orb_core_;
// Cached ORB Core.
+
+ TAO_Pluggable_Messaging_Interface *mesg_factory_;
+ // The Connector messaging factory
+
+ CORBA::Boolean lite_flag_;
+ // Are we usinglite?
};
// ****************************************************************
@@ -112,7 +120,8 @@ class TAO_Export TAO_UIOP_Server_Connection_Handler : public TAO_UIOP_Handler_Ba
public:
TAO_UIOP_Server_Connection_Handler (ACE_Thread_Manager* t = 0);
- TAO_UIOP_Server_Connection_Handler (TAO_ORB_Core *orb_core);
+ TAO_UIOP_Server_Connection_Handler (TAO_ORB_Core *orb_core,
+ CORBA::Boolean flag = 0);
// Constructor.
~TAO_UIOP_Server_Connection_Handler (void);
@@ -146,6 +155,9 @@ protected:
TAO_UIOP_Server_Transport transport_;
// @@ New transport object reference.
+ TAO_Pluggable_Messaging_Interface *acceptor_factory_;
+ // Messaging acceptor factory
+
// = Event Handler overloads
virtual int handle_input (ACE_HANDLE = ACE_INVALID_HANDLE);
@@ -169,6 +181,9 @@ protected:
u_long refcount_;
// Reference count, to avoid early deletes...
+
+ CORBA::Boolean lite_flag_;
+ // Should we use GIOP or GIOPlite
};
#if defined (__ACE_INLINE__)
diff --git a/TAO/tao/UIOP_Connect.i b/TAO/tao/UIOP_Connect.i
index a609f80ae7c..c79da486e4d 100644
--- a/TAO/tao/UIOP_Connect.i
+++ b/TAO/tao/UIOP_Connect.i
@@ -3,6 +3,7 @@
#if TAO_HAS_UIOP == 1
+
ACE_INLINE TAO_Transport *
TAO_UIOP_Server_Connection_Handler::transport (void)
{
diff --git a/TAO/tao/UIOP_Connector.cpp b/TAO/tao/UIOP_Connector.cpp
index 2762f2fe4ab..67ead2ce0d3 100644
--- a/TAO/tao/UIOP_Connector.cpp
+++ b/TAO/tao/UIOP_Connector.cpp
@@ -1,12 +1,12 @@
// This may look like C, but it's really -*- C++ -*-
// $Id$
+
#include "tao/UIOP_Connector.h"
#if TAO_HAS_UIOP == 1
#include "tao/UIOP_Profile.h"
-#include "tao/GIOP.h"
#include "tao/debug.h"
#include "tao/ORB_Core.h"
#include "tao/Environment.h"
@@ -311,9 +311,11 @@ template class ACE_Refcounted_Recyclable_Handler_Caching_Utility<TAO_ADDR, TAO_C
TAO_UIOP_Connect_Creation_Strategy::
TAO_UIOP_Connect_Creation_Strategy (ACE_Thread_Manager* t,
- TAO_ORB_Core* orb_core)
+ TAO_ORB_Core* orb_core,
+ CORBA::Boolean flag)
: ACE_Creation_Strategy<TAO_UIOP_Client_Connection_Handler> (t),
- orb_core_ (orb_core)
+ orb_core_ (orb_core),
+ lite_flag_ (flag)
{
}
@@ -325,7 +327,8 @@ TAO_UIOP_Connect_Creation_Strategy::make_svc_handler
ACE_NEW_RETURN (sh,
TAO_UIOP_Client_Connection_Handler
(this->orb_core_->thr_mgr (),
- this->orb_core_),
+ this->orb_core_,
+ this->lite_flag_),
-1);
return 0;
}
@@ -337,10 +340,11 @@ typedef ACE_Cached_Connect_Strategy<TAO_UIOP_Client_Connection_Handler,
TAO_CACHED_CONNECT_STRATEGY;
#endif /* ! TAO_USES_ROBUST_CONNECTION_MGMT */
-TAO_UIOP_Connector::TAO_UIOP_Connector (void)
+TAO_UIOP_Connector::TAO_UIOP_Connector (CORBA::Boolean flag)
: TAO_Connector (TAO_TAG_UIOP_PROFILE),
base_connector_ (),
- orb_core_ (0)
+ orb_core_ (0),
+ lite_flag_ (flag)
#if defined (TAO_USES_ROBUST_CONNECTION_MGMT)
,
cached_connect_strategy_ (0),
@@ -363,7 +367,8 @@ TAO_UIOP_Connector::open (TAO_ORB_Core *orb_core)
ACE_NEW_RETURN (connect_creation_strategy,
TAO_UIOP_Connect_Creation_Strategy
(this->orb_core_->thr_mgr (),
- this->orb_core_),
+ this->orb_core_,
+ this->lite_flag_),
-1);
auto_ptr<TAO_UIOP_Connect_Creation_Strategy>
@@ -504,6 +509,21 @@ TAO_UIOP_Connector::connect (TAO_Profile *profile,
}
transport = svc_handler->transport ();
+ // Now that we have the client connection handler object we need to
+ // set the right messaging protocol for the connection handler.
+ const TAO_GIOP_Version& version = uiop_profile->version ();
+ int ret_val = transport->messaging_init (version.major,
+ version.minor);
+ if (ret_val == -1)
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ASYS_TEXT ("(%N|%l|%p|%t) init_mesg_protocol () failed \n")));
+ }
+ return -1;
+ }
+
return 0;
}
@@ -666,6 +686,7 @@ TAO_UIOP_Connector::make_profile (const char *endpoint,
CORBA::NO_MEMORY ());
ACE_CHECK;
+
}
int
diff --git a/TAO/tao/UIOP_Connector.h b/TAO/tao/UIOP_Connector.h
index 06f4ff8ddaa..62144589514 100644
--- a/TAO/tao/UIOP_Connector.h
+++ b/TAO/tao/UIOP_Connector.h
@@ -1,6 +1,7 @@
// This may look like C, but it's really -*- C++ -*-
// $Id$
+
// ============================================================================
//
// = LIBRARY
@@ -60,7 +61,8 @@ class TAO_Export TAO_UIOP_Connect_Creation_Strategy : public ACE_Creation_Strate
//
public:
TAO_UIOP_Connect_Creation_Strategy (ACE_Thread_Manager * = 0,
- TAO_ORB_Core* orb_core = 0);
+ TAO_ORB_Core* orb_core = 0,
+ CORBA::Boolean flag = 0);
virtual int make_svc_handler (TAO_UIOP_Client_Connection_Handler *&sh);
// Makes TAO_UIOP_Client_Connection_Handlers
@@ -68,6 +70,9 @@ public:
private:
TAO_ORB_Core* orb_core_;
// The ORB
+
+ CORBA::Boolean lite_flag_;
+ // Are we using lite?
};
// ****************************************************************
@@ -81,7 +86,7 @@ class TAO_Export TAO_UIOP_Connector : public TAO_Connector
//
public:
// = Initialization and termination methods.
- TAO_UIOP_Connector (void);
+ TAO_UIOP_Connector (CORBA::Boolean flag = 0);
// Constructor.
// @@ Do we want to pass in the tag here or should it be statically
// defined?
@@ -192,6 +197,9 @@ private:
TAO_ORB_Core *orb_core_;
// ORB Core.
+ CORBA::Boolean lite_flag_;
+ // Do we need to use a GIOP_Lite for sending messages?
+
#if defined (TAO_USES_ROBUST_CONNECTION_MGMT)
TAO_CACHED_CONNECT_STRATEGY *cached_connect_strategy_;
// Cached connect strategy.
diff --git a/TAO/tao/UIOP_Transport.cpp b/TAO/tao/UIOP_Transport.cpp
index 4b4f3e7396d..8137513472f 100644
--- a/TAO/tao/UIOP_Transport.cpp
+++ b/TAO/tao/UIOP_Transport.cpp
@@ -1,6 +1,7 @@
// This may look like C, but it's really -*- C++ -*-
// $Id$
+
#include "tao/UIOP_Transport.h"
#if TAO_HAS_UIOP == 1
@@ -15,6 +16,12 @@
#include "tao/Stub.h"
#include "tao/ORB_Core.h"
#include "tao/debug.h"
+#include "tao/GIOP_Message_Connectors.h"
+#include "tao/GIOP_Message_Lite.h"
+
+#if !defined (__ACE_INLINE__)
+# include "tao/UIOP_Transport.i"
+#endif /* ! __ACE_INLINE__ */
#if defined (ACE_ENABLE_TIMEPROBES)
@@ -124,14 +131,20 @@ TAO_UIOP_Client_Transport::
TAO_UIOP_Client_Transport (TAO_UIOP_Client_Connection_Handler *handler,
TAO_ORB_Core *orb_core)
: TAO_UIOP_Transport (handler, orb_core),
- client_handler_ (handler)
+ client_handler_ (handler),
+ client_mesg_factory_ (0),
+ orb_core_ (orb_core),
+ lite_flag_ (0),
+ params_ ()
{
}
TAO_UIOP_Client_Transport::~TAO_UIOP_Client_Transport (void)
{
+ delete this->client_mesg_factory_;
}
+
TAO_UIOP_Client_Connection_Handler *
TAO_UIOP_Client_Transport::client_handler (void)
{
@@ -139,55 +152,54 @@ TAO_UIOP_Client_Transport::client_handler (void)
}
void
-TAO_UIOP_Client_Transport::start_request (TAO_ORB_Core *orb_core,
- const TAO_Profile* pfile,
+TAO_UIOP_Client_Transport::start_request (TAO_ORB_Core */*orb_core*/,
+ TAO_Target_Specification & /*spec*/,
TAO_OutputCDR &output,
CORBA::Environment &ACE_TRY_ENV)
ACE_THROW_SPEC ((CORBA::SystemException))
{
TAO_FUNCTION_PP_TIMEPROBE (TAO_UIOP_CLIENT_TRANSPORT_START_REQUEST_START);
- const TAO_UIOP_Profile* profile =
- ACE_dynamic_cast(const TAO_UIOP_Profile*, pfile);
+ /*const TAO_UIOP_Profile* profile =
+ ACE_dynamic_cast(const TAO_UIOP_Profile*, pfile);*/
// @@ This should be implemented in the transport object, which
// would query the profile to obtain the version...
- if (TAO_GIOP::start_message (profile->version (),
- TAO_GIOP::Request,
- output,
- orb_core) == 0)
+ if (this->client_mesg_factory_->write_protocol_header
+ (TAO_PLUGGABLE_MESSAGE_REQUEST,
+ output) == 0)
ACE_THROW (CORBA::MARSHAL ());
}
void
-TAO_UIOP_Client_Transport::start_locate (TAO_ORB_Core *orb_core,
- const TAO_Profile* pfile,
- CORBA::ULong request_id,
+TAO_UIOP_Client_Transport::start_locate (TAO_ORB_Core * /*orb_core*/,
+ TAO_Target_Specification &spec,
+ TAO_Operation_Details &opdetails,
TAO_OutputCDR &output,
CORBA::Environment &ACE_TRY_ENV)
ACE_THROW_SPEC ((CORBA::SystemException))
{
- const TAO_UIOP_Profile* profile =
- ACE_dynamic_cast(const TAO_UIOP_Profile*, pfile);
+ //const TAO_UIOP_Profile* profile =
+ // ACE_dynamic_cast(const TAO_UIOP_Profile*, pfile);
// Obtain object key.
- const TAO_ObjectKey& key = profile->object_key ();
+ //const TAO_ObjectKey& key = profile->object_key ();
// @@ This should be implemented in the transport object, which
// would query the profile to obtain the version...
- if (TAO_GIOP::start_message (profile->version (),
- TAO_GIOP::LocateRequest,
- output,
- orb_core) == 0)
+ if (this->client_mesg_factory_->write_protocol_header
+ (TAO_PLUGGABLE_MESSAGE_LOCATEREQUEST,
+ output) == 0)
ACE_THROW (CORBA::MARSHAL ());
-
- if (TAO_GIOP::write_locate_request_header (request_id,
- key,
- output) == 0)
+ if (this->client_mesg_factory_->write_message_header (opdetails,
+ TAO_PLUGGABLE_MESSAGE_LOCATE_REQUEST_HEADER,
+ spec,
+ output) == 0)
ACE_THROW (CORBA::MARSHAL ());
}
+
int
TAO_UIOP_Client_Transport::send_request (TAO_Stub *stub,
TAO_ORB_Core *orb_core,
@@ -199,12 +211,11 @@ TAO_UIOP_Client_Transport::send_request (TAO_Stub *stub,
two_way) == -1)
return -1;
- if (TAO_GIOP::send_message (this,
- stream,
- orb_core,
- max_wait_time,
- stub,
- two_way) == -1)
+ if (this->client_mesg_factory_->send_message (this,
+ stream,
+ max_wait_time,
+ stub,
+ two_way) == -1)
return -1;
return this->idle_after_send ();
@@ -235,10 +246,10 @@ TAO_UIOP_Client_Transport::handle_client_input (int /* block */,
return -1;
}
- int result = TAO_GIOP::handle_input (this,
- this->orb_core_,
- *message_state,
- max_wait_time);
+ int result = this->client_mesg_factory_->handle_input (this,
+ this->orb_core_,
+ *message_state,
+ max_wait_time);
if (result == -1)
{
if (TAO_debug_level > 0)
@@ -252,16 +263,8 @@ TAO_UIOP_Client_Transport::handle_client_input (int /* block */,
// OK, the complete message is here...
- IOP::ServiceContextList reply_ctx;
- CORBA::ULong request_id;
- CORBA::ULong reply_status;
-
- result = TAO_GIOP::parse_reply (this,
- this->orb_core_,
- *message_state,
- reply_ctx,
- request_id,
- reply_status);
+ result = this->client_mesg_factory_->parse_reply (*message_state,
+ this->params_);
if (result == -1)
{
if (TAO_debug_level > 0)
@@ -273,10 +276,10 @@ TAO_UIOP_Client_Transport::handle_client_input (int /* block */,
}
result =
- this->tms_->dispatch_reply (request_id,
- reply_status,
+ this->tms_->dispatch_reply (this->params_.request_id_,
+ this->params_.reply_status_,
message_state->giop_version,
- reply_ctx,
+ this->params_.svc_ctx_,
message_state);
if (result == -1)
@@ -317,6 +320,75 @@ TAO_UIOP_Client_Transport::register_handler (void)
ACE_Event_Handler::READ_MASK);
}
+
+int
+TAO_UIOP_Client_Transport::
+ messaging_init (CORBA::Octet major,
+ CORBA::Octet minor)
+{
+ if (this->client_mesg_factory_ == 0)
+ {
+ if (this->lite_flag_)
+ {
+ ACE_NEW_RETURN (this->client_mesg_factory_,
+ TAO_GIOP_Message_Lite (this->orb_core_),
+ -1);
+ }
+ else if (major == TAO_DEF_GIOP_MAJOR)
+ {
+ if (minor > TAO_DEF_GIOP_MINOR)
+ minor = TAO_DEF_GIOP_MINOR;
+ switch (minor)
+ {
+ case 0:
+ ACE_NEW_RETURN (this->client_mesg_factory_,
+ TAO_GIOP_Message_Connector_10,
+ 0);
+ break;
+ case 1:
+ ACE_NEW_RETURN (this->client_mesg_factory_,
+ TAO_GIOP_Message_Connector_11,
+ 0);
+ break;
+ default:
+ if (TAO_debug_level > 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ASYS_TEXT ("(%N|%l|%p|%t) No matching minor version number \n")),
+ 0);
+ }
+ }
+ }
+ else
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ASYS_TEXT ("(%N|%l|%p|%t) No matching major version number \n")),
+ 0);
+ }
+ }
+ }
+
+ return 1;
+}
+
+
+CORBA::Boolean
+TAO_UIOP_Client_Transport::send_request_header (TAO_Operation_Details &opdetails,
+ TAO_Target_Specification &spec,
+ TAO_OutputCDR & msg)
+{
+ // We are going to pass on this request to the underlying messaging
+ // layer. It should take care of this request
+ CORBA::Boolean retval =
+ this->client_mesg_factory_->write_message_header (opdetails,
+ TAO_PLUGGABLE_MESSAGE_REQUEST_HEADER,
+ spec,
+ msg);
+ return retval;
+}
+
// ****************************************************************
ssize_t
@@ -387,4 +459,15 @@ TAO_UIOP_Transport::send_request (TAO_Stub *,
return -1;
}
-#endif /* TAO_HAS_UIOP == 1 */
+CORBA::Boolean
+TAO_UIOP_Transport::send_request_header (TAO_Operation_Details & /*opdetails*/,
+ TAO_Target_Specification & /*spec*/,
+ TAO_OutputCDR & /*msg*/)
+{
+ // We should never be here. So return an error.
+ return 0;
+}
+
+#endif /* TAO_HAS_UIOP */
+
+
diff --git a/TAO/tao/UIOP_Transport.h b/TAO/tao/UIOP_Transport.h
index b3b65399cf2..9415f7a541c 100644
--- a/TAO/tao/UIOP_Transport.h
+++ b/TAO/tao/UIOP_Transport.h
@@ -1,6 +1,7 @@
// This may look like C, but it's really -*- C++ -*-
// $Id$
+
// ============================================================================
//
// = LIBRARY
@@ -23,11 +24,15 @@
#include "tao/Pluggable.h"
+
+//#include "tao/Pluggable_Messaging.h"
+#include "tao/GIOP_Utils.h"
+//#include "tao/target_identifier.h"
+
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
-#include "tao/GIOP.h"
# if TAO_HAS_UIOP == 1
@@ -82,10 +87,17 @@ public:
int twoway,
ACE_Time_Value *max_wait_time);
+
+ virtual CORBA::Boolean
+ send_request_header (TAO_Operation_Details &opdetails,
+ TAO_Target_Specification &spec,
+ TAO_OutputCDR &msg);
+
protected:
TAO_UIOP_Handler_Base *handler_;
// the connection service handler used for accessing lower layer
// communication protocols.
+
};
class TAO_Export TAO_UIOP_Client_Transport : public TAO_UIOP_Transport
@@ -114,16 +126,18 @@ public:
// = The TAO_Transport methods, please check the documentation in
// "tao/Pluggable.h" for more details.
virtual void start_request (TAO_ORB_Core *orb_core,
- const TAO_Profile *profile,
+ TAO_Target_Specification &spec,
TAO_OutputCDR &output,
CORBA::Environment &ACE_TRY_ENV = TAO_default_environment ())
ACE_THROW_SPEC ((CORBA::SystemException));
+
virtual void start_locate (TAO_ORB_Core *orb_core,
- const TAO_Profile *profile,
- CORBA::ULong request_id,
+ TAO_Target_Specification &spec,
+ TAO_Operation_Details &opdetails,
TAO_OutputCDR &output,
CORBA::Environment &ACE_TRY_ENV = TAO_default_environment ())
ACE_THROW_SPEC ((CORBA::SystemException));
+
virtual int send_request (TAO_Stub *stub,
TAO_ORB_Core *orb_core,
TAO_OutputCDR &stream,
@@ -135,9 +149,34 @@ public:
// Register the handler with the reactor. This will be called by the
// Wait Strategy if Reactor is used for that strategy.
+ virtual CORBA::Boolean
+ send_request_header (TAO_Operation_Details &opdetail,
+ TAO_Target_Specification &spec,
+ TAO_OutputCDR &msg);
+
+ int messaging_init (CORBA::Octet major,
+ CORBA::Octet minor);
+ // Initialising the messaging object
+
+ void use_lite (CORBA::Boolean flag);
+ // Set the lite flag
+
private:
TAO_UIOP_Client_Connection_Handler *client_handler_;
// pointer to the corresponding client side connection handler.
+
+ TAO_Pluggable_Messaging_Interface *client_mesg_factory_;
+ // The message_factor instance specific for this particular
+ // transport protocol.
+
+ TAO_ORB_Core *orb_core_;
+ // Our orb Core
+
+ CORBA::Boolean lite_flag_;
+ // We using GIOP lite?
+
+ TAO_Pluggable_Connector_Params params_;
+ // The reply data that is sent back by the server
};
// ****************************************************************
@@ -167,8 +206,13 @@ public:
TAO_GIOP_Message_State message_state_;
// This keep the state of the current message, to enable
// non-blocking reads, fragment reassembly, etc.
+
};
+#if defined (__ACE_INLINE__)
+#include "tao/UIOP_Transport.i"
+#endif /* __ACE_INLINE__ */
+
# endif /* TAO_HAS_UIOP == 1 */
#endif /* TAO_UIOP_TRANSPORT_H */
diff --git a/TAO/tao/params.cpp b/TAO/tao/params.cpp
index 6584ac7b317..409b34b65f3 100644
--- a/TAO/tao/params.cpp
+++ b/TAO/tao/params.cpp
@@ -1,13 +1,16 @@
// $Id$
+
#include "tao/params.h"
#if !defined (__ACE_INLINE__)
# include "tao/params.i"
#endif /* __ACE_INLINE__ */
+
ACE_RCSID(tao, params, "$Id$")
+
TAO_ORB_Parameters::TAO_ORB_Parameters (void)
: preconnects_list_ (),
endpoints_list_ (),
diff --git a/TAO/tao/params.h b/TAO/tao/params.h
index aa1821ae967..71640090646 100644
--- a/TAO/tao/params.h
+++ b/TAO/tao/params.h
@@ -1,6 +1,7 @@
/* -*- C++ -*- */
// $Id$
+
// ============================================================================
//
// = LIBRARY
@@ -108,8 +109,9 @@ public:
// octet sequence is small enough and there is room in the current
// message block it is more efficient just to copy the buffer.
- int use_lite_protocol (void) const;
- void use_lite_protocol (int);
+ // @@Deprecated. Will not be used. - Bala
+ // int use_lite_protocol (void) const;
+ // void use_lite_protocol (int);
// The ORB will use a modified version of GIOP that minimizes the
// header size. By default we use the standard GIOP protocol.
diff --git a/TAO/tao/params.i b/TAO/tao/params.i
index 539949e29c6..5ba9334e3ae 100644
--- a/TAO/tao/params.i
+++ b/TAO/tao/params.i
@@ -77,6 +77,8 @@ TAO_ORB_Parameters::cdr_memcpy_tradeoff (int x)
this->cdr_memcpy_tradeoff_ = x;
}
+#if 0
+// Supprt has been deprecated.
ACE_INLINE int
TAO_ORB_Parameters::use_lite_protocol (void) const
{
@@ -88,6 +90,7 @@ TAO_ORB_Parameters::use_lite_protocol (int x)
{
this->use_lite_protocol_ = x;
}
+#endif /*if 0*/
ACE_INLINE int
TAO_ORB_Parameters::use_dotted_decimal_addresses (void) const