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 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 Methods

virtual int write_request_header (const TAO_Operation_Details &opdetails, TAO_Target_Specification &spec, TAO_OutputCDR &msg)=0
 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)=0
 Write the LocateRequest header. More...

virtual int write_reply_header (TAO_OutputCDR &output, TAO_Pluggable_Reply_Params_Base &reply ACE_ENV_ARG_DECL)=0 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)=0
 Writes the locate _reply message in to the <output>. More...

virtual int parse_request_header (TAO_ServerRequest &)=0
 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 &)=0
 Parse the Loacte Request 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 from the server. More...

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

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


Protected Methods

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


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 44 of file GIOP_Message_Generator_Parser.h.


Member Function Documentation

int TAO_GIOP_Message_Generator_Parser::is_ready_for_bidirectional void    [virtual]
 

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

Reimplemented in TAO_GIOP_Message_Generator_Parser_12.

Definition at line 136 of file GIOP_Message_Generator_Parser.cpp.

00137 {
00138   return 0;
00139 }

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

Our versions.

Implemented in TAO_GIOP_Message_Generator_Parser_10.

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 142 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.

00146 {
00147   switch (reply.reply_status_)
00148     {
00149     case TAO_PLUGGABLE_MESSAGE_NO_EXCEPTION:
00150       output.write_ulong (TAO_GIOP_NO_EXCEPTION);
00151       break;
00152     case TAO_PLUGGABLE_MESSAGE_LOCATION_FORWARD:
00153       output.write_ulong (TAO_GIOP_LOCATION_FORWARD);
00154       break;
00155     case TAO_PLUGGABLE_MESSAGE_SYSTEM_EXCEPTION:
00156       output.write_ulong (TAO_GIOP_SYSTEM_EXCEPTION);
00157       break;
00158     case TAO_PLUGGABLE_MESSAGE_USER_EXCEPTION:
00159       output.write_ulong (TAO_GIOP_USER_EXCEPTION);
00160       break;
00161     default:
00162       // Some other specific exception
00163       output.write_ulong (reply.reply_status_);
00164       break;
00165     }
00166 }

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

Implemented in TAO_GIOP_Message_Generator_Parser_10.

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.

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.

Definition at line 97 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_, and TAO_Pluggable_Reply_Params_Base::request_id_.

Referenced by TAO_GIOP_Message_Generator_Parser_12::parse_locate_reply, and TAO_GIOP_Message_Generator_Parser_10::parse_locate_reply.

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

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.

Definition at line 19 of file GIOP_Message_Generator_Parser.cpp.

References ACE_DEBUG, ACE_ERROR, ACE_TEXT, LM_DEBUG, LM_ERROR, ACE_InputCDR::read_ulong, TAO_Pluggable_Reply_Params_Base::reply_status_, TAO_Pluggable_Reply_Params_Base::request_id_, 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_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, and TAO_GIOP_Message_Generator_Parser_10::parse_reply.

00022 {
00023 
00024   // Read the request id
00025   if (!stream.read_ulong (params.request_id_))
00026     {
00027       if (TAO_debug_level)
00028         ACE_ERROR ((LM_ERROR,
00029                     ACE_TEXT ("TAO (%P|%t) : TAO_GIOP_Message_Generator_Parser::parse_reply, \n ")
00030                     ACE_TEXT ("extracting request id")));
00031     }
00032 
00033   // and the reply status type.  status can be NO_EXCEPTION,
00034   // SYSTEM_EXCEPTION, USER_EXCEPTION, LOCATION_FORWARD
00035 
00036   // Cannot handle LOCATION_FORWARD_PERM here
00037   CORBA::ULong rep_stat = 0;
00038   if (!stream.read_ulong (rep_stat))
00039     {
00040       if (TAO_debug_level > 0)
00041         ACE_ERROR ((LM_ERROR,
00042                     ACE_TEXT ("TAO (%P|%t) : TAO_GIOP_Message_Generator_Parser::parse_reply, \n ")
00043                     ACE_TEXT ("extracting reply status")));
00044       return -1;
00045     }
00046 
00047 
00048   // Pass the right Pluggable interface code to the transport layer
00049   switch (rep_stat)
00050     {
00051       // Request completed successfully
00052     case TAO_GIOP_NO_EXCEPTION:
00053       params.reply_status_ =
00054         TAO_PLUGGABLE_MESSAGE_NO_EXCEPTION;
00055       break;
00056 
00057       // Request terminated with user exception
00058     case TAO_GIOP_USER_EXCEPTION:
00059       params.reply_status_ =
00060         TAO_PLUGGABLE_MESSAGE_USER_EXCEPTION;
00061       break;
00062       // Request terminated with system exception
00063     case TAO_GIOP_SYSTEM_EXCEPTION:
00064       params.reply_status_ =
00065         TAO_PLUGGABLE_MESSAGE_SYSTEM_EXCEPTION;
00066       break;
00067       // Reply is a location forward type
00068     case TAO_GIOP_LOCATION_FORWARD:
00069       params.reply_status_ =
00070         TAO_PLUGGABLE_MESSAGE_LOCATION_FORWARD;
00071       break;
00072       // Reply is a location forward perm type
00073       // @@For the time being the behaviour of the
00074       // LOCATION_FORWARD_PERM would be similar to the
00075       // LOCATION_FORWARD as there is a controversy surrounding the
00076       // usage of this in the OMG.
00077     case TAO_GIOP_LOCATION_FORWARD_PERM:
00078       params.reply_status_ =
00079         TAO_PLUGGABLE_MESSAGE_LOCATION_FORWARD;
00080       break;
00081       // Reply is a location forward type
00082     case TAO_GIOP_NEEDS_ADDRESSING_MODE:
00083       params.reply_status_ =
00084         TAO_PLUGGABLE_MESSAGE_NEEDS_ADDRESSING_MODE;
00085       break;
00086     default:
00087       if (TAO_debug_level > 0)
00088         ACE_DEBUG ((LM_DEBUG,
00089                     ACE_TEXT ("(%N|%l) Unknown reply status \n")));
00090     }
00091 
00092   return 0;
00093 }

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.

virtual int 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.

virtual int 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.

Referenced by TAO_GIOP_Message_Base::generate_locate_request_header.

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

Write the reply header in to <output>.

Implemented in TAO_GIOP_Message_Generator_Parser_10.

Referenced by TAO_GIOP_Message_Base::generate_reply_header.

virtual int 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.

Referenced by TAO_GIOP_Message_Base::generate_request_header.


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