Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

TAO_GIOP_Message_Generator_Parser_12 Class Reference

Implementation for GIOP v1.2. More...

#include <GIOP_Message_Generator_Parser_12.h>

Inheritance diagram for TAO_GIOP_Message_Generator_Parser_12:

Inheritance graph
[legend]
Collaboration diagram for TAO_GIOP_Message_Generator_Parser_12:

Collaboration graph
[legend]
List of all members.

Public Methods

virtual int write_request_header (const TAO_Operation_Details &opdetails, TAO_Target_Specification &spec, TAO_OutputCDR &msg)
 Write the request header in to <msg>. More...

virtual int write_locate_request_header (CORBA::ULong request_id, TAO_Target_Specification &spec, TAO_OutputCDR &msg)
 Write the LocateRequest header. More...

virtual int write_reply_header (TAO_OutputCDR &output, TAO_Pluggable_Reply_Params_Base &reply ACE_ENV_ARG_DECL) throw (CORBA::SystemException)
 Write the reply header in to <output>. More...

virtual int write_locate_reply_mesg (TAO_OutputCDR &output, CORBA::ULong request_id, TAO_GIOP_Locate_Status_Msg &status)
 Writes the locate _reply message in to the <output>. More...

virtual int parse_request_header (TAO_ServerRequest &)
 Parse the Request Header from the incoming stream. This will do a version specific parsing of the incoming Request header. More...

virtual int parse_locate_header (TAO_GIOP_Locate_Request_Header &)
 Parse the LocateRequest Header from the incoming stream. This will do a version specific parsing of the incoming Request header. More...

virtual int parse_reply (TAO_InputCDR &input, TAO_Pluggable_Reply_Params &params)
 Parse the reply message. More...

virtual int parse_locate_reply (TAO_InputCDR &input, TAO_Pluggable_Reply_Params &params)
 Parse the locate reply message. More...

virtual CORBA::Octet major_version (void)
 Our versions. More...

virtual CORBA::Octet minor_version (void)
virtual int is_ready_for_bidirectional (void)
 Is the messaging object ready for processing BiDirectional request/response? More...


Private Methods

int marshall_target_spec (TAO_Target_Specification &spec, TAO_OutputCDR &msg)
 Marshall the TargetSpecification This method may be required for other GIOP versiona coming out later than 1.2. We need to share this method. More...

int check_bidirectional_context (TAO_ServerRequest &)
 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. More...

int process_bidir_context (TAO_Service_Context &, TAO_Transport *transport)
 Process the BiDirContext info that we have received. More...


Detailed Description

Implementation for GIOP v1.2.

Definition at line 34 of file GIOP_Message_Generator_Parser_12.h.


Member Function Documentation

int TAO_GIOP_Message_Generator_Parser_12::check_bidirectional_context TAO_ServerRequest   [private]
 

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.

Definition at line 537 of file GIOP_Message_Generator_Parser_12.cpp.

References TAO_Service_Context::is_service_id, process_bidir_context, TAO_ServerRequest::request_service_context, and TAO_ServerRequest::transport.

Referenced by parse_request_header.

00539 {
00540   TAO_Service_Context &service_context = request.request_service_context ();
00541 
00542   // Check whether we have the BiDir service context info available in
00543   // the ServiceContextList
00544   if (service_context.is_service_id (IOP::BI_DIR_IIOP)
00545       == 1)
00546     {
00547       return this->process_bidir_context (service_context,
00548                                           request.transport ());
00549     }
00550 
00551   return 0;
00552 }

int TAO_GIOP_Message_Generator_Parser_12::is_ready_for_bidirectional void    [virtual]
 

Is the messaging object ready for processing BiDirectional request/response?

Reimplemented from TAO_GIOP_Message_Generator_Parser.

Definition at line 440 of file GIOP_Message_Generator_Parser_12.cpp.

00441 {
00442   // We do support bidirectional
00443   return 1;
00444 }

CORBA::Octet TAO_GIOP_Message_Generator_Parser_12::major_version void    [virtual]
 

Our versions.

Implements TAO_GIOP_Message_Generator_Parser.

Definition at line 427 of file GIOP_Message_Generator_Parser_12.cpp.

00428 {
00429   return (CORBA::Octet) 1;
00430 }

int TAO_GIOP_Message_Generator_Parser_12::marshall_target_spec TAO_Target_Specification   spec,
TAO_OutputCDR   msg
[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.

Definition at line 449 of file GIOP_Message_Generator_Parser_12.cpp.

References ACE_DEBUG, ACE_TEXT, TAO_Target_Specification::iop_ior, TAO_Target_Specification::Key_Addr, LM_DEBUG, TAO_Target_Specification::object_key, TAO_Target_Specification::profile, TAO_Target_Specification::Profile_Addr, TAO_Target_Specification::Reference_Addr, and TAO_Target_Specification::specifier.

Referenced by write_locate_request_header, and write_request_header.

00453 {
00454   switch (spec.specifier ())
00455     {
00456     case TAO_Target_Specification::Key_Addr:
00457       {
00458         // As this is a union send in the discriminant first
00459         msg << GIOP::KeyAddr;
00460 
00461         // Get the object key
00462         const TAO_ObjectKey *key = spec.object_key ();
00463         if (key)
00464           {
00465             // Marshall in the object key
00466             msg << *key;
00467           }
00468         else
00469           {
00470             if (TAO_debug_level)
00471               ACE_DEBUG ((LM_DEBUG,
00472                           ACE_TEXT ("(%N |%l) Unable to handle this request \n")));
00473             return 0;
00474           }
00475         break;
00476       }
00477     case TAO_Target_Specification::Profile_Addr:
00478       {
00479         // As this is a union send in the discriminant first
00480         msg << GIOP::ProfileAddr;
00481 
00482         // Get the profile
00483         const IOP::TaggedProfile *pfile = spec.profile ();
00484 
00485         if (pfile)
00486           {
00487             // Marshall in the object key
00488             msg << *pfile;
00489           }
00490         else
00491           {
00492             if (TAO_debug_level)
00493               ACE_DEBUG ((LM_DEBUG,
00494                           ACE_TEXT ("(%N |%l) Unable to handle this request \n")));
00495             return 0;
00496           }
00497         break;
00498       }
00499     case TAO_Target_Specification::Reference_Addr:
00500       {
00501         // As this is a union send in the discriminant first
00502         msg << GIOP::ReferenceAddr;
00503 
00504         // Get the IOR
00505         IOP::IOR *ior;
00506         CORBA::ULong index = spec.iop_ior (ior);
00507 
00508         if (ior)
00509           {
00510             // This is a struct IORAddressingInfo. So, marshall each
00511             // member of the struct one after another in the order
00512             // defined.
00513             msg << index;
00514             msg << *ior;
00515           }
00516         else
00517           {
00518             if (TAO_debug_level)
00519             ACE_DEBUG ((LM_DEBUG,
00520                         ACE_TEXT ("(%N |%l) Unable to handle this request \n")));
00521             return 0;
00522           }
00523         break;
00524       }
00525     default:
00526       if (TAO_debug_level)
00527         ACE_DEBUG ((LM_DEBUG,
00528                     ACE_TEXT ("(%N |%l) Unable to handle this request \n")));
00529       return 0;
00530     }
00531 
00532   return 1;
00533 }

CORBA::Octet TAO_GIOP_Message_Generator_Parser_12::minor_version void    [virtual]
 

Implements TAO_GIOP_Message_Generator_Parser.

Definition at line 434 of file GIOP_Message_Generator_Parser_12.cpp.

00435 {
00436   return (CORBA::Octet) 2;
00437 }

int TAO_GIOP_Message_Generator_Parser_12::parse_locate_header TAO_GIOP_Locate_Request_Header   [virtual]
 

Parse the LocateRequest Header from the incoming stream. This will do a version specific parsing of the incoming Request header.

Implements TAO_GIOP_Message_Generator_Parser.

Definition at line 334 of file GIOP_Message_Generator_Parser_12.cpp.

References ACE_InputCDR::align_read_ptr, TAO_GIOP_Locate_Request_Header::incoming_stream, TAO_GIOP_Locate_Request_Header::profile, ACE_InputCDR::read_ulong, TAO_GIOP_Locate_Request_Header::request_id, TAO_GIOP_MESSAGE_ALIGN_PTR, and TAO_Tagged_Profile::unmarshall_target_address.

00337 {
00338   // Get the stream .
00339   TAO_InputCDR &msg = request.incoming_stream ();
00340 
00341   CORBA::Boolean hdr_status = 1;
00342 
00343   // Get the request id.
00344   CORBA::ULong req_id = 0;
00345   hdr_status = msg.read_ulong (req_id);
00346 
00347   // Store it in the Locate request classes
00348   request.request_id (req_id);
00349 
00350   // Unmarshal the target address field.
00351   hdr_status =
00352     hdr_status && request.profile ().unmarshall_target_address(msg);
00353 
00354   // Reset the pointer to an 8-byte bouns]dary
00355   msg.align_read_ptr (TAO_GIOP_MESSAGE_ALIGN_PTR);
00356 
00357   return hdr_status ? 0 : -1;
00358 }

int TAO_GIOP_Message_Generator_Parser_12::parse_locate_reply TAO_InputCDR   input,
TAO_Pluggable_Reply_Params   params
[virtual]
 

Parse the locate reply message.

Reimplemented from TAO_GIOP_Message_Generator_Parser.

Definition at line 398 of file GIOP_Message_Generator_Parser_12.cpp.

References ACE_InputCDR::exchange_data_blocks, TAO_Pluggable_Reply_Params::input_cdr_, and TAO_GIOP_Message_Generator_Parser::parse_locate_reply.

00402 {
00403   if (TAO_GIOP_Message_Generator_Parser::parse_locate_reply (cdr,
00404                                                              params) == -1)
00405 
00406     return -1;
00407 
00408   // Note: We dont align the pointer to an 8 byte boundary for a
00409   // locate reply body. This is due to an urgent issue raised by Michi
00410   // in the OMG. I discussed this with Michi today (09/07/2001) and I
00411   // learn that this has been passed. Hence the change..
00412   /*if (cdr.length () > 0)
00413     {
00414       // Align the read pointer on an 8-byte boundary
00415       cdr.align_read_ptr (TAO_GIOP_MESSAGE_ALIGN_PTR);
00416       }*/
00417 
00418   // Steal the contents in to the reply CDR and loose ownership of the
00419   // data block.
00420   params.input_cdr_.exchange_data_blocks (cdr);
00421 
00422   return 0;
00423 }

int TAO_GIOP_Message_Generator_Parser_12::parse_reply TAO_InputCDR   input,
TAO_Pluggable_Reply_Params   params
[virtual]
 

Parse the reply message.

Reimplemented from TAO_GIOP_Message_Generator_Parser.

Definition at line 361 of file GIOP_Message_Generator_Parser_12.cpp.

References ACE_ERROR, ACE_TEXT, ACE_InputCDR::align_read_ptr, ACE_InputCDR::exchange_data_blocks, TAO_Pluggable_Reply_Params::input_cdr_, ACE_InputCDR::length, LM_ERROR, TAO_GIOP_Message_Generator_Parser::parse_reply, TAO_Pluggable_Reply_Params_Base::svc_ctx_, and TAO_GIOP_MESSAGE_ALIGN_PTR.

00365 {
00366   if (TAO_GIOP_Message_Generator_Parser::parse_reply (cdr,
00367                                                       params) == -1)
00368 
00369     return -1;
00370 
00371   if ((cdr >> params.svc_ctx_) == 0)
00372     {
00373       if (TAO_debug_level > 0)
00374         ACE_ERROR ((LM_ERROR,
00375                     ACE_TEXT ("TAO (%P|%t) parse_reply, ")
00376                     ACE_TEXT ("extracting context\n")));
00377 
00378       return -1;
00379     }
00380 
00381   if (cdr.length () > 0)
00382     {
00383       // Align the read pointer on an 8-byte boundary
00384       cdr.align_read_ptr (TAO_GIOP_MESSAGE_ALIGN_PTR);
00385     }
00386 
00387 
00388 
00389 
00390   // Steal the contents in to the reply CDR and loose ownership of the
00391   // data block.
00392   params.input_cdr_.exchange_data_blocks (cdr);
00393 
00394   return 0;
00395 }

int TAO_GIOP_Message_Generator_Parser_12::parse_request_header TAO_ServerRequest   [virtual]
 

Parse the Request Header from the incoming stream. This will do a version specific parsing of the incoming Request header.

Implements TAO_GIOP_Message_Generator_Parser.

Definition at line 257 of file GIOP_Message_Generator_Parser_12.cpp.

References ACE_InputCDR::align_read_ptr, TAO_ORB_Core::bidir_giop_policy, check_bidirectional_context, ACE_InputCDR::good_bit, TAO_ServerRequest::incoming, ACE_InputCDR::length, TAO_ServerRequest::operation, TAO_ServerRequest::orb_core, TAO_ServerRequest::profile, ACE_InputCDR::rd_ptr, ACE_InputCDR::read_octet, ACE_InputCDR::read_ulong, TAO_ServerRequest::request_id, TAO_ServerRequest::request_service_info, TAO_ServerRequest::response_expected, ACE_InputCDR::skip_bytes, TAO_ServerRequest::sync_with_server, TAO_GIOP_MESSAGE_ALIGN_PTR, and TAO_Tagged_Profile::unmarshall_target_address.

00260 {
00261   // Get the input CDR in the request class
00262   TAO_InputCDR& input = request.incoming ();
00263 
00264   CORBA::Boolean hdr_status = (CORBA::Boolean) input.good_bit ();
00265 
00266   CORBA::ULong req_id;
00267   // Get the rest of the request header ...
00268   hdr_status = hdr_status && input.read_ulong (req_id);
00269 
00270   request.request_id (req_id);
00271 
00272   CORBA::Octet response_flags;
00273   hdr_status = hdr_status && input.read_octet (response_flags);
00274 
00275   request.response_expected ((response_flags > 0));
00276 
00277   // The high bit of the octet has been set if the SyncScope policy
00278   // value is SYNC_WITH_SERVER.
00279   request.sync_with_server ((response_flags == 1));
00280 
00281   // Reserved field
00282   input.skip_bytes (3);
00283 
00284   // Unmarshal the target address field.
00285   hdr_status =
00286     hdr_status && request.profile ().unmarshall_target_address(input);
00287 
00288   CORBA::ULong length = 0;
00289   hdr_status = hdr_status && input.read_ulong (length);
00290 
00291   if (hdr_status)
00292     {
00293       // Do not include NULL character at the end.
00294       // @@ This is not getting demarshaled using the codeset
00295       //    translators!
00296 
00297       // Notice that there are no memory allocations involved
00298       // here!
00299 
00300       request.operation (input.rd_ptr (),
00301                          length - 1,
00302                          0 /* TAO_ServerRequest does NOT own string */);
00303       hdr_status = input.skip_bytes (length);
00304     }
00305 
00306   // Tear out the service context ... we currently ignore it, but it
00307   // should probably be passed to each ORB service as appropriate
00308   // (e.g. transactions, security).
00309   //
00310   // NOTE: As security support kicks in, this is a good place to
00311   // verify a digital signature, if that is required in this security
00312   // environment.  It may be required even when using IPSEC security
00313   // infrastructure.
00314   IOP::ServiceContextList &req_service_info =
00315     request.request_service_info ();
00316 
00317   input >> req_service_info;
00318 
00319   // Check an process if BiDir contexts are available
00320   if (request.orb_core ()->bidir_giop_policy ())
00321     this->check_bidirectional_context (request);
00322 
00323   if (input.length () > 0)
00324     {
00325       // Reset the read_ptr to an 8-byte boundary.
00326       input.align_read_ptr (TAO_GIOP_MESSAGE_ALIGN_PTR);
00327     }
00328 
00329   return hdr_status ? 0 : -1;
00330 }

int TAO_GIOP_Message_Generator_Parser_12::process_bidir_context TAO_Service_Context  ,
TAO_Transport   transport
[private]
 

Process the BiDirContext info that we have received.

Definition at line 555 of file GIOP_Message_Generator_Parser_12.cpp.

References ACE_ERROR_RETURN, ACE_TEXT, IOP::ServiceContext::context_data, IOP::ServiceContext::context_id, TAO_Service_Context::get_context, LM_ERROR, and TAO_Transport::tear_listen_point_list.

Referenced by check_bidirectional_context.

00558 {
00559   // Get the context info
00560   IOP::ServiceContext context;
00561   context.context_id = IOP::BI_DIR_IIOP;
00562 
00563   if (service_context.get_context (context) != 1)
00564       ACE_ERROR_RETURN ((LM_ERROR,
00565                          ACE_TEXT ("(%P|%t) Context info not found \n")),
00566                         -1);
00567 
00568   TAO_InputCDR cdr (ACE_reinterpret_cast
00569                     (const char*,
00570                      context.context_data.get_buffer ()),
00571                     context.context_data.length ());
00572 
00573   return transport->tear_listen_point_list (cdr);
00574 }

int TAO_GIOP_Message_Generator_Parser_12::write_locate_reply_mesg TAO_OutputCDR   output,
CORBA::ULong    request_id,
TAO_GIOP_Locate_Status_Msg   status
[virtual]
 

Writes the locate _reply message in to the <output>.

Implements TAO_GIOP_Message_Generator_Parser.

Definition at line 193 of file GIOP_Message_Generator_Parser_12.cpp.

References ACE_DEBUG, ACE_TEXT, TAO_GIOP_Locate_Status_Msg::forward_location_var, LM_DEBUG, TAO_GIOP_Locate_Status_Msg::status, TAO_GIOP_LOC_NEEDS_ADDRESSING_MODE, TAO_GIOP_LOC_SYSTEM_EXCEPTION, TAO_GIOP_OBJECT_FORWARD, TAO_GIOP_OBJECT_FORWARD_PERM, and ACE_OutputCDR::write_ulong.

00198 {
00199   output.write_ulong (request_id);
00200 
00201   // Make the header for the locate request
00202   output.write_ulong (status_info.status);
00203 
00204   // Note: We dont align the pointer to an 8 byte boundary for a
00205   // locate reply body. This is due to an urgent issue raised by Michi
00206   // in the OMG. I discussed this with Michi today (09/07/2001) and I
00207   // learn that this has been passed. Hence the change..
00208   /*
00209   if (status_info.status == TAO_GIOP_OBJECT_FORWARD ||
00210       status_info.status == TAO_GIOP_OBJECT_FORWARD_PERM)
00211     {
00212       // We have to send some data, so align the pointer
00213       if (output.align_write_ptr (TAO_GIOP_MESSAGE_ALIGN_PTR) == -1)
00214         {
00215           return 0;
00216         }
00217     }
00218   */
00219   switch (status_info.status)
00220     {
00221     case TAO_GIOP_OBJECT_FORWARD:
00222 
00223       // More likely than not we will not have this in TAO
00224     case TAO_GIOP_OBJECT_FORWARD_PERM:
00225       {
00226         CORBA::Object_ptr object_ptr =
00227           status_info.forward_location_var.in ();
00228 
00229         if ((output << object_ptr) == 0)
00230         {
00231           if (TAO_debug_level > 0)
00232             {
00233               ACE_DEBUG ((
00234                   LM_DEBUG,
00235                   ACE_TEXT ("TAO (%P|%t|%N|%l) write_locate_reply_mesg-")
00236                   ACE_TEXT (" cannot marshal object reference\n")
00237                 ));
00238             }
00239         }
00240       }
00241       break;
00242     case TAO_GIOP_LOC_SYSTEM_EXCEPTION:
00243     case TAO_GIOP_LOC_NEEDS_ADDRESSING_MODE:
00244       // Do we do these in TAO??
00245       // What to do here???? I dont really know. I have to do a survey
00246       // of the specifications that uses this.
00247       break;
00248     default:
00249       break;
00250     }
00251 
00252   return 1;
00253 }

int TAO_GIOP_Message_Generator_Parser_12::write_locate_request_header CORBA::ULong    request_id,
TAO_Target_Specification   spec,
TAO_OutputCDR   msg
[virtual]
 

Write the LocateRequest header.

Implements TAO_GIOP_Message_Generator_Parser.

Definition at line 101 of file GIOP_Message_Generator_Parser_12.cpp.

References marshall_target_spec.

00106 {
00107   // Write the request id
00108   msg << request_id;
00109 
00110   // Write the target address
00111   if (this->marshall_target_spec (spec,
00112                                   msg) == 0)
00113     return 0;
00114 
00115   // I dont think we need to align the pointer to an 8 byte boundary
00116   // here.
00117   // We need to align the pointer
00118   //  if (msg.align_write_ptr (TAO_GIOP_MESSAGE_ALIGN_PTR) == -1)
00119   //  return 0;
00120 
00121   // Return success
00122   return 1;
00123 }

int TAO_GIOP_Message_Generator_Parser_12::write_reply_header TAO_OutputCDR   output,
TAO_Pluggable_Reply_Params_Base &reply    ACE_ENV_ARG_DECL
throw (CORBA::SystemException) [virtual]
 

Write the reply header in to <output>.

Implements TAO_GIOP_Message_Generator_Parser.

Definition at line 126 of file GIOP_Message_Generator_Parser_12.cpp.

References ACE_ENV_ARG_DECL_NOT_USED, TAO_Unbounded_Base_Sequence::length, TAO_GIOP_LOC_NEEDS_ADDRESSING_MODE, TAO_GIOP_LOCATION_FORWARD_PERM, TAO_GIOP_MESSAGE_ALIGN_PTR, TAO_PLUGGABLE_MESSAGE_LOCATION_FORWARD_PERM, and TAO_PLUGGABLE_MESSAGE_NEEDS_ADDRESSING_MODE.

00132 {
00133   // Write the request ID
00134   output.write_ulong (reply.request_id_);
00135 
00136    // Write the reply status
00137   if (reply.reply_status_ ==
00138       TAO_PLUGGABLE_MESSAGE_LOCATION_FORWARD_PERM)
00139     {
00140       // Not sure when we will use this.
00141       output.write_ulong (TAO_GIOP_LOCATION_FORWARD_PERM);
00142     }
00143   else if (reply.reply_status_ ==
00144            TAO_PLUGGABLE_MESSAGE_NEEDS_ADDRESSING_MODE)
00145     {
00146       // Not sure when we will use this.
00147       output.write_ulong (TAO_GIOP_LOC_NEEDS_ADDRESSING_MODE);
00148     }
00149   else
00150     {
00151       this->marshal_reply_status (output,
00152                                   reply);
00153     }
00154 
00155 #if (TAO_HAS_MINIMUM_CORBA == 1)
00156   output << reply.service_context_notowned ();
00157 #else
00158   if (reply.is_dsi_ == 0)
00159     {
00160       output << reply.service_context_notowned ();
00161     }
00162   else
00163     {
00164       IOP::ServiceContextList &svc_ctx =
00165         reply.service_context_notowned ();
00166       CORBA::ULong l = svc_ctx.length ();
00167 
00168       // Now marshal the rest of the service context objects
00169       output << l;
00170 
00171       for (CORBA::ULong i = 0; i != l; ++i)
00172         {
00173           output << svc_ctx[i];
00174         }
00175 
00176     }
00177 #endif /*TAO_HAS_MINIMUM_CORBA */
00178 
00179   if (reply.argument_flag_)
00180     {
00181       // If we have some data to be marshalled, then we align the
00182       // pointer to a 8 byte boundary.  Else, we just leave it throu
00183       if (output.align_write_ptr (TAO_GIOP_MESSAGE_ALIGN_PTR) == -1)
00184         {
00185           return 0;
00186         }
00187     }
00188   return 1;
00189 }

int TAO_GIOP_Message_Generator_Parser_12::write_request_header const TAO_Operation_Details   opdetails,
TAO_Target_Specification   spec,
TAO_OutputCDR   msg
[virtual]
 

Write the request header in to <msg>.

Implements TAO_GIOP_Message_Generator_Parser.

Definition at line 31 of file GIOP_Message_Generator_Parser_12.cpp.

References ACE_OutputCDR::align_write_ptr, TAO_Operation_Details::argument_flag, marshall_target_spec, CORBA::Octet, TAO_Operation_Details::opname, TAO_Operation_Details::opname_len, TAO_Operation_Details::request_id, TAO_Operation_Details::request_service_info, TAO_Operation_Details::response_flags, TAO_GIOP_MESSAGE_ALIGN_PTR, TAO_TWOWAY_RESPONSE_FLAG, ACE_OutputCDR::write_octet_array, and ACE_OutputCDR::write_string.

00036 {
00037   // First the request id
00038   msg << opdetails.request_id ();
00039 
00040   const CORBA::Octet response_flags = opdetails.response_flags ();
00041 
00042   // Here are the Octet values for different policies
00043   // '00000000' for SYNC_NONE
00044   // '00000000' for SYNC_WITH_TRANSPORT
00045   // '00000010' for SYNC_WITH_SERVER
00046   // '00000011' for SYNC_WITH_TARGET
00047   // '00000011' for regular two ways, but if they are invoked via a
00048   // DII with INV_NO_RESPONSE flag set then we need to send '00000001'
00049   //
00050   // We have not implemented the policy INV_NO_RESPONSE for DII.
00051   if (response_flags == TAO_TWOWAY_RESPONSE_FLAG)
00052     msg << CORBA::Any::from_octet (3);
00053   // Second the response flags
00054   // Sync scope - ignored by server if request is not oneway.
00055   else if (response_flags == CORBA::Octet (Messaging::SYNC_NONE)
00056            || response_flags == CORBA::Octet (Messaging::SYNC_WITH_TRANSPORT)
00057            || response_flags == CORBA::Octet (TAO::SYNC_EAGER_BUFFERING)
00058            || response_flags == CORBA::Octet (TAO::SYNC_DELAYED_BUFFERING))
00059     // No response required.
00060     msg << CORBA::Any::from_octet (0);
00061 
00062   else if (response_flags == CORBA::Octet (Messaging::SYNC_WITH_SERVER))
00063     // Return before dispatching to the servant
00064     msg << CORBA::Any::from_octet (1);
00065 
00066   else if (response_flags == CORBA::Octet (Messaging::SYNC_WITH_TARGET))
00067     // Return after dispatching servant.
00068     msg << CORBA::Any::from_octet (3);
00069   else
00070     // Until more flags are defined by the OMG.
00071     return 0;
00072 
00073   // The reserved field
00074   CORBA::Octet reserved[3] = {0, 0, 0};
00075 
00076   msg.write_octet_array (reserved, 3);
00077 
00078   if (this->marshall_target_spec (spec,
00079                                   msg) == 0)
00080     return 0;
00081 
00082   // Write the operation name
00083   msg.write_string (opdetails.opname_len (),
00084                     opdetails.opname ());
00085 
00086   // Write the service context list
00087   msg << opdetails.request_service_info ();
00088 
00089   // We align the pointer only if the operation has arguments.
00090   if (opdetails.argument_flag ()
00091       && msg.align_write_ptr (TAO_GIOP_MESSAGE_ALIGN_PTR) == -1)
00092     {
00093       return 0;
00094     }
00095 
00096   return 1;
00097 }


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 15:16:51 2003 for TAO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002