GIOP_Message_Generator_Parser.cpp

Go to the documentation of this file.
00001 // $Id: GIOP_Message_Generator_Parser.cpp 79705 2007-09-24 07:45:37Z johnnyw $
00002 
00003 #include "tao/GIOP_Message_Generator_Parser.h"
00004 #include "tao/Pluggable_Messaging_Utils.h"
00005 #include "tao/GIOP_Utils.h"
00006 #include "tao/debug.h"
00007 #include "tao/CDR.h"
00008 #include "ace/Log_Msg.h"
00009 
00010 
00011 ACE_RCSID (tao,
00012            GIOP_Message_Gen_Parser,
00013            "$Id: GIOP_Message_Generator_Parser.cpp 79705 2007-09-24 07:45:37Z johnnyw $")
00014 
00015 
00016 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00017 
00018 TAO_GIOP_Message_Generator_Parser::~TAO_GIOP_Message_Generator_Parser (void)
00019 {
00020 }
00021 
00022 int
00023 TAO_GIOP_Message_Generator_Parser::parse_reply (
00024     TAO_InputCDR &stream,
00025     TAO_Pluggable_Reply_Params &params)
00026 {
00027   // Read the request id
00028   if (!stream.read_ulong (params.request_id_))
00029     {
00030       if (TAO_debug_level)
00031         {
00032           ACE_ERROR ((LM_ERROR,
00033                       ACE_TEXT ("TAO (%P|%t) : TAO_GIOP_Message_Generator_Parser::parse_reply :")
00034                       ACE_TEXT ("extracting request id\n")));
00035         }
00036       return -1;
00037     }
00038 
00039   // and the reply status type.  status can be NO_EXCEPTION,
00040   // SYSTEM_EXCEPTION, USER_EXCEPTION, LOCATION_FORWARD,
00041   // LOCATION_FORWARD_PERM
00042   CORBA::ULong rep_stat = 0;
00043   if (!stream.read_ulong (rep_stat))
00044     {
00045       if (TAO_debug_level > 0)
00046         {
00047           ACE_ERROR ((LM_ERROR,
00048                       ACE_TEXT ("TAO (%P|%t) : TAO_GIOP_Message_Generator_Parser::parse_reply, ")
00049                       ACE_TEXT ("extracting reply status\n")));
00050         }
00051       return -1;
00052     }
00053 
00054   params.reply_status (static_cast <GIOP::ReplyStatusType> (rep_stat));
00055 
00056   return 0;
00057 }
00058 
00059 
00060 int
00061 TAO_GIOP_Message_Generator_Parser::parse_locate_reply (
00062     TAO_InputCDR &cdr,
00063     TAO_Pluggable_Reply_Params &params)
00064 {
00065   // Read the request id
00066   if (!cdr.read_ulong (params.request_id_))
00067     {
00068       if (TAO_debug_level > 0)
00069         ACE_ERROR ((LM_ERROR,
00070                     ACE_TEXT ("TAO (%P|%t|%N|%l):parse_locate_reply, ")
00071                     ACE_TEXT ("extracting request id\n")));
00072 
00073       return -1;
00074     }
00075 
00076   // and the locate reply status type.  status can be UNKNOWN_OBJECT,
00077   // OBJECT_HERE, OBJECT_FORWARD, OBJECT_FORWARD_PERM
00078   // LOC_SYSTEM_EXCEPTION, LOC_NEEDS_ADDRESSING_MODE
00079 
00080   // Please note here that we are NOT converting to the Pluggable
00081   // messaging layer exception as this is GIOP specific. Not many
00082   // messaging protocols have the locate_* messages.
00083   CORBA::ULong locate_reply_status;
00084   if (!cdr.read_ulong (locate_reply_status))
00085     {
00086       if (TAO_debug_level > 0)
00087         ACE_ERROR ((LM_ERROR,
00088                     ACE_TEXT ("TAO N|(%P|%t|l) parse_locate_reply, ")
00089                     ACE_TEXT ("extracting locate reply status\n")));
00090 
00091       return -1;
00092     }
00093   params.locate_reply_status (static_cast <GIOP::LocateStatusType> (locate_reply_status));
00094 
00095   return 0;
00096 
00097 }
00098 
00099 bool
00100 TAO_GIOP_Message_Generator_Parser::is_ready_for_bidirectional (void) const
00101 {
00102   return false;
00103 }
00104 
00105 TAO_END_VERSIONED_NAMESPACE_DECL

Generated on Tue Feb 2 17:37:52 2010 for TAO by  doxygen 1.4.7