diff options
author | bala <balanatarajan@users.noreply.github.com> | 2000-02-29 20:40:36 +0000 |
---|---|---|
committer | bala <balanatarajan@users.noreply.github.com> | 2000-02-29 20:40:36 +0000 |
commit | ae9d3630b47d4b5c1325590453eb7bcf6812cd2e (patch) | |
tree | d98823cbc73551991c70a837648b3ad13af438c0 | |
parent | d8d5a5cedc29745542c27b13f2cd7bc50a5b3827 (diff) | |
download | ATCD-ae9d3630b47d4b5c1325590453eb7bcf6812cd2e.tar.gz |
*** empty log message ***
-rw-r--r-- | TAO/tao/IIOP_Connect.cpp | 68 | ||||
-rw-r--r-- | TAO/tao/IIOP_Connect.h | 14 | ||||
-rw-r--r-- | TAO/tao/IIOP_Connector.cpp | 32 | ||||
-rw-r--r-- | TAO/tao/IIOP_Connector.h | 6 | ||||
-rw-r--r-- | TAO/tao/IIOP_Transport.cpp | 69 | ||||
-rw-r--r-- | TAO/tao/IIOP_Transport.h | 28 | ||||
-rw-r--r-- | TAO/tao/IIOP_Transport.i | 8 | ||||
-rw-r--r-- | TAO/tao/Pluggable.cpp | 7 | ||||
-rw-r--r-- | TAO/tao/Pluggable.h | 10 | ||||
-rw-r--r-- | TAO/tao/SHMIOP_Connect.cpp | 68 | ||||
-rw-r--r-- | TAO/tao/SHMIOP_Connect.h | 9 | ||||
-rw-r--r-- | TAO/tao/SHMIOP_Connector.cpp | 30 | ||||
-rw-r--r-- | TAO/tao/SHMIOP_Connector.h | 6 | ||||
-rw-r--r-- | TAO/tao/SHMIOP_Transport.cpp | 64 | ||||
-rw-r--r-- | TAO/tao/SHMIOP_Transport.h | 20 | ||||
-rw-r--r-- | TAO/tao/SHMIOP_Transport.i | 8 | ||||
-rw-r--r-- | TAO/tao/UIOP_Connect.cpp | 67 | ||||
-rw-r--r-- | TAO/tao/UIOP_Connect.h | 9 | ||||
-rw-r--r-- | TAO/tao/UIOP_Connector.cpp | 31 | ||||
-rw-r--r-- | TAO/tao/UIOP_Connector.h | 6 | ||||
-rw-r--r-- | TAO/tao/UIOP_Transport.cpp | 73 | ||||
-rw-r--r-- | TAO/tao/UIOP_Transport.h | 20 | ||||
-rw-r--r-- | TAO/tao/UIOP_Transport.i | 8 | ||||
-rw-r--r-- | TAO/tao/orbconf.h | 9 |
24 files changed, 333 insertions, 337 deletions
diff --git a/TAO/tao/IIOP_Connect.cpp b/TAO/tao/IIOP_Connect.cpp index eb04d9a7fa6..24b38011040 100644 --- a/TAO/tao/IIOP_Connect.cpp +++ b/TAO/tao/IIOP_Connect.cpp @@ -11,7 +11,6 @@ #include "tao/Messaging_Policy_i.h" #include "tao/GIOP_Message_Lite.h" #include "tao/GIOP_Message_Acceptors.h" -#include "tao/GIOP_Message_Connectors.h" #if !defined (__ACE_INLINE__) @@ -107,12 +106,6 @@ TAO_IIOP_Server_Connection_Handler::TAO_IIOP_Server_Connection_Handler (TAO_ORB_ TAO_GIOP_Message_Acceptors (orb_core)); } - // OK, Here is a small twist. By now the all the objecs cached in - // this class would have been constructed. But we would like to make - // the one of the objects, precisely the transport object a pointer - // to the Messaging object. So, we set this up properly by calling - // the messaging_init method on the transport. - this->transport_.messaging_init (this->acceptor_factory_); } TAO_IIOP_Server_Connection_Handler::~TAO_IIOP_Server_Connection_Handler (void) @@ -355,18 +348,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), - mesg_factory_ (0) + lite_flag_ (flag) { - //no-op + // Set the lite flag in the client transport + this->transport_.use_lite (flag); } TAO_IIOP_Client_Connection_Handler::~TAO_IIOP_Client_Connection_Handler (void) { - delete this->mesg_factory_; + //no-op } @@ -556,58 +551,7 @@ TAO_IIOP_Client_Connection_Handler::handle_cleanup (void) return 0; } -int -TAO_IIOP_Client_Connection_Handler:: - init_mesg_protocol (CORBA::Octet major, - CORBA::Octet minor) -{ - if (major == TAO_DEF_GIOP_LITE_MAJOR && - minor == TAO_DEF_GIOP_LITE_MINOR) - { - ACE_NEW_RETURN (this->mesg_factory_, - TAO_GIOP_Message_Lite, - -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->mesg_factory_, - TAO_GIOP_Message_Connector_10, - 0); - break; - case 1: - ACE_NEW_RETURN (this->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); - } - } - - // Make the transport know - this->transport_.messaging_init (this->mesg_factory_); - return 1; -} // **************************************************************** diff --git a/TAO/tao/IIOP_Connect.h b/TAO/tao/IIOP_Connect.h index 00c85cc3f0e..dee430ffb10 100644 --- a/TAO/tao/IIOP_Connect.h +++ b/TAO/tao/IIOP_Connect.h @@ -54,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 @@ -65,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); @@ -96,10 +96,6 @@ public: virtual TAO_Transport *transport (void); // Return the transport objects - virtual int init_mesg_protocol (CORBA::Octet major, - CORBA::Octet minor); - // Assigns the right messaging protocol object based on the version - protected: int handle_cleanup (void); // This method deregisters the handler from the reactor and closes it. @@ -109,9 +105,9 @@ 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 GIOP lite? }; // **************************************************************** diff --git a/TAO/tao/IIOP_Connector.cpp b/TAO/tao/IIOP_Connector.cpp index 812997da88e..765981fb3f2 100644 --- a/TAO/tao/IIOP_Connector.cpp +++ b/TAO/tao/IIOP_Connector.cpp @@ -310,9 +310,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) { } @@ -324,7 +326,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; } @@ -366,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> @@ -508,21 +512,11 @@ TAO_IIOP_Connector::connect (TAO_Profile *profile, transport = svc_handler->transport (); - int ret_val = 0; - if (lite_flag_) - { - ret_val = svc_handler->init_mesg_protocol (TAO_DEF_GIOP_LITE_MAJOR, - TAO_DEF_GIOP_LITE_MINOR); - } - else - { - // 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 = iiop_profile->version (); - ret_val = svc_handler->init_mesg_protocol (version.major, - version.minor); - - } + // 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) diff --git a/TAO/tao/IIOP_Connector.h b/TAO/tao/IIOP_Connector.h index d7daf444cb9..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? }; // **************************************************************** diff --git a/TAO/tao/IIOP_Transport.cpp b/TAO/tao/IIOP_Transport.cpp index 7aeba526bf5..5212e753f46 100644 --- a/TAO/tao/IIOP_Transport.cpp +++ b/TAO/tao/IIOP_Transport.cpp @@ -14,10 +14,14 @@ #include "tao/Stub.h" #include "tao/ORB_Core.h" #include "tao/debug.h" -//#include "tao/target_identifier.h" -#include "tao/Pluggable_Messaging.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[] = @@ -120,13 +124,6 @@ TAO_IIOP_Server_Transport::~TAO_IIOP_Server_Transport (void) { } -void -TAO_IIOP_Server_Transport::messaging_init (TAO_Pluggable_Messaging_Interface *mesg) -{ - this->server_mesg_factory_ = mesg; -} - - // **************************************************************** TAO_IIOP_Client_Transport:: @@ -134,7 +131,8 @@ 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) { } @@ -320,10 +318,55 @@ TAO_IIOP_Client_Transport::register_handler (void) ACE_Event_Handler::READ_MASK); } -void -TAO_IIOP_Client_Transport::messaging_init (TAO_Pluggable_Messaging_Interface *mesg) +int +TAO_IIOP_Client_Transport::messaging_init (CORBA::Octet major, + CORBA::Octet minor) { - this->client_mesg_factory_ = mesg; + if (this->client_mesg_factory_ == 0) + { + if (this->lite_flag_) + { + ACE_NEW_RETURN (this->client_mesg_factory_, + TAO_GIOP_Message_Lite, + -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 diff --git a/TAO/tao/IIOP_Transport.h b/TAO/tao/IIOP_Transport.h index 99a3a301cca..1290157421f 100644 --- a/TAO/tao/IIOP_Transport.h +++ b/TAO/tao/IIOP_Transport.h @@ -88,7 +88,6 @@ public: 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 @@ -148,17 +147,22 @@ public: TAO_Target_Specification &spec, TAO_OutputCDR &msg); - void messaging_init (TAO_Pluggable_Messaging_Interface *mesg); + 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_; + + TAO_Pluggable_Messaging_Interface *client_mesg_factory_; // The message_factor instance specific for this particular // transport protocol. - + + CORBA::Boolean lite_flag_; + // Are we using lite? }; // **************************************************************** @@ -189,14 +193,10 @@ public: // This keep the state of the current message, to enable // non-blocking reads, fragment reassembly, etc. // @@Bala. Should not be here like this - - void messaging_init (TAO_Pluggable_Messaging_Interface *mesg); - // Initialising the messaging object - - private: - - TAO_Pluggable_Messaging_Interface *server_mesg_factory_; - // This would be server side messaging protocol }; +#if defined (__ACE_INLINE__) +#include "tao/IIOP_Transport.i" +#endif /* __ACE_INLINE__ */ + #endif /* TAO_IIOP_TRANSPORT_H */ diff --git a/TAO/tao/IIOP_Transport.i b/TAO/tao/IIOP_Transport.i new file mode 100644 index 00000000000..42e6a885dc0 --- /dev/null +++ b/TAO/tao/IIOP_Transport.i @@ -0,0 +1,8 @@ +// -*- C++ -*- +//$Id$ + +ACE_INLINE void +TAO_IIOP_Client_Transport::use_lite (CORBA::Boolean flag) +{ + this->lite_flag_ = flag; +} diff --git a/TAO/tao/Pluggable.cpp b/TAO/tao/Pluggable.cpp index 29f1c5890a1..46f0c5959a4 100644 --- a/TAO/tao/Pluggable.cpp +++ b/TAO/tao/Pluggable.cpp @@ -176,6 +176,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. diff --git a/TAO/tao/Pluggable.h b/TAO/tao/Pluggable.h index f8e0e6bca04..37afa051970 100644 --- a/TAO/tao/Pluggable.h +++ b/TAO/tao/Pluggable.h @@ -205,6 +205,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); @@ -221,9 +228,6 @@ protected: size_t bytes_delivered, int queued_message); - virtual void messaging_init (TAO_Pluggable_Messaging_Interface *mesg) = 0; - // Initialising the messaging object - CORBA::ULong tag_; // IOP protocol tag. diff --git a/TAO/tao/SHMIOP_Connect.cpp b/TAO/tao/SHMIOP_Connect.cpp index 05ea5472dd9..0aa4bccffe8 100644 --- a/TAO/tao/SHMIOP_Connect.cpp +++ b/TAO/tao/SHMIOP_Connect.cpp @@ -9,7 +9,6 @@ #include "tao/ORB_Core.h" #include "tao/ORB.h" #include "tao/CDR.h" -#include "tao/GIOP_Message_Connectors.h" #include "tao/GIOP_Message_Acceptors.h" #include "tao/GIOP_Message_Lite.h" @@ -104,13 +103,6 @@ TAO_SHMIOP_Server_Connection_Handler::TAO_SHMIOP_Server_Connection_Handler (TAO_ ACE_NEW (this->acceptor_factory_, TAO_GIOP_Message_Acceptors (orb_core)); } - - // OK, Here is a small twist. By now the all the objecs cached in - // this class would have been constructed. But we would like to make - // the one of the objects, precisely the transport object a pointer - // to the Messaging object. So, we set this up properly by calling - // the messaging_init method on the transport. - this->transport_.messaging_init (this->acceptor_factory_); } TAO_SHMIOP_Server_Connection_Handler::~TAO_SHMIOP_Server_Connection_Handler (void) @@ -355,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) @@ -526,59 +521,6 @@ TAO_SHMIOP_Client_Connection_Handler::handle_cleanup (void) return 0; } -int -TAO_SHMIOP_Client_Connection_Handler:: - init_mesg_protocol (CORBA::Octet major, - CORBA::Octet minor) -{ - if (major == TAO_DEF_GIOP_LITE_MAJOR && - minor == TAO_DEF_GIOP_LITE_MINOR) - { - ACE_NEW_RETURN (this->mesg_factory_, - TAO_GIOP_Message_Lite, - -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->mesg_factory_, - TAO_GIOP_Message_Connector_10, - 0); - break; - case 1: - ACE_NEW_RETURN (this->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); - } - } - - // Make the transport know - this->transport_.messaging_init (this->mesg_factory_); - - return 1; -} - // **************************************************************** #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) diff --git a/TAO/tao/SHMIOP_Connect.h b/TAO/tao/SHMIOP_Connect.h index e6d1186dae4..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); @@ -94,9 +95,6 @@ public: virtual TAO_Transport *transport (void); // Return the transport objects - virtual int init_mesg_protocol (CORBA::Octet major, - CORBA::Octet minor); - // Assigns the right messaging protocol object based on the version protected: int handle_cleanup (void); // This method deregisters the handler from the reactor and closes it. @@ -109,6 +107,9 @@ protected: TAO_Pluggable_Messaging_Interface *mesg_factory_; // The Connector messaging factory + + CORBA::Boolean lite_flag_; + // Are we using lite? }; // **************************************************************** diff --git a/TAO/tao/SHMIOP_Connector.cpp b/TAO/tao/SHMIOP_Connector.cpp index 86e11993d32..36501849f49 100644 --- a/TAO/tao/SHMIOP_Connector.cpp +++ b/TAO/tao/SHMIOP_Connector.cpp @@ -294,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) { } @@ -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> @@ -492,21 +495,11 @@ TAO_SHMIOP_Connector::connect (TAO_Profile *profile, transport = svc_handler->transport (); - int ret_val = 0; - if (this->lite_flag_) - { - ret_val = svc_handler->init_mesg_protocol (TAO_DEF_GIOP_LITE_MAJOR, - TAO_DEF_GIOP_LITE_MINOR); - } - else - { - // 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 (); - ret_val = svc_handler->init_mesg_protocol (version.major, - version.minor); - - } + // 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) @@ -516,6 +509,7 @@ TAO_SHMIOP_Connector::connect (TAO_Profile *profile, } return -1; } + return 0; } diff --git a/TAO/tao/SHMIOP_Connector.h b/TAO/tao/SHMIOP_Connector.h index caaf06cdb13..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? }; // **************************************************************** diff --git a/TAO/tao/SHMIOP_Transport.cpp b/TAO/tao/SHMIOP_Transport.cpp index 93e52d6474a..956f3103252 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[] = @@ -112,12 +119,6 @@ TAO_SHMIOP_Server_Transport::~TAO_SHMIOP_Server_Transport (void) { } -void -TAO_SHMIOP_Server_Transport::messaging_init (TAO_Pluggable_Messaging_Interface *mesg) -{ - this->server_mesg_factory_ = mesg; -} - // **************************************************************** TAO_SHMIOP_Client_Transport:: @@ -307,10 +308,55 @@ TAO_SHMIOP_Client_Transport::register_handler (void) ACE_Event_Handler::READ_MASK); } -void -TAO_SHMIOP_Client_Transport::messaging_init (TAO_Pluggable_Messaging_Interface *mesg) +int +TAO_SHMIOP_Client_Transport::messaging_init (CORBA::Octet major, + CORBA::Octet minor) { - this->client_mesg_factory_ = mesg; + if (this->client_mesg_factory_ == 0) + { + if (this->lite_flag_) + { + ACE_NEW_RETURN (this->client_mesg_factory_, + TAO_GIOP_Message_Lite, + -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 diff --git a/TAO/tao/SHMIOP_Transport.h b/TAO/tao/SHMIOP_Transport.h index 29ceaf57f7e..5ea7d987c9c 100644 --- a/TAO/tao/SHMIOP_Transport.h +++ b/TAO/tao/SHMIOP_Transport.h @@ -143,8 +143,13 @@ public: TAO_Target_Specification &spec, TAO_OutputCDR &msg); - void messaging_init (TAO_Pluggable_Messaging_Interface *mesg); + 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. @@ -152,6 +157,9 @@ private: TAO_Pluggable_Messaging_Interface *client_mesg_factory_; // The message_factor instance specific for this particular // transport protocol. + + CORBA::Boolean lite_flag_; + // Are we using lite? }; // **************************************************************** @@ -175,20 +183,18 @@ public: ~TAO_SHMIOP_Server_Transport (void); // Default destructor - void messaging_init (TAO_Pluggable_Messaging_Interface *mesg); - // Initialising the messaging object - TAO_SHMIOP_Server_Connection_Handler *server_handler_; // Pointer to the corresponding connection handler. TAO_GIOP_Message_State message_state_; // This keep the state of the current message, to enable // non-blocking reads, fragment reassembly, etc. -private: - TAO_Pluggable_Messaging_Interface *server_mesg_factory_; - // This would be server side messaging protocol }; +#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/SHMIOP_Transport.i b/TAO/tao/SHMIOP_Transport.i new file mode 100644 index 00000000000..7d806dec8ce --- /dev/null +++ b/TAO/tao/SHMIOP_Transport.i @@ -0,0 +1,8 @@ +// -*- C++ -*- +//$Id$ + +ACE_INLINE void +TAO_SHMIOP_Client_Transport::use_lite (CORBA::Boolean flag) +{ + this->lite_flag_ = flag; +} diff --git a/TAO/tao/UIOP_Connect.cpp b/TAO/tao/UIOP_Connect.cpp index 36735280a5e..a7c2161b294 100644 --- a/TAO/tao/UIOP_Connect.cpp +++ b/TAO/tao/UIOP_Connect.cpp @@ -19,9 +19,8 @@ # include "tao/UIOP_Connect.i" #endif /* ! __ACE_INLINE__ */ -#include "tao/GIOP_Message_Lite.h" #include "tao/GIOP_Message_Acceptors.h" -#include "tao/GIOP_Message_Connectors.h" +#include "tao/GIOP_Message_Lite.h" ACE_RCSID(tao, UIOP_Connect, "$Id$") @@ -111,12 +110,6 @@ TAO_UIOP_Server_Connection_Handler::TAO_UIOP_Server_Connection_Handler (TAO_ORB_ ACE_NEW (this->acceptor_factory_, TAO_GIOP_Message_Acceptors (orb_core)); } - // OK, Here is a small twist. By now the all the objects cached in - // this class would have been constructed. But we would like to make - // the one of the objects, precisely the transport object a pointer - // to the Messaging object. So, we set this up properly by calling - // the messaging_init method on the transport. - this->transport_.messaging_init (this->acceptor_factory_); } TAO_UIOP_Server_Connection_Handler::~TAO_UIOP_Server_Connection_Handler (void) @@ -342,13 +335,14 @@ 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), - mesg_factory_ (0) + lite_flag_ (flag) { - //no-op + this->transport_.use_lite (flag); } TAO_UIOP_Client_Connection_Handler::~TAO_UIOP_Client_Connection_Handler (void) @@ -528,58 +522,7 @@ TAO_UIOP_Client_Connection_Handler::handle_cleanup (void) return 0; } -int -TAO_UIOP_Client_Connection_Handler:: - init_mesg_protocol (CORBA::Octet major, - CORBA::Octet minor) -{ - if (major == TAO_DEF_GIOP_LITE_MAJOR && - minor == TAO_DEF_GIOP_LITE_MINOR) - { - ACE_NEW_RETURN (this->mesg_factory_, - TAO_GIOP_Message_Lite, - -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->mesg_factory_, - TAO_GIOP_Message_Connector_10, - 0); - break; - case 1: - ACE_NEW_RETURN (this->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); - } - } - // Make the transport know - this->transport_.messaging_init (this->mesg_factory_); - - return 1; -} // **************************************************************** #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) diff --git a/TAO/tao/UIOP_Connect.h b/TAO/tao/UIOP_Connect.h index ca93293230e..986ac8e28ab 100644 --- a/TAO/tao/UIOP_Connect.h +++ b/TAO/tao/UIOP_Connect.h @@ -63,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); @@ -93,9 +94,6 @@ public: virtual TAO_Transport *transport (void); - virtual int init_mesg_protocol (CORBA::Octet major, - CORBA::Octet minor); - // Assigns the right messaging protocol object based on the version protected: int handle_cleanup (void); // This method deregisters the handler from the reactor and closes it. @@ -108,6 +106,9 @@ protected: TAO_Pluggable_Messaging_Interface *mesg_factory_; // The Connector messaging factory + + CORBA::Boolean lite_flag_; + // Are we usinglite? }; // **************************************************************** diff --git a/TAO/tao/UIOP_Connector.cpp b/TAO/tao/UIOP_Connector.cpp index f2b2fdef6c6..8dcb4353926 100644 --- a/TAO/tao/UIOP_Connector.cpp +++ b/TAO/tao/UIOP_Connector.cpp @@ -313,9 +313,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) { } @@ -327,7 +329,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; } @@ -366,7 +369,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> @@ -507,20 +511,11 @@ TAO_UIOP_Connector::connect (TAO_Profile *profile, } transport = svc_handler->transport (); - int ret_val = 0; - if (lite_flag_) - { - ret_val = svc_handler->init_mesg_protocol (TAO_DEF_GIOP_LITE_MAJOR, - TAO_DEF_GIOP_LITE_MINOR); - } - else - { - // 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 (); - ret_val = uiop_profile->hint ()->init_mesg_protocol (version.major, - version.minor); - } + // 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) diff --git a/TAO/tao/UIOP_Connector.h b/TAO/tao/UIOP_Connector.h index e4d8afc7b72..62144589514 100644 --- a/TAO/tao/UIOP_Connector.h +++ b/TAO/tao/UIOP_Connector.h @@ -61,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 @@ -69,6 +70,9 @@ public: private: TAO_ORB_Core* orb_core_; // The ORB + + CORBA::Boolean lite_flag_; + // Are we using lite? }; // **************************************************************** diff --git a/TAO/tao/UIOP_Transport.cpp b/TAO/tao/UIOP_Transport.cpp index 8b3ffdb0555..d0b0219020e 100644 --- a/TAO/tao/UIOP_Transport.cpp +++ b/TAO/tao/UIOP_Transport.cpp @@ -18,8 +18,13 @@ #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__ */ -#include "tao/Pluggable_Messaging.h" #if defined (ACE_ENABLE_TIMEPROBES) static const char *TAO_UIOP_Transport_Timeprobe_Description[] = @@ -122,26 +127,23 @@ TAO_UIOP_Server_Transport::~TAO_UIOP_Server_Transport (void) { } -void -TAO_UIOP_Server_Transport::messaging_init (TAO_Pluggable_Messaging_Interface *mesg) -{ - this->server_mesg_factory_ = mesg; -} - // **************************************************************** 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) { } 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) { @@ -322,11 +324,58 @@ TAO_UIOP_Client_Transport::register_handler (void) } -void -TAO_UIOP_Client_Transport::messaging_init (TAO_Pluggable_Messaging_Interface *mesg) -{ - this->client_mesg_factory_ = mesg; +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, + -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, diff --git a/TAO/tao/UIOP_Transport.h b/TAO/tao/UIOP_Transport.h index f15710ed7be..f61c75f5035 100644 --- a/TAO/tao/UIOP_Transport.h +++ b/TAO/tao/UIOP_Transport.h @@ -155,9 +155,13 @@ public: TAO_Target_Specification &spec, TAO_OutputCDR &msg); - void messaging_init (TAO_Pluggable_Messaging_Interface *mesg); + 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. @@ -165,6 +169,9 @@ private: TAO_Pluggable_Messaging_Interface *client_mesg_factory_; // The message_factor instance specific for this particular // transport protocol. + + CORBA::Boolean lite_flag_; + // We using GIOP lite? }; // **************************************************************** @@ -195,15 +202,12 @@ public: // This keep the state of the current message, to enable // non-blocking reads, fragment reassembly, etc. - void messaging_init (TAO_Pluggable_Messaging_Interface *mesg); - // Initialising the messaging object - - private: - - TAO_Pluggable_Messaging_Interface *server_mesg_factory_; - // This would be server side messaging protocol }; +#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/UIOP_Transport.i b/TAO/tao/UIOP_Transport.i new file mode 100644 index 00000000000..4557ef511c6 --- /dev/null +++ b/TAO/tao/UIOP_Transport.i @@ -0,0 +1,8 @@ +// -*- C++ -*- +//$Id$ + +ACE_INLINE void +TAO_UIOP_Client_Transport::use_lite (CORBA::Boolean flag) +{ + this->lite_flag_ = flag; +} diff --git a/TAO/tao/orbconf.h b/TAO/tao/orbconf.h index 14b475e8505..91348ff80ac 100644 --- a/TAO/tao/orbconf.h +++ b/TAO/tao/orbconf.h @@ -584,15 +584,6 @@ and should not be set by the user. Please use TAO_HAS_REMOTE_POLICIES instead. #define TAO_DEF_GIOP_MINOR 1 #endif /* TAO_DEF_GIOP_MINOR */ -// This is just a #define for the GIOP Lite -#if !defined (TAO_DEF_GIOP_LITE_MAJOR) -#define TAO_DEF_GIOP_LITE_MAJOR 100 -#endif /* TAO_DEF_GIOP_LITE_MAJOR */ -#if !defined (TAO_DEF_GIOP_LITE_MINOR) -#define TAO_DEF_GIOP_LITE_MINOR 100 -#endif /* TAO_DEF_GIOP_LITE_MINOR */ - - // By default TAO generate the OMG standard profile components // (ORB_TYPE and CODE_SETS) #define TAO_STD_PROFILE_COMPONENTS |