TAO_DII_Arguments_Converter_Impl Class Reference

TAO_DII_Arguments_Converter_Impl. More...

#include <DII_Arguments_Converter_Impl.h>

List of all members.

Public Member Functions

virtual void convert_request (TAO_ServerRequest &server_request, TAO::Argument *const args[], size_t nargs)
virtual void convert_reply (TAO_ServerRequest &server_request, TAO::Argument *const args[], size_t nargs)
virtual void handle_corba_exception (TAO_ServerRequest &server_request, CORBA::Exception *exception)

Static Public Member Functions

int Initializer (void)


Detailed Description

TAO_DII_Arguments_Converter_Impl.

This class provides the implementation to expand the DII arguments in NVList to the list of arguments.

Definition at line 40 of file DII_Arguments_Converter_Impl.h.


Member Function Documentation

void TAO_DII_Arguments_Converter_Impl::convert_reply TAO_ServerRequest server_request,
TAO::Argument *const  args[],
size_t  nargs
[virtual]
 

Definition at line 78 of file DII_Arguments_Converter_Impl.cpp.

00082 {
00083 }

TAO_BEGIN_VERSIONED_NAMESPACE_DECL void TAO_DII_Arguments_Converter_Impl::convert_request TAO_ServerRequest server_request,
TAO::Argument *const  args[],
size_t  nargs
[virtual]
 

Definition at line 16 of file DII_Arguments_Converter_Impl.cpp.

References TAO_Operation_Details::args(), TAO::Argument::demarshal(), TAO_ServerRequest::operation_details(), and TAO_Operation_Details::use_stub_args().

00020 {
00021   // The DII requests on client side always have two arguments
00022   // - one is the return argument and the other is NVList_Argument.
00023   // Since the argument list in the client side is used by server side
00024   // in collocation case and the server expects the list of arguments
00025   // and not the NVList_Argument, we need expand the NVList_Argument
00026   // to be list of Arguments.
00027 
00028   // Before expanding NVList_Argument logic was added, the
00029   // $TAO_ROOT/tests/DII_Collocated_Tests/run_test.pl should fail.
00030   // The servant will get incorrect "IN" parameter from the oneway
00031   // operation with single "IN" parameter and get access violation on
00032   // get_in_arg () from the oneway operation with multiple "IN"
00033   // parameters.
00034   CORBA::NVList_ptr lst
00035     = static_cast<TAO::NVList_Argument *> (
00036         server_request.operation_details ()->args()[1])->arg ();
00037 
00038   CORBA::ULong const sz = lst->count ();
00039 
00040   if (sz != nargs - 1)
00041     {
00042       throw ::CORBA::BAD_PARAM ();
00043     }
00044 
00045   // To avoid the use of extraction operators on CORBA::Any, we will
00046   // marshal the arguments in the NVList into an output cdr and then
00047   // demarshal them into the TAO::Argument array.
00048   TAO_OutputCDR output;
00049   for (CORBA::ULong i = 0; i < sz; ++i)
00050     {
00051       CORBA::NamedValue_ptr theitem = lst->item (i);
00052 
00053       if (!(theitem->value ()->impl ()->marshal_value (output)))
00054         {
00055           throw ::CORBA::BAD_PARAM ();
00056         }
00057     }
00058 
00059   TAO_InputCDR input (output);
00060   for (CORBA::ULong j = 0; j < sz; ++j)
00061     {
00062       if (!(args[j + 1]->demarshal (input)))
00063         {
00064           throw ::CORBA::BAD_PARAM ();
00065         }
00066     }
00067 
00068   TAO_Operation_Details* details
00069     = const_cast <TAO_Operation_Details*> (server_request.operation_details ());
00070 
00071   // The NVList_Argument in operation details is converted to skel
00072   // args, the invocation of the dii collocation requests should use
00073   // the skel args and not use the stub args.
00074   details->use_stub_args (false);
00075 }

void TAO_DII_Arguments_Converter_Impl::handle_corba_exception TAO_ServerRequest server_request,
CORBA::Exception exception
[virtual]
 

Definition at line 86 of file DII_Arguments_Converter_Impl.cpp.

References CORBA::Exception::_raise().

00089 {
00090   exception->_raise ();
00091 }

int TAO_DII_Arguments_Converter_Impl::Initializer void   )  [static]
 

Definition at line 98 of file DII_Arguments_Converter_Impl.cpp.

References ACE_Service_Config::process_directive().

00099 {
00100   return ACE_Service_Config::process_directive (
00101     ace_svc_desc_TAO_DII_Arguments_Converter_Impl);
00102 }


The documentation for this class was generated from the following files:
Generated on Sun Jan 27 13:37:45 2008 for TAO_DynamicInterface by doxygen 1.3.6