TAO::DII_Invocation Class Reference

#include <DII_Invocation.h>

Inheritance diagram for TAO::DII_Invocation:

Inheritance graph
[legend]
Collaboration diagram for TAO::DII_Invocation:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 DII_Invocation (CORBA::Object_ptr otarget, Profile_Transport_Resolver &resolver, TAO_Operation_Details &detail, CORBA::ExceptionList *excp, CORBA::Request_ptr req, bool response_expected=true)
virtual Dynamic::ParameterList * arguments (void)
Invocation_Status remote_invocation (ACE_Time_Value *max_wait_time)
virtual Invocation_Status handle_user_exception (TAO_InputCDR &cdr)

Private Attributes

CORBA::ExceptionListexcp_list_
CORBA::Request_ptr host_
 Back pointer to the DII request that created us.

Friends

class DII_Invocation_Adapter

Detailed Description

Definition at line 43 of file DII_Invocation.h.


Constructor & Destructor Documentation

TAO::DII_Invocation::DII_Invocation ( CORBA::Object_ptr  otarget,
Profile_Transport_Resolver resolver,
TAO_Operation_Details detail,
CORBA::ExceptionList excp,
CORBA::Request_ptr  req,
bool  response_expected = true 
)

Definition at line 35 of file DII_Invocation.cpp.

00041     : Synch_Twoway_Invocation (otarget,
00042                                resolver,
00043                                detail,
00044                                response_expected)
00045       , excp_list_ (excp)
00046       , host_ (req)
00047   {
00048   }


Member Function Documentation

Dynamic::ParameterList * TAO::DII_Invocation::arguments ( void   )  [virtual]

Definition at line 52 of file DII_Invocation.cpp.

00053   {
00054     Dynamic::ParameterList_var safe_parameter_list;
00055 
00056     TAO::Argument ** const args = this->details_.args ();
00057 
00058     if (this->details_.args_num () > 1)
00059       {
00060         // Take the second argument since the first is a return value.
00061         TAO::NVList_Argument * const tmp_arg =
00062           dynamic_cast <TAO::NVList_Argument*> (args[1]);
00063 
00064         if (tmp_arg)
00065           {
00066             // Generate the argument list on demand.
00067             Dynamic::ParameterList * const parameter_list =
00068               TAO_RequestInfo_Util::make_parameter_list ();
00069 
00070             safe_parameter_list = parameter_list;
00071 
00072             tmp_arg->interceptor_paramlist (parameter_list);
00073           }
00074       }
00075 
00076     return safe_parameter_list._retn ();
00077   }

Invocation_Status TAO::DII_Invocation::handle_user_exception ( TAO_InputCDR cdr  )  [virtual]

Reimplemented from TAO::Synch_Twoway_Invocation.

Definition at line 87 of file DII_Invocation.cpp.

References ACE_DEBUG, ACE_NEW_RETURN, CORBA::COMPLETED_YES, CORBA::ExceptionList::count(), excp_list_, host_, ACE_Message_Block::length(), LM_DEBUG, CORBA::Request::raw_user_exception(), TAO::Reply_Guard::set_status(), ACE_InputCDR::start(), ACE_OS::strcmp(), TAO_debug_level, TAO::TAO_INVOKE_FAILURE, TAO::TAO_INVOKE_USER_EXCEPTION, and TAO::VMCID.

00088   {
00089     Reply_Guard mon (this, TAO_INVOKE_FAILURE);
00090 
00091     if (TAO_debug_level > 3)
00092       {
00093         ACE_DEBUG ((LM_DEBUG,
00094                     "TAO (%P|%t) - DII_Invocation::"
00095                     "handle_user_exception \n"));
00096       }
00097 
00098     // Match the exception interface repository id with the
00099     // exception in the exception list.
00100     // This is important to decode the exception.
00101     CORBA::String_var buf;
00102 
00103     TAO_InputCDR tmp_stream (cdr,
00104                              cdr.start ()->length (),
00105                              0);
00106 
00107     // Pull the exception ID out of the marshaling buffer.
00108     if (tmp_stream.read_string (buf.inout ()) == 0)
00109       {
00110         throw ::CORBA::MARSHAL (TAO::VMCID, CORBA::COMPLETED_YES);
00111       }
00112 
00113     for (CORBA::ULong i = 0;
00114          this->excp_list_ != 0 && i < this->excp_list_->count ();
00115          i++)
00116       {
00117           CORBA::TypeCode_var tc = this->excp_list_->item (i);
00118 
00119           const char *xid = tc->id ();
00120 
00121           if (ACE_OS::strcmp (buf.in (), xid) != 0)
00122             {
00123               continue;
00124             }
00125 
00126           CORBA::Any any;
00127           TAO::Unknown_IDL_Type *unk = 0;
00128           ACE_NEW_RETURN (unk,
00129                           TAO::Unknown_IDL_Type (
00130                               tc.in (),
00131                               cdr
00132                             ),
00133                           TAO_INVOKE_FAILURE);
00134 
00135           any.replace (unk);
00136 
00137           mon.set_status (TAO_INVOKE_USER_EXCEPTION);
00138 
00139           throw ::CORBA::UnknownUserException (any);
00140         }
00141 
00142     // If we couldn't find the right exception, report it as
00143     // CORBA::UNKNOWN.
00144 
00145     // But first, save the user exception in case we
00146     // are being used in a TAO gateway.
00147     this->host_->raw_user_exception (cdr);
00148 
00149     mon.set_status (TAO_INVOKE_USER_EXCEPTION);
00150 
00151     // @@ It would seem that if the remote exception is a
00152     //    UserException we can assume that the request was
00153     //    completed.
00154     throw ::CORBA::UNKNOWN (TAO::VMCID, CORBA::COMPLETED_YES);
00155 
00156   }

Invocation_Status TAO::DII_Invocation::remote_invocation ( ACE_Time_Value max_wait_time  ) 

Definition at line 81 of file DII_Invocation.cpp.

00082   {
00083     return Synch_Twoway_Invocation::remote_twoway (max_wait_time);
00084   }


Friends And Related Function Documentation

friend class DII_Invocation_Adapter [friend]

Definition at line 47 of file DII_Invocation.h.


Member Data Documentation

CORBA::ExceptionList* TAO::DII_Invocation::excp_list_ [private]

Definition at line 65 of file DII_Invocation.h.

Referenced by handle_user_exception().

CORBA::Request_ptr TAO::DII_Invocation::host_ [private]

Back pointer to the DII request that created us.

Definition at line 68 of file DII_Invocation.h.

Referenced by handle_user_exception().


The documentation for this class was generated from the following files:
Generated on Tue Feb 2 17:43:28 2010 for TAO_DynamicInterface by  doxygen 1.4.7