TAO_GIOP_Message_Generator_Parser Class Reference

Base class for the GIOP Message generator and parser. More...

#include <GIOP_Message_Generator_Parser.h>

Inheritance diagram for TAO_GIOP_Message_Generator_Parser:

Inheritance graph
[legend]
List of all members.

Public Member Functions

virtual ~TAO_GIOP_Message_Generator_Parser (void)
virtual bool write_request_header (const TAO_Operation_Details &opdetails, TAO_Target_Specification &spec, TAO_OutputCDR &msg)=0
 Write the request header in to msg.

virtual bool write_locate_request_header (CORBA::ULong request_id, TAO_Target_Specification &spec, TAO_OutputCDR &msg)=0
 Write the LocateRequest header.

virtual bool write_reply_header (TAO_OutputCDR &output, TAO_Pluggable_Reply_Params_Base &reply)=0
 Write the reply header in to output.

virtual bool write_locate_reply_mesg (TAO_OutputCDR &output, CORBA::ULong request_id, TAO_GIOP_Locate_Status_Msg &status)=0
 Writes the locate _reply message in to the output.

virtual bool write_fragment_header (TAO_OutputCDR &cdr, CORBA::ULong request_id)=0
virtual int parse_request_header (TAO_ServerRequest &)=0
virtual int parse_locate_header (TAO_GIOP_Locate_Request_Header &)=0
virtual int parse_reply (TAO_InputCDR &input, TAO_Pluggable_Reply_Params &params)
 Parse the reply message.

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

virtual CORBA::Octet major_version (void) const=0
 Our versions.

virtual CORBA::Octet minor_version (void) const=0
virtual bool is_ready_for_bidirectional (void) const
virtual size_t fragment_header_length (void) const=0
 The header length of a fragment.


Protected Member Functions

void marshal_reply_status (TAO_OutputCDR &output, TAO_Pluggable_Reply_Params_Base &reply)
 Marshall the reply status.


Detailed Description

Base class for the GIOP Message generator and parser.

Version specific classes would inherit from this class. Strategy to determine which version of the GIOP request have we received and which version do we need to use to send messages.

Definition at line 48 of file GIOP_Message_Generator_Parser.h.


Constructor & Destructor Documentation

TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_GIOP_Message_Generator_Parser::~TAO_GIOP_Message_Generator_Parser void   )  [virtual]
 

Definition at line 18 of file GIOP_Message_Generator_Parser.cpp.

00019 {
00020 }


Member Function Documentation

virtual size_t TAO_GIOP_Message_Generator_Parser::fragment_header_length void   )  const [pure virtual]
 

The header length of a fragment.

Implemented in TAO_GIOP_Message_Generator_Parser_10, and TAO_GIOP_Message_Generator_Parser_12.

Referenced by TAO_GIOP_Message_Base::fragment_header_length().

bool TAO_GIOP_Message_Generator_Parser::is_ready_for_bidirectional void   )  const [virtual]
 

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

Reimplemented in TAO_GIOP_Message_Generator_Parser_12.

Definition at line 145 of file GIOP_Message_Generator_Parser.cpp.

Referenced by TAO_GIOP_Message_Base::is_ready_for_bidirectional().

00146 {
00147   return false;
00148 }

virtual CORBA::Octet TAO_GIOP_Message_Generator_Parser::major_version void   )  const [pure virtual]
 

Our versions.

Implemented in TAO_GIOP_Message_Generator_Parser_10, and TAO_GIOP_Message_Generator_Parser_12.

void TAO_GIOP_Message_Generator_Parser::marshal_reply_status TAO_OutputCDR output,
TAO_Pluggable_Reply_Params_Base reply
[protected]
 

Marshall the reply status.

Definition at line 151 of file GIOP_Message_Generator_Parser.cpp.

References TAO_Pluggable_Reply_Params_Base::reply_status_, TAO_GIOP_LOCATION_FORWARD, TAO_GIOP_NO_EXCEPTION, TAO_GIOP_SYSTEM_EXCEPTION, TAO_GIOP_USER_EXCEPTION, TAO_PLUGGABLE_MESSAGE_LOCATION_FORWARD, TAO_PLUGGABLE_MESSAGE_NO_EXCEPTION, TAO_PLUGGABLE_MESSAGE_SYSTEM_EXCEPTION, TAO_PLUGGABLE_MESSAGE_USER_EXCEPTION, and ACE_OutputCDR::write_ulong().

Referenced by TAO_GIOP_Message_Generator_Parser_12::write_reply_header(), and TAO_GIOP_Message_Generator_Parser_10::write_reply_header().

00154 {
00155   switch (reply.reply_status_)
00156     {
00157     case TAO_PLUGGABLE_MESSAGE_NO_EXCEPTION:
00158       output.write_ulong (TAO_GIOP_NO_EXCEPTION);
00159       break;
00160     case TAO_PLUGGABLE_MESSAGE_LOCATION_FORWARD:
00161       output.write_ulong (TAO_GIOP_LOCATION_FORWARD);
00162       break;
00163     case TAO_PLUGGABLE_MESSAGE_SYSTEM_EXCEPTION:
00164       output.write_ulong (TAO_GIOP_SYSTEM_EXCEPTION);
00165       break;
00166     case TAO_PLUGGABLE_MESSAGE_USER_EXCEPTION:
00167       output.write_ulong (TAO_GIOP_USER_EXCEPTION);
00168       break;
00169     default:
00170       // Some other specific exception
00171       output.write_ulong (reply.reply_status_);
00172       break;
00173     }
00174 }

virtual CORBA::Octet TAO_GIOP_Message_Generator_Parser::minor_version void   )  const [pure virtual]
 

Implemented in TAO_GIOP_Message_Generator_Parser_10, TAO_GIOP_Message_Generator_Parser_11, and TAO_GIOP_Message_Generator_Parser_12.

virtual int TAO_GIOP_Message_Generator_Parser::parse_locate_header TAO_GIOP_Locate_Request_Header  )  [pure virtual]
 

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

Implemented in TAO_GIOP_Message_Generator_Parser_10, and TAO_GIOP_Message_Generator_Parser_12.

Referenced by TAO_GIOP_Message_Base::process_locate_request().

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

Parse the locate reply message from the server.

Reimplemented in TAO_GIOP_Message_Generator_Parser_10, and TAO_GIOP_Message_Generator_Parser_12.

Definition at line 108 of file GIOP_Message_Generator_Parser.cpp.

References ACE_ERROR, ACE_TEXT, LM_ERROR, ACE_InputCDR::read_ulong(), TAO_Pluggable_Reply_Params_Base::reply_status_, TAO_Pluggable_Reply_Params_Base::request_id_, and TAO_debug_level.

Referenced by TAO_GIOP_Message_Generator_Parser_12::parse_locate_reply(), TAO_GIOP_Message_Generator_Parser_10::parse_locate_reply(), and TAO_GIOP_Message_Base::process_reply_message().

00111 {
00112   // Read the request id
00113   if (!cdr.read_ulong (params.request_id_))
00114     {
00115       if (TAO_debug_level > 0)
00116         ACE_ERROR ((LM_ERROR,
00117                     ACE_TEXT ("TAO (%P|%t|%N|%l):parse_locate_reply, ")
00118                     ACE_TEXT ("extracting request id\n")));
00119 
00120       return -1;
00121     }
00122 
00123   // and the reply status type.  status can be NO_EXCEPTION,
00124   // SYSTEM_EXCEPTION, USER_EXCEPTION, LOCATION_FORWARD
00125   // LOCATION_FORWARD_PERM
00126 
00127   // Please note here that we are NOT converting to the Pluggable
00128   // messaging layer exception as this is GIOP specific. Not many
00129   // messaging protocols have the locate_* messages.
00130   if (!cdr.read_ulong (params.reply_status_))
00131     {
00132       if (TAO_debug_level > 0)
00133         ACE_ERROR ((LM_ERROR,
00134                     ACE_TEXT ("TAO N|(%P|%t|l) parse_locate_reply, ")
00135                     ACE_TEXT ("extracting reply  status\n")));
00136 
00137       return -1;
00138     }
00139 
00140   return 0;
00141 
00142 }

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

Parse the reply message.

Reimplemented in TAO_GIOP_Message_Generator_Parser_10, and TAO_GIOP_Message_Generator_Parser_12.

Definition at line 23 of file GIOP_Message_Generator_Parser.cpp.

References ACE_ERROR, ACE_TEXT, LM_ERROR, ACE_InputCDR::read_ulong(), TAO_Pluggable_Reply_Params_Base::reply_status_, TAO_Pluggable_Reply_Params_Base::request_id_, TAO_debug_level, TAO_GIOP_LOCATION_FORWARD, TAO_GIOP_LOCATION_FORWARD_PERM, TAO_GIOP_NEEDS_ADDRESSING_MODE, TAO_GIOP_NO_EXCEPTION, TAO_GIOP_SYSTEM_EXCEPTION, TAO_GIOP_USER_EXCEPTION, TAO_PLUGGABLE_MESSAGE_LOCATION_FORWARD, TAO_PLUGGABLE_MESSAGE_LOCATION_FORWARD_PERM, TAO_PLUGGABLE_MESSAGE_NEEDS_ADDRESSING_MODE, TAO_PLUGGABLE_MESSAGE_NO_EXCEPTION, TAO_PLUGGABLE_MESSAGE_SYSTEM_EXCEPTION, and TAO_PLUGGABLE_MESSAGE_USER_EXCEPTION.

Referenced by TAO_GIOP_Message_Generator_Parser_12::parse_reply(), TAO_GIOP_Message_Generator_Parser_10::parse_reply(), and TAO_GIOP_Message_Base::process_reply_message().

00026 {
00027 
00028   // Read the request id
00029   if (!stream.read_ulong (params.request_id_))
00030     {
00031       if (TAO_debug_level)
00032         {
00033           ACE_ERROR ((LM_ERROR,
00034                       ACE_TEXT ("TAO (%P|%t) : TAO_GIOP_Message_Generator_Parser::parse_reply :")
00035                       ACE_TEXT ("extracting request id\n")));
00036         }
00037       return -1;
00038     }
00039 
00040   // and the reply status type.  status can be NO_EXCEPTION,
00041   // SYSTEM_EXCEPTION, USER_EXCEPTION, LOCATION_FORWARD,
00042   // LOCATION_FORWARD_PERM
00043   CORBA::ULong rep_stat = 0;
00044   if (!stream.read_ulong (rep_stat))
00045     {
00046       if (TAO_debug_level > 0)
00047         {
00048           ACE_ERROR ((LM_ERROR,
00049                       ACE_TEXT ("TAO (%P|%t) : TAO_GIOP_Message_Generator_Parser::parse_reply, ")
00050                       ACE_TEXT ("extracting reply status\n")));
00051         }
00052       return -1;
00053     }
00054 
00055 
00056   // Pass the right Pluggable interface code to the transport layer
00057   switch (rep_stat)
00058     {
00059       // Request completed successfully
00060     case TAO_GIOP_NO_EXCEPTION:
00061       params.reply_status_ =
00062         TAO_PLUGGABLE_MESSAGE_NO_EXCEPTION;
00063       break;
00064 
00065       // Request terminated with user exception
00066     case TAO_GIOP_USER_EXCEPTION:
00067       params.reply_status_ =
00068         TAO_PLUGGABLE_MESSAGE_USER_EXCEPTION;
00069       break;
00070       // Request terminated with system exception
00071     case TAO_GIOP_SYSTEM_EXCEPTION:
00072       params.reply_status_ =
00073         TAO_PLUGGABLE_MESSAGE_SYSTEM_EXCEPTION;
00074       break;
00075       // Reply is a location forward type
00076     case TAO_GIOP_LOCATION_FORWARD:
00077       params.reply_status_ =
00078         TAO_PLUGGABLE_MESSAGE_LOCATION_FORWARD;
00079       break;
00080       // Reply is a location forward perm type
00081      // LOCATION_FORWARD_PERM is only allowed in context of
00082      // FaultTolerant featured requests and requires PortableGroup
00083      // features in forwarded object and service context
00084     case TAO_GIOP_LOCATION_FORWARD_PERM:
00085       params.reply_status_ =
00086         TAO_PLUGGABLE_MESSAGE_LOCATION_FORWARD_PERM;
00087       break;
00088       // Reply is a location forward type
00089     case TAO_GIOP_NEEDS_ADDRESSING_MODE:
00090       params.reply_status_ =
00091         TAO_PLUGGABLE_MESSAGE_NEEDS_ADDRESSING_MODE;
00092       break;
00093     default:
00094       if (TAO_debug_level > 0)
00095         {
00096           ACE_ERROR ((LM_ERROR,
00097                       ACE_TEXT ("TAO (%P|%t) : TAO_GIOP_Message_Generator_Parser::parse_reply, ")
00098                       ACE_TEXT ("Unknown reply status \n")));
00099         }
00100       return -1;
00101     }
00102 
00103   return 0;
00104 }

virtual int TAO_GIOP_Message_Generator_Parser::parse_request_header TAO_ServerRequest  )  [pure virtual]
 

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

Implemented in TAO_GIOP_Message_Generator_Parser_10, and TAO_GIOP_Message_Generator_Parser_12.

Referenced by TAO_GIOP_Message_Base::process_request().

virtual bool TAO_GIOP_Message_Generator_Parser::write_fragment_header TAO_OutputCDR cdr,
CORBA::ULong  request_id
[pure virtual]
 

Write the GIOP fragment message header to the output CDR stream cdr.

Implemented in TAO_GIOP_Message_Generator_Parser_10, and TAO_GIOP_Message_Generator_Parser_12.

Referenced by TAO_GIOP_Message_Base::generate_fragment_header().

virtual bool TAO_GIOP_Message_Generator_Parser::write_locate_reply_mesg TAO_OutputCDR output,
CORBA::ULong  request_id,
TAO_GIOP_Locate_Status_Msg status
[pure virtual]
 

Writes the locate _reply message in to the output.

Implemented in TAO_GIOP_Message_Generator_Parser_10, and TAO_GIOP_Message_Generator_Parser_12.

Referenced by TAO_GIOP_Message_Base::make_send_locate_reply().

virtual bool TAO_GIOP_Message_Generator_Parser::write_locate_request_header CORBA::ULong  request_id,
TAO_Target_Specification spec,
TAO_OutputCDR msg
[pure virtual]
 

Write the LocateRequest header.

Implemented in TAO_GIOP_Message_Generator_Parser_10, and TAO_GIOP_Message_Generator_Parser_12.

Referenced by TAO_GIOP_Message_Base::generate_locate_request_header().

virtual bool TAO_GIOP_Message_Generator_Parser::write_reply_header TAO_OutputCDR output,
TAO_Pluggable_Reply_Params_Base reply
[pure virtual]
 

Write the reply header in to output.

Implemented in TAO_GIOP_Message_Generator_Parser_10, and TAO_GIOP_Message_Generator_Parser_12.

Referenced by TAO_GIOP_Message_Base::generate_reply_header().

virtual bool TAO_GIOP_Message_Generator_Parser::write_request_header const TAO_Operation_Details opdetails,
TAO_Target_Specification spec,
TAO_OutputCDR msg
[pure virtual]
 

Write the request header in to msg.

Implemented in TAO_GIOP_Message_Generator_Parser_10, and TAO_GIOP_Message_Generator_Parser_12.

Referenced by TAO_GIOP_Message_Base::generate_request_header().


The documentation for this class was generated from the following files:
Generated on Sun Jan 27 13:14:44 2008 for TAO by doxygen 1.3.6