#include <TAO_Server_Request.h>
Collaboration diagram for TAO_ServerRequest:

Public Member Functions | |
| TAO_ServerRequest (TAO_Pluggable_Messaging *mesg_base, TAO_InputCDR &input, TAO_OutputCDR &output, TAO_Transport *transport, TAO_ORB_Core *orb_core) | |
| TAO_ServerRequest (TAO_Pluggable_Messaging *mesg_base, CORBA::ULong request_id, CORBA::Boolean response_expected, CORBA::Boolean deferred_flag, TAO::ObjectKey &object_key, const char *operation, TAO_OutputCDR &output, TAO_Transport *transport, TAO_ORB_Core *orb_core, int &parse_error) | |
| TAO_ServerRequest (TAO_ORB_Core *orb_core, TAO_Operation_Details const &details, CORBA::Object_ptr target) | |
| Constructor used by thru-POA collocated invocation path. | |
| ~TAO_ServerRequest (void) | |
| Destructor. | |
| CORBA::ORB_ptr | orb (void) |
| Return the underlying ORB. | |
| TAO_ORB_Core * | orb_core (void) const |
| Return the ORB core pointer member. | |
| void | init_reply (void) |
| Start a Reply message. | |
| TAO_InputCDR * | incoming (void) const |
| Retrieve the incoming stream. | |
| TAO_OutputCDR * | outgoing (void) const |
| Retrieve the outgoing stream. | |
| CORBA::Boolean | response_expected (void) const |
| Is the response expected? | |
| CORBA::Boolean | deferred_reply (void) const |
| Should the reply be deferred? | |
| void | response_expected (CORBA::Boolean response) |
| Set the response expected flag. | |
| CORBA::Boolean | sync_with_server (void) const |
| Should we return before dispatching the servant? | |
| void | sync_with_server (CORBA::Boolean sync_flag) |
| Set the sync_with_server flag. | |
| void | send_no_exception_reply (void) |
| Used with reliable oneway requests. | |
| TAO::ObjectKey & | object_key (void) |
| TAO_Service_Context & | request_service_context (void) |
| Return the request TAO_Service_Context. | |
| TAO_Service_Context & | reply_service_context (void) |
| Return the reply TAO_Service_Context. | |
| IOP::ServiceContextList & | reply_service_info (void) |
| IOP::ServiceContextList & | request_service_info (void) |
| TAO_Transport * | transport () |
| Return the underlying transport. | |
| void | forward_location (CORBA::Object_ptr forward_reference) |
| CORBA::Object_ptr | forward_location (void) |
| Get the forward_location. | |
| CORBA::ULong | exception_type (void) |
| Get the exception type. | |
| void | exception_type (CORBA::ULong except_type) |
| Set the exception type. | |
| void | requesting_principal (const CORBA::OctetSeq &principal) |
| Set the requesting principal. | |
| TAO_Tagged_Profile & | profile (void) |
| Return the reference to the tagged profile. | |
| void | tao_send_reply (void) |
| void | tao_send_reply_exception (CORBA::Exception &) |
| void | is_dsi (void) |
| Set the boolean member to 1. | |
| void | dsi_nvlist_align (ptrdiff_t alignment) |
| Set the member. | |
| TAO_Operation_Details const * | operation_details (void) const |
| void | argument_flag (CORBA::Boolean flag) |
| Set the argument_flag. | |
| CORBA::Boolean | argument_flag (void) |
| Get the argument_flag. | |
| bool | collocated (void) const |
Returns true if the current request is collocated. | |
| void | send_cached_reply (CORBA::OctetSeq &ocs) |
| void | result_seq (CORBA::OctetSeq &ocs) |
| int | got_result (void) |
| Check whether we got the result. | |
| size_t & | interceptor_count (void) |
| TAO::PICurrent_Impl * | rs_pi_current (void) |
| Return a reference to the "request scope" PICurrent object. | |
| CORBA::Exception * | caught_exception (void) |
| void | caught_exception (CORBA::Exception *exception) |
| void | reply_status (PortableInterceptor::ReplyStatus s) |
| Set the status of the received reply. | |
| PortableInterceptor::ReplyStatus | reply_status (void) |
| Get the status of the received reply. | |
Request attributes. | |
| const char * | operation (void) const |
| Return the operation name. | |
| void | operation (const char *operation, size_t length, int release) |
| Set the operation name. | |
| size_t | operation_length (void) const |
| Return the length of the operation. | |
| CORBA::ULong | request_id (void) |
| void | request_id (CORBA::ULong req) |
Private Attributes | |
| TAO_Pluggable_Messaging * | mesg_base_ |
| ACE_CString | operation_ |
| Operation name. | |
| CORBA::Object_var | forward_location_ |
| TAO_InputCDR * | incoming_ |
| Incoming stream. | |
| TAO_OutputCDR * | outgoing_ |
| Outgoing stream. | |
| TAO_Transport * | transport_ |
| Transport class. | |
| CORBA::Boolean | response_expected_ |
| CORBA::Boolean | deferred_reply_ |
| CORBA::Boolean | sync_with_server_ |
| CORBA::Boolean | is_dsi_ |
| Did we get passed to a CORBA::ServerRequest? | |
| CORBA::ULong | exception_type_ |
| Exception type (will be NO_EXCEPTION in the majority of the cases). | |
| TAO_ORB_Core * | orb_core_ |
| TAO_Service_Context | request_service_context_ |
| Service Context info. | |
| TAO_Service_Context | reply_service_context_ |
| CORBA::ULong | request_id_ |
| Unique identifier for a request. | |
| TAO_Tagged_Profile | profile_ |
| The tagged profile that has the addressing information. | |
| CORBA::OctetSeq_var | requesting_principal_ |
| Identifies the requester. | |
| ptrdiff_t | dsi_nvlist_align_ |
| Used to pad CDR stream if we have used DSI. | |
| TAO_Operation_Details const * | operation_details_ |
| CORBA::Boolean | argument_flag_ |
| size_t | interceptor_count_ |
| TAO::PICurrent_Impl * | rs_pi_current_ |
| CORBA::OctetSeq_var | result_seq_ |
| Used by the FTORB. | |
| CORBA::Exception * | caught_exception_ |
| Pointer to the caught exception. | |
| PortableInterceptor::ReplyStatus | reply_status_ |
| Reply status for the current request. | |
Friends | |
| class | TAO::CSD::FW_Server_Request_Wrapper |
| class | TAO_AMH_Response_Handler |
| Declare TAO_AMH_Response_Handler a friend. | |
Encapsulates CDR, transport and pluggable messaging components on the server side.
Definition at line 80 of file TAO_Server_Request.h.
|
||||||||||||||||||||||||
|
Definition at line 51 of file TAO_Server_Request.cpp. References ACE_FUNCTION_TIMEPROBE, and TAO_GIOP_NO_EXCEPTION.
00056 : mesg_base_ (mesg_base), 00057 operation_ (), 00058 incoming_ (&input), 00059 outgoing_ (&output), 00060 // transport already duplicated in 00061 // TAO_Transport::process_parsed_messages () 00062 transport_(transport), 00063 response_expected_ (false), 00064 deferred_reply_ (false), 00065 sync_with_server_ (false), 00066 is_dsi_ (false), 00067 // @@ We shouldn't be using GIOP specific types here. Need to be revisited. 00068 exception_type_ (TAO_GIOP_NO_EXCEPTION), 00069 orb_core_ (orb_core), 00070 request_id_ (0), 00071 profile_ (orb_core), 00072 requesting_principal_ (0), 00073 dsi_nvlist_align_ (0), 00074 operation_details_ (0), 00075 argument_flag_ (1) 00076 #if TAO_HAS_INTERCEPTORS == 1 00077 , interceptor_count_ (0) 00078 , rs_pi_current_ (0) 00079 , result_seq_ (0) 00080 , caught_exception_ (0) 00081 , reply_status_ (-1) 00082 #endif /* TAO_HAS_INTERCEPTORS == 1 */ 00083 { 00084 ACE_FUNCTION_TIMEPROBE (TAO_SERVER_REQUEST_START); 00085 // No-op. 00086 } |
|
||||||||||||||||||||||||||||||||||||||||||||
|
Definition at line 89 of file TAO_Server_Request.cpp. References TAO_Tagged_Profile::object_key(), and TAO_GIOP_NO_EXCEPTION.
00099 : mesg_base_ (mesg_base), 00100 operation_ (operation), 00101 incoming_ (0), 00102 outgoing_ (&output), 00103 // transport already duplicated in 00104 // TAO_Transport::process_parsed_messages () 00105 transport_ (transport), 00106 response_expected_ (response_expected), 00107 deferred_reply_ (deferred_reply), 00108 sync_with_server_ (false), 00109 is_dsi_ (false), 00110 exception_type_ (TAO_GIOP_NO_EXCEPTION), 00111 orb_core_ (orb_core), 00112 request_id_ (request_id), 00113 profile_ (orb_core), 00114 requesting_principal_ (0), 00115 dsi_nvlist_align_ (0), 00116 operation_details_ (0), 00117 argument_flag_ (true) 00118 #if TAO_HAS_INTERCEPTORS == 1 00119 , interceptor_count_ (0) 00120 , rs_pi_current_ (0) 00121 , result_seq_ (0) 00122 , caught_exception_ (0) 00123 , reply_status_ (-1) 00124 #endif /* TAO_HAS_INTERCEPTORS == 1 */ 00125 { 00126 this->profile_.object_key (object_key); 00127 parse_error = 0; 00128 } |
|
||||||||||||||||
|
Constructor used by thru-POA collocated invocation path.
Definition at line 131 of file TAO_Server_Request.cpp. References CORBA::Object::_stubobj(), TAO::unbounded_value_sequence< ServiceContext >::get_buffer(), TAO::unbounded_value_sequence< ServiceContext >::length(), TAO::unbounded_value_sequence< ServiceContext >::maximum(), TAO_Stub::object_key(), TAO_Tagged_Profile::object_key(), CORBA::Object_ptr, TAO::unbounded_value_sequence< ServiceContext >::replace(), request_service_context_, TAO_Service_Context::service_info(), TAO_GIOP_NO_EXCEPTION, and TAO_TWOWAY_RESPONSE_FLAG.
00134 : mesg_base_ (0), 00135 operation_ (details.opname ()), 00136 incoming_ (0), 00137 outgoing_ (0), 00138 transport_ (0), 00139 response_expected_ (details.response_flags () == TAO_TWOWAY_RESPONSE_FLAG 00140 || details.response_flags () == static_cast<CORBA::Octet> (Messaging::SYNC_WITH_SERVER) 00141 || details.response_flags () == static_cast<CORBA::Octet> (Messaging::SYNC_WITH_TARGET)), 00142 deferred_reply_ (false), 00143 sync_with_server_ (details.response_flags () == static_cast<CORBA::Octet> (Messaging::SYNC_WITH_SERVER)), 00144 is_dsi_ (false), 00145 exception_type_ (TAO_GIOP_NO_EXCEPTION), 00146 orb_core_ (orb_core), 00147 request_id_ (0), 00148 profile_ (orb_core), 00149 requesting_principal_ (0), 00150 dsi_nvlist_align_ (0), 00151 operation_details_ (&details), 00152 argument_flag_ (false) 00153 #if TAO_HAS_INTERCEPTORS == 1 00154 , interceptor_count_ (0) 00155 , rs_pi_current_ (0) 00156 , result_seq_ (0) 00157 , caught_exception_ (0) 00158 , reply_status_ (-1) 00159 #endif /* TAO_HAS_INTERCEPTORS == 1 */ 00160 { 00161 // Have to use a const_cast<>. *sigh* 00162 this->profile_.object_key ( 00163 const_cast<TAO::ObjectKey &> (target->_stubobj ()->object_key ())); 00164 00165 // Shallow copy the request service context list. This way the operation 00166 // details and server request share the request context. 00167 IOP::ServiceContextList & dest_request_contexts = 00168 this->request_service_context_.service_info (); 00169 00170 IOP::ServiceContextList & src_request_contexts = 00171 (const_cast <TAO_Operation_Details&> (details)).request_service_info (); 00172 00173 dest_request_contexts.replace (src_request_contexts.maximum (), 00174 src_request_contexts.length (), 00175 src_request_contexts.get_buffer (), 00176 false /* Do not release. */); 00177 00178 // Don't shallow copy the reply service context. It is probably empty, 00179 // when then during the request it is used, the buffer gets allocated and 00180 // then the operation details don't get the reply service context 00181 } |
|
|
Destructor.
Definition at line 183 of file TAO_Server_Request.cpp. References TAO::ServerRequestInterceptor_Adapter::deallocate_pi_current(), rs_pi_current_, and TAO_ORB_Core::serverrequestinterceptor_adapter().
00184 {
00185 #if TAO_HAS_INTERCEPTORS == 1
00186 if (this->rs_pi_current_)
00187 {
00188 TAO::ServerRequestInterceptor_Adapter *interceptor_adapter =
00189 this->orb_core_->serverrequestinterceptor_adapter ();
00190
00191 if (interceptor_adapter)
00192 {
00193 interceptor_adapter->deallocate_pi_current (
00194 this->rs_pi_current_);
00195 }
00196 }
00197 #endif /* TAO_HAS_INTERCEPTORS == 1 */
00198 }
|
|
|
Get the argument_flag.
Definition at line 180 of file TAO_Server_Request.i.
00181 {
00182 return this->argument_flag_;
00183 }
|
|
|
Set the argument_flag.
Definition at line 186 of file TAO_Server_Request.i.
00187 {
00188 this->argument_flag_ = flag;
00189 }
|
|
|
Definition at line 542 of file TAO_Server_Request.cpp. References CORBA::UserException::_downcast(), and CORBA::SystemException::_downcast().
00543 {
00544 if (CORBA::SystemException::_downcast (exception) != 0)
00545 this->reply_status_ = PortableInterceptor::SYSTEM_EXCEPTION;
00546 else if (CORBA::UserException::_downcast (exception) != 0)
00547 this->reply_status_ = PortableInterceptor::USER_EXCEPTION;
00548
00549 this->caught_exception_ = exception;
00550 }
|
|
|
|
|
|
Returns
Definition at line 192 of file TAO_Server_Request.i. Referenced by tao_send_reply(), and tao_send_reply_exception().
00193 {
00194 return this->transport_ == 0;
00195 }
|
|
|
Should the reply be deferred?
Definition at line 59 of file TAO_Server_Request.i. References deferred_reply_.
00060 {
00061 return this->deferred_reply_;
00062 }
|
|
|
Set the member.
Definition at line 174 of file TAO_Server_Request.i.
00175 {
00176 this->dsi_nvlist_align_ = alignment;
00177 }
|
|
|
Set the exception type.
Definition at line 156 of file TAO_Server_Request.i. References exception_type_.
00157 {
00158 this->exception_type_ = except_type;
00159 }
|
|
|
Get the exception type.
Definition at line 150 of file TAO_Server_Request.i. References exception_type_. Referenced by TAO_GIOP_Message_Lite::process_locate_request(), and TAO_GIOP_Message_Base::process_locate_request().
00151 {
00152 return this->exception_type_;
00153 }
|
|
|
Get the forward_location.
Definition at line 144 of file TAO_Server_Request.i. References CORBA::Object::_duplicate().
00145 {
00146 return CORBA::Object::_duplicate (this->forward_location_.in ());
00147 }
|
|
|
Set the reference to the object the request should be forwarded to. This reference will only be used if set prior to calling init_reply(). Definition at line 137 of file TAO_Server_Request.i. References CORBA::Object::_duplicate(), forward_location_, and CORBA::Object_ptr. Referenced by TAO_GIOP_Message_Lite::process_locate_request(), and TAO_GIOP_Message_Base::process_locate_request().
00138 {
00139 this->forward_location_ =
00140 CORBA::Object::_duplicate (forward_reference);
00141 }
|
|
|
Check whether we got the result.
|
|
|
Retrieve the incoming stream.
Definition at line 14 of file TAO_Server_Request.i. Referenced by TAO_GIOP_Message_Lite::parse_request_header(), TAO_GIOP_Message_Generator_Parser_12::parse_request_header(), and TAO_GIOP_Message_Generator_Parser_10::parse_request_header().
00015 {
00016 return this->incoming_;
00017 }
|
|
|
Start a Reply message.
Definition at line 222 of file TAO_Server_Request.cpp. References ACE_DEBUG, ACE_TEXT, TAO_Pluggable_Reply_Params_Base::argument_flag_, TAO_Transport::assign_translators(), TAO_Pluggable_Reply_Params_Base::dsi_nvlist_align_, exception_type_, forward_location_, TAO_Pluggable_Messaging::generate_reply_header(), TAO_Pseudo_Var_T< T >::in(), TAO_Pluggable_Reply_Params_Base::is_dsi_, CORBA::is_nil(), TAO_ORB_Core::is_permanent_forward_condition(), LM_DEBUG, mesg_base_, TAO_OutputCDR::message_attributes(), CORBA::Object_ptr, outgoing_, TAO_Pluggable_Reply_Params_Base::reply_status_, TAO_Pluggable_Reply_Params_Base::request_id_, request_service_context(), TAO_Pluggable_Reply_Params_Base::service_context_notowned(), TAO_GIOP_NO_EXCEPTION, TAO_PLUGGABLE_MESSAGE_LOCATION_FORWARD, TAO_PLUGGABLE_MESSAGE_LOCATION_FORWARD_PERM, and TAO_PLUGGABLE_MESSAGE_NO_EXCEPTION.
00223 {
00224 if (!this->outgoing_)
00225 return; // Collocated
00226
00227 // Construct our reply generator.
00228 TAO_Pluggable_Reply_Params_Base reply_params;
00229
00230 // We put all the info that we have in to this <reply_params> and
00231 // call the <write_reply_header> in the
00232 // pluggable_messaging_interface. One point to be noted however is
00233 // that, it was the pluggable_messaging classes who created us and
00234 // delegated us to do work on its behalf. But we would be calling
00235 // back. As we don't have a LOCK or any such things we can call
00236 // pluggable_messaging guys again. We would be on the same thread of
00237 // invocation. So *theoretically* there should not be a problem.
00238 reply_params.request_id_ = this->request_id_;
00239 reply_params.is_dsi_ = this->is_dsi_;
00240 reply_params.dsi_nvlist_align_ = this->dsi_nvlist_align_;
00241
00242 // Send back the reply service context.
00243 reply_params.service_context_notowned (&this->reply_service_info ());
00244
00245 // Are we going to marshall any data with the reply?
00246 reply_params.argument_flag_ = this->argument_flag_;
00247
00248 // Forward exception only.
00249 if (!CORBA::is_nil (this->forward_location_.in ()))
00250 {
00251 CORBA::Boolean const permanent_forward_condition =
00252 this->orb_core_->is_permanent_forward_condition (this->forward_location_.in (),
00253 this->request_service_context ());
00254
00255 reply_params.reply_status_
00256 = permanent_forward_condition
00257 ? TAO_PLUGGABLE_MESSAGE_LOCATION_FORWARD_PERM
00258 : TAO_PLUGGABLE_MESSAGE_LOCATION_FORWARD;
00259 }
00260 // Any exception at all.
00261 else if (this->exception_type_ == TAO_GIOP_NO_EXCEPTION)
00262 {
00263 reply_params.reply_status_ = TAO_PLUGGABLE_MESSAGE_NO_EXCEPTION;
00264 }
00265 else
00266 {
00267 reply_params.reply_status_ = this->exception_type_;
00268 }
00269
00270
00271 this->outgoing_->message_attributes (this->request_id_,
00272 0,
00273 TAO_Transport::TAO_REPLY,
00274 0);
00275
00276 // Construct a REPLY header.
00277 this->mesg_base_->generate_reply_header (*this->outgoing_,
00278 reply_params);
00279
00280 // Finish the GIOP Reply header, then marshal the exception.
00281 if (reply_params.reply_status_ == TAO_PLUGGABLE_MESSAGE_LOCATION_FORWARD ||
00282 reply_params.reply_status_ == TAO_PLUGGABLE_MESSAGE_LOCATION_FORWARD_PERM)
00283 {
00284 // Marshal the forward location pointer.
00285 CORBA::Object_ptr object_ptr = this->forward_location_.in ();
00286
00287 if ((*this->outgoing_ << object_ptr) == 0)
00288 {
00289 ACE_DEBUG ((LM_DEBUG,
00290 ACE_TEXT ("TAO (%P|%t) - ServerRequest::init_reply, ")
00291 ACE_TEXT ("TAO_GIOP_ServerRequest::marshal - ")
00292 ACE_TEXT ("marshal encoding forwarded objref failed\n")));
00293 }
00294 }
00295 this->transport_->assign_translators (0, this->outgoing_);
00296 }
|
|
|
|
|
|
Set the boolean member to 1.
Definition at line 162 of file TAO_Server_Request.i.
00163 {
00164 this->is_dsi_ = 1;
00165 }
|
|
|
Definition at line 83 of file TAO_Server_Request.i. References TAO_Tagged_Profile::object_key(). Referenced by TAO_Request_Dispatcher::dispatch(), TAO_GIOP_Message_Lite::parse_request_header(), TAO_GIOP_Message_Lite::process_locate_request(), and TAO_GIOP_Message_Lite::process_request().
00084 {
00085 return this->profile_.object_key ();
00086 }
|
|
||||||||||||||||
|
Set the operation name.
Definition at line 32 of file TAO_Server_Request.i.
00035 {
00036 if (length == 0)
00037 {
00038 this->operation_.set (operation, release);
00039 }
00040 else
00041 {
00042 this->operation_.set (operation, length, release);
00043 }
00044 }
|
|
|
Return the operation name.
Definition at line 26 of file TAO_Server_Request.i. Referenced by TAO_GIOP_Message_Lite::parse_request_header(), TAO_GIOP_Message_Generator_Parser_12::parse_request_header(), and TAO_GIOP_Message_Generator_Parser_10::parse_request_header().
00027 {
00028 return this->operation_.c_str ();
00029 }
|
|
|
Definition at line 168 of file TAO_Server_Request.i. References operation_details_.
00169 {
00170 return this->operation_details_;
00171 }
|
|
|
Return the length of the operation.
Definition at line 47 of file TAO_Server_Request.i.
00048 {
00049 return this->operation_.length ();
00050 }
|
|
|
Return the underlying ORB.
Definition at line 201 of file TAO_Server_Request.cpp. References TAO_ORB_Core::orb().
|
|
|
Return the ORB core pointer member.
Definition at line 8 of file TAO_Server_Request.i. Referenced by TAO_GIOP_Message_Generator_Parser_12::parse_request_header(), TAO_GIOP_Message_Lite::process_request(), and TAO_GIOP_Message_Base::process_request().
00009 {
00010 return this->orb_core_;
00011 }
|
|
|
Retrieve the outgoing stream.
Definition at line 20 of file TAO_Server_Request.i. References outgoing_.
00021 {
00022 return this->outgoing_;
00023 }
|
|
|
Return the reference to the tagged profile.
Definition at line 131 of file TAO_Server_Request.i. Referenced by TAO_GIOP_Message_Generator_Parser_12::parse_request_header(), and TAO_GIOP_Message_Generator_Parser_10::parse_request_header().
00132 {
00133 return this->profile_;
00134 }
|
|
|
Return the reply TAO_Service_Context.
Definition at line 207 of file TAO_Server_Request.cpp. References operation_details_, and reply_service_context_. Referenced by reply_service_info().
00208 {
00209 if (!operation_details_)
00210 {
00211 return this->reply_service_context_;
00212 }
00213 else
00214 {
00215 return const_cast <TAO_Operation_Details*> (
00216 this->operation_details_)->reply_service_context ();
00217 }
00218 }
|
|
|
Definition at line 95 of file TAO_Server_Request.i. References reply_service_context(), and TAO_Service_Context::service_info(). Referenced by TAO_GIOP_Message_Lite::process_request(), and TAO_GIOP_Message_Base::process_request().
00096 {
00097 return this->reply_service_context ().service_info ();
00098 }
|
|
|
Get the status of the received reply.
|
|
|
Set the status of the received reply.
|
|
|
To handle System Exceptions at the lowest level, a method returning the request_id_ is needed. Definition at line 119 of file TAO_Server_Request.i.
00120 {
00121 this->request_id_ = req;
00122 }
|
|
|
To handle System Exceptions at the lowest level, a method returning the request_id_ is needed. Definition at line 113 of file TAO_Server_Request.i. Referenced by TAO_GIOP_Message_Lite::parse_request_header(), TAO_GIOP_Message_Generator_Parser_12::parse_request_header(), TAO_GIOP_Message_Generator_Parser_10::parse_request_header(), TAO_GIOP_Message_Lite::process_request(), and TAO_GIOP_Message_Base::process_request().
00114 {
00115 return this->request_id_;
00116 }
|
|
|
Return the request TAO_Service_Context.
Definition at line 89 of file TAO_Server_Request.i. References request_service_context_. Referenced by TAO_GIOP_Message_Generator_Parser_12::check_bidirectional_context(), init_reply(), TAO_GIOP_Message_Base::process_request(), and request_service_info().
00090 {
00091 return this->request_service_context_;
00092 }
|
|
|
Definition at line 101 of file TAO_Server_Request.i. References request_service_context(), and TAO_Service_Context::service_info(). Referenced by TAO_GIOP_Message_Generator_Parser_12::parse_request_header(), and TAO_GIOP_Message_Generator_Parser_10::parse_request_header().
00102 {
00103 return this->request_service_context ().service_info ();
00104 }
|
|
|
Set the requesting principal.
Definition at line 125 of file TAO_Server_Request.i. References requesting_principal_. Referenced by TAO_GIOP_Message_Generator_Parser_10::parse_request_header().
00126 {
00127 this->requesting_principal_ = principal;
00128 }
|
|
|
Set the response expected flag.
Definition at line 65 of file TAO_Server_Request.i.
00066 {
00067 this->response_expected_ = response;
00068 }
|
|
|
Is the response expected?
Definition at line 53 of file TAO_Server_Request.i. Referenced by TAO_GIOP_Message_Lite::parse_request_header(), TAO_GIOP_Message_Generator_Parser_12::parse_request_header(), TAO_GIOP_Message_Generator_Parser_10::parse_request_header(), TAO_GIOP_Message_Lite::process_request(), and TAO_GIOP_Message_Base::process_request().
00054 {
00055 return this->response_expected_;
00056 }
|
|
|
Return the octet sequence pointer through which the FTORB would send the reply back. |
|
|
Return a reference to the "request scope" PICurrent object.
Definition at line 553 of file TAO_Server_Request.cpp. References TAO::ServerRequestInterceptor_Adapter::allocate_pi_current(), rs_pi_current_, and TAO_ORB_Core::serverrequestinterceptor_adapter().
00554 {
00555 if (!this->rs_pi_current_)
00556 {
00557 TAO::ServerRequestInterceptor_Adapter *interceptor_adapter =
00558 this->orb_core_->serverrequestinterceptor_adapter ();
00559
00560 if (interceptor_adapter)
00561 {
00562 this->rs_pi_current_ = interceptor_adapter->allocate_pi_current ();
00563 }
00564 }
00565
00566 return this->rs_pi_current_;
00567 }
|
|
|
Send cached reply. Used in scenarios where the FTORB thinks that this request is a duplicate Definition at line 462 of file TAO_Server_Request.cpp. References ACE_ERROR, ACE_TEXT, TAO_Pluggable_Reply_Params_Base::argument_flag_, TAO_Transport::assign_translators(), TAO_ORB_Parameters::cdr_memcpy_tradeoff(), TAO_Pluggable_Messaging::fragmentation_strategy(), TAO_Pluggable_Messaging::generate_reply_header(), TAO::unbounded_value_sequence< T >::get_buffer(), ACE_OutputCDR::good_bit(), TAO::unbounded_value_sequence< T >::length(), TAO::unbounded_value_sequence< ServiceContext >::length(), LM_ERROR, mesg_base_, TAO_OutputCDR::message_attributes(), TAO_OutputCDR::more_fragments(), TAO_ORB_Core::orb_params(), outgoing_, TAO_ORB_Core::output_cdr_dblock_allocator(), TAO_ORB_Core::output_cdr_msgblock_allocator(), TAO_Pluggable_Reply_Params_Base::reply_status_, TAO_Pluggable_Reply_Params_Base::request_id_, TAO_Transport::send_message(), TAO_Pluggable_Reply_Params_Base::service_context_notowned(), TAO_Pluggable_Reply_Params_Base::svc_ctx_, TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR, TAO_ENCAP_BYTE_ORDER, TAO_GIOP_NO_EXCEPTION, and ACE_OutputCDR::write_octet_array().
00463 {
00464 #if defined(ACE_HAS_PURIFY)
00465 // Only inititialize the buffer if we're compiling with Purify.
00466 // Otherwise, there is no real need to do so, especially since
00467 // we can avoid the initialization overhead at runtime if we
00468 // are not compiling with Purify support.
00469 char repbuf[ACE_CDR::DEFAULT_BUFSIZE] = { 0 };
00470 #else
00471 char repbuf[ACE_CDR::DEFAULT_BUFSIZE];
00472 #endif /* ACE_HAS_PURIFY */
00473
00474 TAO_OutputCDR output (repbuf,
00475 sizeof repbuf,
00476 TAO_ENCAP_BYTE_ORDER,
00477 this->orb_core_->output_cdr_buffer_allocator (),
00478 this->orb_core_->output_cdr_dblock_allocator (),
00479 this->orb_core_->output_cdr_msgblock_allocator (),
00480 this->orb_core_->orb_params ()->cdr_memcpy_tradeoff (),
00481 this->mesg_base_->fragmentation_strategy (),
00482 TAO_DEF_GIOP_MAJOR,
00483 TAO_DEF_GIOP_MINOR);
00484
00485 this->transport_->assign_translators (0, &output);
00486
00487 // A copy of the reply parameters
00488 TAO_Pluggable_Reply_Params_Base reply_params;
00489
00490 reply_params.request_id_ = this->request_id_;
00491
00492 reply_params.svc_ctx_.length (0);
00493
00494 // Send back the empty reply service context.
00495 reply_params.service_context_notowned (&this->reply_service_info ());
00496
00497 // We are going to send some data
00498 reply_params.argument_flag_ = 1;
00499
00500 // Make a default reply status
00501 reply_params.reply_status_ = TAO_GIOP_NO_EXCEPTION;
00502
00503 this->outgoing_->message_attributes (this->request_id_,
00504 0,
00505 TAO_Transport::TAO_REPLY,
00506 0);
00507
00508 // Make the reply message
00509 if (this->mesg_base_->generate_reply_header (*this->outgoing_,
00510 reply_params) == -1)
00511 {
00512 ACE_ERROR ((LM_ERROR,
00513 ACE_TEXT ("TAO (%P|%t) - ServerRequest::send_cached_reply, ")
00514 ACE_TEXT ("could not make cached reply\n")));
00515
00516 }
00517
00518 /// Append reply here....
00519 this->outgoing_->write_octet_array (
00520 s.get_buffer (),
00521 s.length ());
00522
00523 if (!this->outgoing_->good_bit ())
00524 ACE_ERROR ((LM_ERROR,
00525 ACE_TEXT ("TAO (%P|%t) - ServerRequest::send_cached_reply, ")
00526 ACE_TEXT ("could not marshal reply\n")));
00527
00528 this->outgoing_->more_fragments (false);
00529
00530 // Send the message
00531 if (this->transport_->send_message (*this->outgoing_,
00532 0,
00533 TAO_Transport::TAO_REPLY) == -1)
00534 {
00535 ACE_ERROR ((LM_ERROR,
00536 ACE_TEXT ("TAO (%P|%t) - ServerRequest::send_cached_reply, ")
00537 ACE_TEXT ("could not send cached reply\n")));
00538 }
00539 }
|
|
|
Used with reliable oneway requests.
Definition at line 299 of file TAO_Server_Request.cpp. References ACE_ERROR, ACE_TEXT, TAO_Pluggable_Reply_Params_Base::argument_flag_, TAO_Pluggable_Reply_Params_Base::dsi_nvlist_align_, TAO_Pluggable_Messaging::generate_reply_header(), TAO_Pluggable_Reply_Params_Base::is_dsi_, TAO::unbounded_value_sequence< ServiceContext >::length(), LM_ERROR, mesg_base_, TAO_OutputCDR::message_attributes(), TAO_OutputCDR::more_fragments(), outgoing_, TAO_Pluggable_Reply_Params_Base::reply_status_, TAO_Pluggable_Reply_Params_Base::request_id_, TAO_Transport::send_message(), TAO_Pluggable_Reply_Params_Base::service_context_notowned(), TAO_Pluggable_Reply_Params_Base::svc_ctx_, TAO_debug_level, and TAO_GIOP_NO_EXCEPTION.
00300 {
00301 // Construct our reply generator.
00302 TAO_Pluggable_Reply_Params_Base reply_params;
00303 reply_params.request_id_ = this->request_id_;
00304 reply_params.is_dsi_ = this->is_dsi_;
00305 reply_params.dsi_nvlist_align_ = this->dsi_nvlist_align_;
00306
00307 // Change this to pass back the same thing we received, as well as
00308 // leave a comment why this is important!
00309 reply_params.svc_ctx_.length (0);
00310
00311 // Send back the reply service context.
00312 reply_params.service_context_notowned (&this->reply_service_info ());
00313
00314 reply_params.reply_status_ = TAO_GIOP_NO_EXCEPTION;
00315
00316 // No data anyway.
00317 reply_params.argument_flag_ = 0;
00318
00319 this->outgoing_->message_attributes (this->request_id_,
00320 0,
00321 TAO_Transport::TAO_REPLY,
00322 0);
00323
00324 // Construct a REPLY header.
00325 this->mesg_base_->generate_reply_header (*this->outgoing_,
00326 reply_params);
00327
00328 this->outgoing_->more_fragments (false);
00329
00330 // Send the message.
00331 int result = this->transport_->send_message (*this->outgoing_,
00332 0,
00333 TAO_Transport::TAO_REPLY);
00334
00335 if (result == -1)
00336 {
00337 if (TAO_debug_level > 0)
00338 {
00339 // No exception but some kind of error, yet a response
00340 // is required.
00341 ACE_ERROR ((
00342 LM_ERROR,
00343 ACE_TEXT ("TAO (%P|%t) - ServerRequest::send_no_exception_reply, ")
00344 ACE_TEXT ("cannot send NO_EXCEPTION reply\n")
00345 ));
00346 }
00347 }
00348 }
|
|
|
Set the sync_with_server flag.
Definition at line 77 of file TAO_Server_Request.i. References sync_with_server_.
00078 {
00079 this->sync_with_server_ = sync_flag;
00080 }
|
|
|
Should we return before dispatching the servant?
Definition at line 71 of file TAO_Server_Request.i. References sync_with_server_. Referenced by TAO_GIOP_Message_Lite::parse_request_header(), TAO_GIOP_Message_Generator_Parser_12::parse_request_header(), and TAO_GIOP_Message_Generator_Parser_10::parse_request_header().
00072 {
00073 return this->sync_with_server_;
00074 }
|
|
|
Definition at line 351 of file TAO_Server_Request.cpp. References ACE_ERROR, ACE_TEXT, collocated(), LM_ERROR, TAO_OutputCDR::more_fragments(), outgoing_, TAO_Transport::send_message(), and TAO_debug_level.
00352 {
00353 if (this->collocated ())
00354 return; // No transport in the collocated case.
00355
00356 this->outgoing_->more_fragments (false);
00357
00358 int result = this->transport_->send_message (*this->outgoing_,
00359 0,
00360 TAO_Transport::TAO_REPLY);
00361 if (result == -1)
00362 {
00363 if (TAO_debug_level > 0)
00364 {
00365 // No exception but some kind of error, yet a response
00366 // is required.
00367 ACE_ERROR ((LM_ERROR,
00368 ACE_TEXT ("TAO (%P|%t) - ServerRequest::tao_send_reply, ")
00369 ACE_TEXT ("cannot send reply\n")));
00370 }
00371 }
00372 }
|
|
|
Definition at line 375 of file TAO_Server_Request.cpp. References CORBA::SystemException::_downcast(), ACE_ERROR, ACE_TEXT, TAO_Pluggable_Reply_Params_Base::argument_flag_, TAO_Transport::assign_translators(), TAO_ORB_Parameters::cdr_memcpy_tradeoff(), collocated(), TAO_Pluggable_Messaging::fragmentation_strategy(), TAO_Pluggable_Messaging::generate_exception_reply(), TAO::unbounded_value_sequence< ServiceContext >::length(), LM_ERROR, mesg_base_, TAO_OutputCDR::more_fragments(), TAO_ORB_Core::orb_params(), outgoing_, TAO_ORB_Core::output_cdr_dblock_allocator(), TAO_ORB_Core::output_cdr_msgblock_allocator(), TAO_Pluggable_Reply_Params_Base::reply_status_, TAO_Pluggable_Reply_Params_Base::request_id_, TAO_Transport::send_message(), TAO_Pluggable_Reply_Params_Base::service_context_notowned(), TAO_Pluggable_Reply_Params_Base::svc_ctx_, TAO_debug_level, TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR, TAO_ENCAP_BYTE_ORDER, TAO_GIOP_SYSTEM_EXCEPTION, and TAO_GIOP_USER_EXCEPTION.
00376 {
00377 if (this->response_expected_ && !this->collocated ())
00378 {
00379 // A copy of the reply parameters
00380 TAO_Pluggable_Reply_Params_Base reply_params;
00381
00382 reply_params.request_id_ = this->request_id_;
00383 reply_params.svc_ctx_.length (0);
00384
00385 // Send back the reply service context.
00386 reply_params.service_context_notowned (&this->reply_service_info ());
00387
00388 // We are going to send some data
00389 reply_params.argument_flag_ = 1;
00390
00391 // Make a default reply status
00392 reply_params.reply_status_ = TAO_GIOP_USER_EXCEPTION;
00393
00394 // Check whether we are able to downcast the exception
00395 if (CORBA::SystemException::_downcast (&ex) != 0)
00396 {
00397 reply_params.reply_status_ = TAO_GIOP_SYSTEM_EXCEPTION;
00398 }
00399
00400 // Create a new output CDR stream
00401 #if defined(ACE_INITIALIZE_MEMORY_BEFORE_USE)
00402 // Only inititialize the buffer if we're compiling with a profiler.
00403 // Otherwise, there is no real need to do so, especially since
00404 // we can avoid the initialization overhead at runtime if we
00405 // are not compiling with memory profiler support.
00406 char repbuf[ACE_CDR::DEFAULT_BUFSIZE] = { 0 };
00407 #else
00408 char repbuf[ACE_CDR::DEFAULT_BUFSIZE];
00409 #endif /* ACE_INITIALIZE_MEMORY_BEFORE_USE */
00410 TAO_OutputCDR output (repbuf,
00411 sizeof repbuf,
00412 TAO_ENCAP_BYTE_ORDER,
00413 this->orb_core_->output_cdr_buffer_allocator (),
00414 this->orb_core_->output_cdr_dblock_allocator (),
00415 this->orb_core_->output_cdr_msgblock_allocator (),
00416 this->orb_core_->orb_params ()->cdr_memcpy_tradeoff (),
00417 this->mesg_base_->fragmentation_strategy (),
00418 TAO_DEF_GIOP_MAJOR,
00419 TAO_DEF_GIOP_MINOR);
00420
00421 this->transport_->assign_translators (0, &output);
00422 // Make the reply message
00423 if (this->mesg_base_->generate_exception_reply (*this->outgoing_,
00424 reply_params,
00425 ex) == -1)
00426 {
00427 ACE_ERROR ((LM_ERROR,
00428 ACE_TEXT ("TAO (%P|%t) - ServerRequest::tao_send_reply_exception, ")
00429 ACE_TEXT ("could not make exception reply\n")));
00430
00431 }
00432
00433 this->outgoing_->more_fragments (false);
00434
00435 // Send the message
00436 if (this->transport_->send_message (*this->outgoing_,
00437 0,
00438 TAO_Transport::TAO_REPLY) == -1)
00439 {
00440 ACE_ERROR ((LM_ERROR,
00441 ACE_TEXT ("TAO (%P|%t) - ServerRequest::tao_send_reply_exception, ")
00442 ACE_TEXT ("could not send exception reply\n")));
00443 }
00444 }
00445 else if (TAO_debug_level > 0)
00446 {
00447 // It is unfortunate that an exception (probably a system
00448 // exception) was thrown by the upcall code (even by the
00449 // user) when the client was not expecting a response.
00450 // However, in this case, we cannot close the connection
00451 // down, since it really isn't the client's fault.
00452
00453 ACE_ERROR ((LM_ERROR,
00454 ACE_TEXT ("TAO (%P|%t) - ServerRequest::tao_send_reply_exception, ")
00455 ACE_TEXT ("exception thrown ")
00456 ACE_TEXT ("but client is not waiting a response\n")));
00457 }
00458 }
|
|
|
Return the underlying transport.
Definition at line 107 of file TAO_Server_Request.i. Referenced by TAO_GIOP_Message_Generator_Parser_12::check_bidirectional_context().
00108 {
00109 return this->transport_;
00110 }
|
|
|
Declare FW_Server_Request_Wrapper a friend This friendship makes the FW_Server_Request_Wrapper be able to clone the TAO_ServerRequest. Definition at line 87 of file TAO_Server_Request.h. |
|
|
Declare TAO_AMH_Response_Handler a friend. The TAO_AMH_Response_Handler class needs to copy part of the state in a TAO_ServerRequest, however, we do not want to expose that state as public members of this class, neither do we want to add modifiers to the TAO_AMH_Response_Handler class that would allow us (the TAO_ServerRequest class) to set the state. Lucky for us, C++ is a language for adult developers, and allow us to use the evil "friend" declaration. Definition at line 101 of file TAO_Server_Request.h. |
|
|
An argument flag to indicate whether there is any data that is going to get marshaled along as a reply. The default will be 1 which indicates that we have some data that needs to be sent back to the client. Definition at line 348 of file TAO_Server_Request.h. |
|
|
Pointer to the caught exception.
Definition at line 363 of file TAO_Server_Request.h. |
|
|
0: Reply would be sent by the object of this class which is the default. 1: Reply would not be prepared by this class and it would be deferred for somebody. Definition at line 308 of file TAO_Server_Request.h. Referenced by deferred_reply(). |
|
|
Used to pad CDR stream if we have used DSI.
Definition at line 338 of file TAO_Server_Request.h. |
|
|
Exception type (will be NO_EXCEPTION in the majority of the cases).
Definition at line 318 of file TAO_Server_Request.h. Referenced by exception_type(), and init_reply(). |
|
|
Definition at line 287 of file TAO_Server_Request.h. Referenced by forward_location(), and init_reply(). |
|
|
Incoming stream.
Definition at line 290 of file TAO_Server_Request.h. |
|
|
The number of interceptors pushed on to the current interceptor flow stack. Definition at line 353 of file TAO_Server_Request.h. |
|
|
Did we get passed to a CORBA::ServerRequest?
Definition at line 315 of file TAO_Server_Request.h. |
|
|
Definition at line 282 of file TAO_Server_Request.h. Referenced by init_reply(), send_cached_reply(), send_no_exception_reply(), and tao_send_reply_exception(). |
|
|
Operation name.
Definition at line 285 of file TAO_Server_Request.h. |
|
|
Definition at line 340 of file TAO_Server_Request.h. Referenced by operation_details(), and reply_service_context(). |
|
|
A pointer to the ORB Core for the context where the request was created. Definition at line 322 of file TAO_Server_Request.h. |
|
|
Outgoing stream.
Definition at line 293 of file TAO_Server_Request.h. Referenced by init_reply(), outgoing(), send_cached_reply(), send_no_exception_reply(), tao_send_reply(), and tao_send_reply_exception(). |
|
|
The tagged profile that has the addressing information.
Definition at line 332 of file TAO_Server_Request.h. |
|
|
Definition at line 326 of file TAO_Server_Request.h. Referenced by reply_service_context(). |
|
|
Reply status for the current request.
Definition at line 366 of file TAO_Server_Request.h. |
|
|
Unique identifier for a request.
Definition at line 329 of file TAO_Server_Request.h. |
|
|
Service Context info.
Definition at line 325 of file TAO_Server_Request.h. Referenced by request_service_context(), and TAO_ServerRequest(). |
|
|
Identifies the requester.
Definition at line 335 of file TAO_Server_Request.h. Referenced by requesting_principal(). |
|
|
0: oneway (SYNC_NONE or SYNC_WITH_TRANSPORT) 1: twoway, or oneway (SYNC_WITH_SERVER or SYNC_WITH_TARGET) Definition at line 300 of file TAO_Server_Request.h. |
|
|
Used by the FTORB.
Definition at line 360 of file TAO_Server_Request.h. |
|
|
The "Request Scope Current" (RSC) object, as required by Portable Interceptors. Definition at line 357 of file TAO_Server_Request.h. Referenced by rs_pi_current(), and ~TAO_ServerRequest(). |
|
|
1: oneway (SYNC_WITH_SERVER) 0: anything else Definition at line 312 of file TAO_Server_Request.h. Referenced by sync_with_server(). |
|
|
Transport class.
Definition at line 296 of file TAO_Server_Request.h. |
1.3.6