diff options
author | bala <balanatarajan@users.noreply.github.com> | 2000-12-15 12:54:58 +0000 |
---|---|---|
committer | bala <balanatarajan@users.noreply.github.com> | 2000-12-15 12:54:58 +0000 |
commit | 537ca0dfa014c638107ccae632c67169a83a12a2 (patch) | |
tree | 074babad72338bc60b54393c55734051fd3e56b2 | |
parent | 3d6380440c2cc2b0aac0e1796f23f51ab9d9cc33 (diff) | |
download | ATCD-537ca0dfa014c638107ccae632c67169a83a12a2.tar.gz |
*** empty log message ***
-rw-r--r-- | TAO/tao/Connection_Descriptor_Interface.h | 6 | ||||
-rw-r--r-- | TAO/tao/Connection_Descriptor_Interface.inl | 9 | ||||
-rw-r--r-- | TAO/tao/GIOP_Message_Generator_Parser_12.cpp | 47 | ||||
-rw-r--r-- | TAO/tao/GIOP_Message_Generator_Parser_12.h | 17 | ||||
-rw-r--r-- | TAO/tao/IIOP_Connection_Handler.cpp | 34 | ||||
-rw-r--r-- | TAO/tao/IIOP_Connection_Handler.h | 3 | ||||
-rw-r--r-- | TAO/tao/IIOP_Connector.cpp | 7 | ||||
-rw-r--r-- | TAO/tao/IIOP_Transport.cpp | 21 | ||||
-rw-r--r-- | TAO/tao/IIOP_Transport.h | 2 | ||||
-rw-r--r-- | TAO/tao/Pluggable.cpp | 6 | ||||
-rw-r--r-- | TAO/tao/Pluggable.h | 2 | ||||
-rw-r--r-- | TAO/tao/PortableServer/Object_Adapter.cpp | 1 | ||||
-rw-r--r-- | TAO/tao/Service_Context.h | 4 | ||||
-rw-r--r-- | TAO/tao/Service_Context.inl | 16 | ||||
-rw-r--r-- | TAO/tao/TAO_Server_Request.cpp | 6 | ||||
-rw-r--r-- | TAO/tao/TAO_Server_Request.h | 13 | ||||
-rw-r--r-- | TAO/tao/TAO_Server_Request.i | 16 |
17 files changed, 200 insertions, 10 deletions
diff --git a/TAO/tao/Connection_Descriptor_Interface.h b/TAO/tao/Connection_Descriptor_Interface.h index 8dc4cfdda3b..4abc3c5cb61 100644 --- a/TAO/tao/Connection_Descriptor_Interface.h +++ b/TAO/tao/Connection_Descriptor_Interface.h @@ -68,6 +68,9 @@ public: /// Return the underlying endpoint object TAO_Endpoint *endpoint (void); + /// Set the BiDir flag + void set_bidir_flag (CORBA::Boolean flag); + protected: /// Default Constructor @@ -80,6 +83,9 @@ protected: /// The base property of the connection ie. the peer's endpoint TAO_Endpoint *endpoint_; + /// Should the endpoint be used in either direction? + CORBA::Boolean bidir_flag_; + /// Is the endpoint allocated on the heap? If so, we will have to /// delete it when we destruct ourselves. CORBA::Boolean endpoint_from_heap_; diff --git a/TAO/tao/Connection_Descriptor_Interface.inl b/TAO/tao/Connection_Descriptor_Interface.inl index dd154f6cdc3..8b2b7a5ca1e 100644 --- a/TAO/tao/Connection_Descriptor_Interface.inl +++ b/TAO/tao/Connection_Descriptor_Interface.inl @@ -5,6 +5,7 @@ TAO_Connection_Descriptor_Interface:: TAO_Connection_Descriptor_Interface (TAO_Endpoint *endpoint, CORBA::Boolean flag) : endpoint_ (endpoint), + bidir_flag_ (0), endpoint_from_heap_ (flag) { } @@ -13,6 +14,7 @@ ACE_INLINE TAO_Connection_Descriptor_Interface:: TAO_Connection_Descriptor_Interface (void) : endpoint_ (0), + bidir_flag_ (0), endpoint_from_heap_ (0) { } @@ -23,3 +25,10 @@ TAO_Connection_Descriptor_Interface::endpoint (void) { return this->endpoint_; } + + +ACE_INLINE void +TAO_Connection_Descriptor_Interface::set_bidir_flag (CORBA::Boolean flag) +{ + this->bidir_flag_ = flag; +} diff --git a/TAO/tao/GIOP_Message_Generator_Parser_12.cpp b/TAO/tao/GIOP_Message_Generator_Parser_12.cpp index f3f4f0d86a5..ad83299eb75 100644 --- a/TAO/tao/GIOP_Message_Generator_Parser_12.cpp +++ b/TAO/tao/GIOP_Message_Generator_Parser_12.cpp @@ -12,7 +12,8 @@ #include "tao/Pluggable_Messaging_Utils.h" #include "tao/TAO_Server_Request.h" #include "tao/TAOC.h" - +#include "tao/Service_Context.h" +#include "tao/Pluggable.h" #if !defined (__ACE_INLINE__) # include "tao/GIOP_Message_Generator_Parser_12.inl" @@ -348,6 +349,7 @@ TAO_GIOP_Message_Generator_Parser_12::parse_request_header ( input >> service_info; + if (input.length () > 0) { // Reset the read_ptr to an 8-byte boundary. @@ -572,3 +574,46 @@ TAO_GIOP_Message_Generator_Parser_12::marshall_target_spec ( return 1; } + + +int +TAO_GIOP_Message_Generator_Parser_12::check_bidirectional_context ( + TAO_ServerRequest &request) +{ + // Check whether we have the BiDir service context info available in + // the ServiceContextList + if (request.service_context ().is_service_id (IOP::BI_DIR_IIOP) + == 1) + { + return this->process_bidir_context (request.service_context (), + request.transport ()); + } + + return 0; +} + +int +TAO_GIOP_Message_Generator_Parser_12::process_bidir_context ( + TAO_Service_Context &service_context, + TAO_Transport *transport) +{ + // Get the context info + IOP::ServiceContext context; + context.context_id = IOP::BI_DIR_IIOP; + + if (service_context.get_context (context) != 1) + ACE_ERROR_RETURN ((LM_ERROR, + ACE_TEXT ("(%P|%t) Context info not found \n")), + -1); + + + TAO_InputCDR cdr (ACE_reinterpret_cast + (const char*, + context.context_data.get_buffer ()), + context.context_data.length ()); + + + + return transport->tear_listen_point_list (cdr); + +} diff --git a/TAO/tao/GIOP_Message_Generator_Parser_12.h b/TAO/tao/GIOP_Message_Generator_Parser_12.h index 61ece2b2935..0710c2e0e63 100644 --- a/TAO/tao/GIOP_Message_Generator_Parser_12.h +++ b/TAO/tao/GIOP_Message_Generator_Parser_12.h @@ -28,6 +28,8 @@ #endif /* _MSC_VER */ class TAO_GIOP_Message_State; +class TAO_Service_Context; +class TAO_Transport; /** * @class TAO_GIOP_Message_Generator_Parser_12 @@ -96,10 +98,21 @@ private: /// Marshall the TargetSpecification - // This method may be required for other GIOP versiona coming out - // later than 1.2. We need to share this method + /// This method may be required for other GIOP versiona coming out + /// later than 1.2. We need to share this method int marshall_target_spec (TAO_Target_Specification &spec, TAO_OutputCDR &msg); + + /// Check whether we have BiDirContext info available. If available + /// delegate the responsibility on to the TAO_Transport classes to + /// initiate action. + /// Note: At somepoint this may be needed for future versions of + /// GIOP and we may have to share this + int check_bidirectional_context (TAO_ServerRequest &); + + /// Process the BiDirContext info that we have received. + int process_bidir_context (TAO_Service_Context &, + TAO_Transport *transport); }; diff --git a/TAO/tao/IIOP_Connection_Handler.cpp b/TAO/tao/IIOP_Connection_Handler.cpp index b265fd3ca07..5186e705a1a 100644 --- a/TAO/tao/IIOP_Connection_Handler.cpp +++ b/TAO/tao/IIOP_Connection_Handler.cpp @@ -259,6 +259,40 @@ TAO_IIOP_Connection_Handler::add_handler_to_cache (void) int +TAO_IIOP_Connection_Handler::process_listen_point_list ( + IIOP::ListenPointList &listen_list) +{ + // Get the size of the list + CORBA::ULong len = listen_list.length (); + + for (CORBA::ULong i = 0; i <= len; ++ i) + { + IIOP::ListenPoint listen_point = listen_list[i]; + ACE_INET_Addr addr (listen_point.port, + listen_point.host.in ()); + + // Construct an IIOP_Endpoint object + TAO_IIOP_Endpoint endpoint (addr, + 0); + + // Construct a property object + TAO_Base_Connection_Property prop (&endpoint); + + // Mark the connection as bidirectional + prop.set_bidir_flag (1); + + // Add the handler to Cache + int retval = this->orb_core ()->connection_cache ().cache_handler (&prop, + this); + if (retval == -1) + return retval; + } + + return 0; +} + + +int TAO_IIOP_Connection_Handler::handle_input (ACE_HANDLE h) { return this->handle_input_i (h); diff --git a/TAO/tao/IIOP_Connection_Handler.h b/TAO/tao/IIOP_Connection_Handler.h index 6d4dd064eff..57dd92fade4 100644 --- a/TAO/tao/IIOP_Connection_Handler.h +++ b/TAO/tao/IIOP_Connection_Handler.h @@ -26,6 +26,7 @@ #include "tao/Wait_Strategy.h" #include "tao/Connection_Handler.h" #include "tao/IIOP_Transport.h" +#include "tao/IIOPC.h" // Forward Decls class TAO_Pluggable_Messaging; @@ -122,6 +123,8 @@ public: /// Add ourselves to Cache. int add_handler_to_cache (void); + /// Process the <listen_list> + int process_listen_point_list (IIOP::ListenPointList &listen_list); protected: /// = Event Handler overloads diff --git a/TAO/tao/IIOP_Connector.cpp b/TAO/tao/IIOP_Connector.cpp index fb4115ad299..353fb469af5 100644 --- a/TAO/tao/IIOP_Connector.cpp +++ b/TAO/tao/IIOP_Connector.cpp @@ -110,6 +110,13 @@ TAO_IIOP_Connector::connect (TAO_Connection_Descriptor_Interface *desc, TAO_IIOP_Connection_Handler *svc_handler = 0; TAO_Connection_Handler *conn_handler = 0; + // If the BiDir policy has been set look for BiDir Connections if + // any + if (this->orb_core ()->bidir_giop_policy ()) + { + desc->set_bidir_flag (1); + } + // Check the Cache first for connections if (this->orb_core ()->connection_cache ().find_handler (desc, conn_handler) == 0) diff --git a/TAO/tao/IIOP_Transport.cpp b/TAO/tao/IIOP_Transport.cpp index 1cae8dd52b8..71552b80441 100644 --- a/TAO/tao/IIOP_Transport.cpp +++ b/TAO/tao/IIOP_Transport.cpp @@ -344,6 +344,27 @@ TAO_IIOP_Transport::bidirectional_flag (int flag) } + +int +TAO_IIOP_Transport::tear_listen_point_list (TAO_InputCDR &cdr) +{ + CORBA::Boolean byte_order; + if ((cdr >> ACE_InputCDR::to_boolean (byte_order)) == 0) + return -1; + + cdr.reset_byte_order (ACE_static_cast(int,byte_order)); + + IIOP::ListenPointList listen_list; + if ((cdr >> listen_list) == 0) + return -1; + + // As we have received a bidirectional information, set the flag to + // 1 + this->bidirectional_flag_ = 1; + return this->connection_handler_->process_listen_point_list (listen_list); +} + + int TAO_IIOP_Transport::process_message (void) { diff --git a/TAO/tao/IIOP_Transport.h b/TAO/tao/IIOP_Transport.h index 3947c7ed060..51ed65c08ec 100644 --- a/TAO/tao/IIOP_Transport.h +++ b/TAO/tao/IIOP_Transport.h @@ -143,6 +143,8 @@ public: /// Set the bidirectional flag virtual void bidirectional_flag (int flag); + /// Open teh service context list and process it. + virtual int tear_listen_point_list (TAO_InputCDR &cdr); private: /// Process the message that we have read diff --git a/TAO/tao/Pluggable.cpp b/TAO/tao/Pluggable.cpp index 02646308ef3..2b05b53dee7 100644 --- a/TAO/tao/Pluggable.cpp +++ b/TAO/tao/Pluggable.cpp @@ -198,6 +198,12 @@ TAO_Transport::bidirectional_flag (int ) return; } +int +TAO_Transport::tear_listen_point_list (TAO_InputCDR & /*cdr*/) +{ + ACE_NOTSUP_RETURN (-1); +} + // Read the message on the connection. Returns 0 when there is Short // Read on the connection. Returns 1 when the full reply is read and diff --git a/TAO/tao/Pluggable.h b/TAO/tao/Pluggable.h index addaf9818c2..1410612e9c9 100644 --- a/TAO/tao/Pluggable.h +++ b/TAO/tao/Pluggable.h @@ -227,6 +227,8 @@ public: virtual void bidirectional_flag (int flag); // Set the bidirectional flag + virtual int tear_listen_point_list (TAO_InputCDR &cdr); + void dequeue_all (void); /// Return the TAO_ORB_Core diff --git a/TAO/tao/PortableServer/Object_Adapter.cpp b/TAO/tao/PortableServer/Object_Adapter.cpp index 2d5a5399d38..579413bb4ec 100644 --- a/TAO/tao/PortableServer/Object_Adapter.cpp +++ b/TAO/tao/PortableServer/Object_Adapter.cpp @@ -1423,6 +1423,7 @@ TAO_Object_Adapter::Priority_Model_Processing::pre_invoke ( // Attempt to extract client-propagated priority from the // ServiceContextList of the request. + RTCORBA::Priority target_priority; int priority_found = 0; for (CORBA::ULong i = 0; diff --git a/TAO/tao/Service_Context.h b/TAO/tao/Service_Context.h index 210bad6c95e..0581de8d8aa 100644 --- a/TAO/tao/Service_Context.h +++ b/TAO/tao/Service_Context.h @@ -81,6 +81,10 @@ public: /// list. void set_context (IOP::ServiceContext &context, TAO_OutputCDR &cdr); + /// Is the <id> available in the underlying service context list? If + /// so return 1, else return 0 + int is_service_id (IOP::ServiceId id); + /// = Marshaling and demarshaling the list int encode (TAO_OutputCDR& cdr) const; int decode (TAO_InputCDR& cdr); diff --git a/TAO/tao/Service_Context.inl b/TAO/tao/Service_Context.inl index d3d6f95a453..d7540db80b7 100644 --- a/TAO/tao/Service_Context.inl +++ b/TAO/tao/Service_Context.inl @@ -36,3 +36,19 @@ TAO_Service_Context::set_context (IOP::ServiceContext &context, this->set_context_i (context, cdr); } + + +ACE_INLINE int +TAO_Service_Context::is_service_id (IOP::ServiceId id) +{ + for (CORBA::ULong i = 0; + i != this->service_context_.length (); + ++i) + { + if (id == this->service_context_[i].context_id) + { + return 1; + } + } + return 0; +} diff --git a/TAO/tao/TAO_Server_Request.cpp b/TAO/tao/TAO_Server_Request.cpp index e8b95ffa817..9cd6284fded 100644 --- a/TAO/tao/TAO_Server_Request.cpp +++ b/TAO/tao/TAO_Server_Request.cpp @@ -20,7 +20,7 @@ # include "tao/TAO_Server_Request.i" #endif /* ! __ACE_INLINE__ */ -ACE_RCSID(tao, GIOP_Server_Request, "$Id$") +ACE_RCSID(tao, TAO_Server_Request, "$Id$") #if defined (ACE_ENABLE_TIMEPROBES) @@ -132,7 +132,7 @@ TAO_ServerRequest::init_reply (void) // Pass in the service context list. We are sending back what we // received in the Request. (RTCORBA relies on it. Check before // modifying...) marina - reply_params.service_context_notowned (&this->service_info_); + reply_params.service_context_notowned (&this->service_info ()); // Are we going to marshall any data with the reply? reply_params.argument_flag_ = this->argument_flag_; @@ -187,7 +187,7 @@ TAO_ServerRequest::send_no_exception_reply (void) // Pass in the service context list. We are sending back what we // received in the Request. (RTCORBA relies on it. Check before // modifying...) marina - reply_params.service_context_notowned (&this->service_info_); + reply_params.service_context_notowned (&this->service_info ()); reply_params.reply_status_ = TAO_GIOP_NO_EXCEPTION; diff --git a/TAO/tao/TAO_Server_Request.h b/TAO/tao/TAO_Server_Request.h index 55844b34aae..a1b12c223f4 100644 --- a/TAO/tao/TAO_Server_Request.h +++ b/TAO/tao/TAO_Server_Request.h @@ -32,7 +32,7 @@ #include "tao/ORB.h" #include "tao/Tagged_Profile.h" #include "tao/OctetSeqC.h" - +#include "tao/Service_Context.h" class TAO_Pluggable_Messaging; class TAO_Transport; @@ -126,6 +126,12 @@ public: void service_info (IOP::ServiceContextList &service_info); // @@ The above two should go away... + TAO_Service_Context &service_context (void); + // Return the TAO_Service_Context + + TAO_Transport *transport (); + // Return the underlying transport + // To handle System Exceptions at the lowest level, // a method returning the request_id_ is needed. CORBA::ULong request_id (void); @@ -204,9 +210,12 @@ private: // A pointer to the ORB Core for the context where the request was // created. - IOP::ServiceContextList service_info_; + //IOP::ServiceContextList service_info_; // The service context for the request (CORBA Reference?). + TAO_Service_Context service_context_; + // Service Context info + CORBA::ULong request_id_; // Unique identifier for a request. diff --git a/TAO/tao/TAO_Server_Request.i b/TAO/tao/TAO_Server_Request.i index ff8a0cfd0b0..58235cdcbda 100644 --- a/TAO/tao/TAO_Server_Request.i +++ b/TAO/tao/TAO_Server_Request.i @@ -83,13 +83,25 @@ TAO_ServerRequest::object_key (void) ACE_INLINE IOP::ServiceContextList & TAO_ServerRequest::service_info (void) { - return this->service_info_; + return this->service_context_.service_info (); } ACE_INLINE void TAO_ServerRequest::service_info (IOP::ServiceContextList &service_info) { - this->service_info_= service_info; + this->service_context_.service_info () = service_info; +} + +ACE_INLINE TAO_Service_Context & +TAO_ServerRequest::service_context (void) +{ + return this->service_context_; +} + +ACE_INLINE TAO_Transport * +TAO_ServerRequest::transport (void) +{ + return this->transport_; } |