diff options
Diffstat (limited to 'TAO/tao/UIOP_Transport.cpp')
-rw-r--r-- | TAO/tao/UIOP_Transport.cpp | 135 |
1 files changed, 76 insertions, 59 deletions
diff --git a/TAO/tao/UIOP_Transport.cpp b/TAO/tao/UIOP_Transport.cpp index 6fe5104caa0..581ec29a25b 100644 --- a/TAO/tao/UIOP_Transport.cpp +++ b/TAO/tao/UIOP_Transport.cpp @@ -96,11 +96,6 @@ TAO_UIOP_Transport::event_handler (void) return this->handler_; } -void -TAO_UIOP_Transport::messaging_init (TAO_Pluggable_Message_Factory *mesg) -{ - this->giop_factory_ = mesg; -} // **************************************************************** TAO_UIOP_Server_Transport:: @@ -117,6 +112,12 @@ TAO_UIOP_Server_Transport::~TAO_UIOP_Server_Transport (void) { } +void +TAO_UIOP_Server_Transport::messaging_init (TAO_Pluggable_Server_Message_Factory *mesg) +{ + this->server_mesg_factory_ = mesg; +} + // **************************************************************** TAO_UIOP_Client_Transport:: @@ -138,52 +139,50 @@ 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*/, + const TAO_Profile* /*pfile*/, 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_->start_message (TAO_MESSAGE_REQUEST, + output) == 0) ACE_THROW (CORBA::MARSHAL ()); } void -TAO_UIOP_Client_Transport::start_locate (TAO_ORB_Core *orb_core, - const TAO_Profile* pfile, +TAO_UIOP_Client_Transport::start_locate (TAO_ORB_Core * /*orb_core*/, + TAO_Stub *stub, + const short add_dis, CORBA::ULong request_id, 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_->start_message (TAO_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_locate_request_header (request_id, + stub, + add_dis, + output) == 0) ACE_THROW (CORBA::MARSHAL ()); } @@ -198,11 +197,10 @@ 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) == -1) + if (this->client_mesg_factory_->send_message (this, + stream, + max_wait_time, + stub) == -1) return -1; return this->idle_after_send (); @@ -233,10 +231,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) @@ -254,12 +252,11 @@ TAO_UIOP_Client_Transport::handle_client_input (int /* block */, 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 (this, + *message_state, + reply_ctx, + request_id, + reply_status); if (result == -1) { if (TAO_debug_level > 0) @@ -315,6 +312,35 @@ TAO_UIOP_Client_Transport::register_handler (void) ACE_Event_Handler::READ_MASK); } + +void +TAO_UIOP_Client_Transport::messaging_init (TAO_Pluggable_Client_Message_Factory *mesg) +{ + this->client_mesg_factory_ = mesg; +} + +CORBA::Boolean +TAO_UIOP_Client_Transport::send_request_header (const IOP::ServiceContextList & svc_ctx, + CORBA::ULong request_id, + CORBA::Octet response_flags, + TAO_Stub *stub, + const CORBA::Short address_disposition, + const char* opname, + 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_request_header (svc_ctx, + request_id, + response_flags, + stub, + address_disposition, + opname, + msg); + return retval; +} + // **************************************************************** ssize_t @@ -385,25 +411,16 @@ TAO_UIOP_Transport::send_request (TAO_Stub *, } CORBA::Boolean -TAO_UIOP_Transport::send_request_header (const IOP::ServiceContextList & svc_ctx, - CORBA::ULong request_id, - CORBA::Octet response_flags, - TAO_Stub *stub, - const CORBA::Short address_disposition, - const char* opname, - TAO_OutputCDR & msg) +TAO_UIOP_Transport::send_request_header (const IOP::ServiceContextList & /*svc_ctx*/, + CORBA::ULong /*request_id*/, + CORBA::Octet /*response_flags*/, + TAO_Stub * /*stub*/, + const CORBA::Short /*address_disposition*/, + const char* /*opname*/, + 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->giop_factory_->write_request_header (svc_ctx, - request_id, - response_flags, - stub, - address_disposition, - opname, - msg); - - return retval; + // We should never be here. So return an error. + return 0; } + #endif /* TAO_HAS_UIOP */ |