TAO::DII_Invocation_Adapter Class Reference

Generic interface for the DII invocation object visible. More...

#include <DII_Invocation_Adapter.h>

Inheritance diagram for TAO::DII_Invocation_Adapter:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 DII_Invocation_Adapter (CORBA::Object *target, Argument **args, int arg_number, const char *operation, size_t op_len, CORBA::ExceptionList *exception, CORBA::Request *r, Invocation_Mode mode=TAO_DII_INVOCATION)
virtual ~DII_Invocation_Adapter (void)
virtual void invoke (TAO::Exception_Data *ex, unsigned long ex_count)
 Invoke the target.

Protected Member Functions

virtual Invocation_Status invoke_twoway (TAO_Operation_Details &op, CORBA::Object_var &effective_target, Profile_Transport_Resolver &r, ACE_Time_Value *&max_wait_time)
virtual Invocation_Status invoke_collocated_i (TAO_Stub *stub, TAO_Operation_Details &details, CORBA::Object_var &effective_target, Collocation_Strategy strat)

Private Member Functions

 DII_Invocation_Adapter (void)
 Dont allow default initializations.
 DII_Invocation_Adapter (const DII_Invocation_Adapter &)
DII_Invocation_Adapteroperator= (const DII_Invocation_Adapter &)

Private Attributes

CORBA::ExceptionListexception_list_
CORBA::Requestrequest_
TAO::Exception_Data * ex_data_

Detailed Description

Generic interface for the DII invocation object visible.

Definition at line 58 of file DII_Invocation_Adapter.h.


Constructor & Destructor Documentation

TAO::DII_Invocation_Adapter::DII_Invocation_Adapter ( CORBA::Object target,
Argument **  args,
int  arg_number,
const char *  operation,
size_t  op_len,
CORBA::ExceptionList exception,
CORBA::Request r,
Invocation_Mode  mode = TAO_DII_INVOCATION 
)

Parameters:
target Points to the object on which this invocation is being invoked.
args Array of pointers to the argument list in the operation declaration. this includes the return, inout and out arguments.
arg_number Number of arguments in the above array. This is the number of elements in the above array.
operation The name of the operation being invoked.
op_len Number of characters in the operation name. This is an optimization which helps us to avoid calling strlen () while creating a message format.
mode Invocation mode. This information is also available in the IDL file and in the generated code.

Definition at line 30 of file DII_Invocation_Adapter.cpp.

00039     : Invocation_Adapter (target,
00040                           args,
00041                           arg_number,
00042                           operation,
00043                           op_len,
00044                           0, // Collocation Proxy broker pointer
00045                           TAO_TWOWAY_INVOCATION,
00046                           mode)
00047       , exception_list_ (excp)
00048       , request_ (r)
00049       , ex_data_ (0)
00050   {
00051   }

TAO::DII_Invocation_Adapter::~DII_Invocation_Adapter ( void   )  [virtual]

Definition at line 53 of file DII_Invocation_Adapter.cpp.

References ex_data_.

00054   {
00055     delete[] ex_data_;
00056   }

TAO::DII_Invocation_Adapter::DII_Invocation_Adapter ( void   )  [private]

Dont allow default initializations.

TAO::DII_Invocation_Adapter::DII_Invocation_Adapter ( const DII_Invocation_Adapter  )  [private]


Member Function Documentation

void TAO::DII_Invocation_Adapter::invoke ( TAO::Exception_Data *  ex,
unsigned long  ex_count 
) [virtual]

Invoke the target.

Reimplemented from TAO::Invocation_Adapter.

Definition at line 59 of file DII_Invocation_Adapter.cpp.

References ACE_NEW_THROW_EX, CORBA::ExceptionList::count(), ex_data_, and exception_list_.

00061   {
00062     // Convert DII exception list to a form the invocation can use
00063     // to filter raised user exceptions.
00064     ex_count = this->exception_list_->count ();
00065     ACE_NEW_THROW_EX (this->ex_data_,
00066                       TAO::Exception_Data[ex_count],
00067                       CORBA::NO_MEMORY ());
00068     for (unsigned long l=0; l<ex_count ;++l)
00069     {
00070       CORBA::TypeCode_var xtc = this->exception_list_->item (l);
00071       this->ex_data_[l].id = xtc->id ();
00072       this->ex_data_[l].alloc = 0;
00073 #if TAO_HAS_INTERCEPTORS == 1
00074       this->ex_data_[l].tc_ptr = xtc.in ();
00075 #endif
00076     }
00077 
00078     Invocation_Adapter::invoke (this->ex_data_, ex_count);
00079   }

Invocation_Status TAO::DII_Invocation_Adapter::invoke_collocated_i ( TAO_Stub stub,
TAO_Operation_Details details,
CORBA::Object_var effective_target,
Collocation_Strategy  strat 
) [protected, virtual]

Reimplemented from TAO::Invocation_Adapter.

Definition at line 82 of file DII_Invocation_Adapter.cpp.

References TAO_Operation_Details::cac(), and ACE_Dynamic_Service< TYPE >::instance().

00087   {
00088     TAO_DII_Arguments_Converter_Impl* dii_arguments_converter
00089       = ACE_Dynamic_Service<TAO_DII_Arguments_Converter_Impl>::instance (
00090         "DII_Arguments_Converter");
00091     details.cac (dii_arguments_converter);
00092 
00093     return Invocation_Adapter::invoke_collocated_i (stub,
00094                                                     details,
00095                                                     effective_target,
00096                                                     strat);
00097   }

Invocation_Status TAO::DII_Invocation_Adapter::invoke_twoway ( TAO_Operation_Details op,
CORBA::Object_var effective_target,
Profile_Transport_Resolver r,
ACE_Time_Value *&  max_wait_time 
) [protected, virtual]

Reimplemented from TAO::Invocation_Adapter.

Reimplemented in TAO::DII_Asynch_Invocation_Adapter.

Definition at line 100 of file DII_Invocation_Adapter.cpp.

References CORBA::Request::_tao_byte_order(), CORBA::SystemException::_tao_minor_code(), CORBA::COMPLETED_NO, TAO_Transport::messaging_object(), CORBA::OMGVMCID, TAO_GIOP_Message_Base::out_stream(), request_, ACE_OutputCDR::reset_byte_order(), TAO::Profile_Transport_Resolver::stub(), TAO::TAO_DII_INVOCATION, TAO::TAO_INVOKE_RESTART, TAO::TAO_TWOWAY_INVOCATION, TAO::Profile_Transport_Resolver::transport(), and TAO::VMCID.

00105   {
00106     // Simple sanity check
00107     if (this->mode_ != TAO_DII_INVOCATION ||
00108         this->type_ != TAO_TWOWAY_INVOCATION)
00109       {
00110         throw ::CORBA::INTERNAL (
00111           CORBA::SystemException::_tao_minor_code (
00112             TAO::VMCID,
00113             EINVAL),
00114           CORBA::COMPLETED_NO);
00115       }
00116 
00117     TAO_Transport* const transport = r.transport ();
00118 
00119     if (!transport)
00120       {
00121         // Way back, we failed to find a profile we could connect to.
00122         // We've come this far only so we reach the interception points
00123         // in case they can fix things. Time to bail....
00124         throw CORBA::TRANSIENT (CORBA::OMGVMCID | 2, CORBA::COMPLETED_NO);
00125       }
00126 
00127     transport->messaging_object ()->out_stream ().reset_byte_order (
00128         request_->_tao_byte_order ());
00129 
00130     TAO::DII_Invocation synch (this->target_,
00131                                r,
00132                                op,
00133                                this->exception_list_,
00134                                this->request_);
00135 
00136 
00137     Invocation_Status status = synch.remote_invocation (max_wait_time);
00138 
00139     if (status == TAO_INVOKE_RESTART &&                                                                                                                    
00140         (synch.reply_status () == GIOP::LOCATION_FORWARD ||                                                                                              
00141          synch.reply_status () == GIOP::LOCATION_FORWARD_PERM))
00142       {
00143         CORBA::Boolean const permanent_forward =
00144           (synch.reply_status () == GIOP::LOCATION_FORWARD_PERM);
00145 
00146         effective_target = synch.steal_forwarded_reference ();
00147 
00148         this->object_forwarded (effective_target,
00149                                 r.stub (),
00150                                 permanent_forward);
00151       }
00152     return status;
00153   }

DII_Invocation_Adapter& TAO::DII_Invocation_Adapter::operator= ( const DII_Invocation_Adapter  )  [private]


Member Data Documentation

TAO::Exception_Data* TAO::DII_Invocation_Adapter::ex_data_ [private]

Definition at line 119 of file DII_Invocation_Adapter.h.

Referenced by invoke(), and ~DII_Invocation_Adapter().

CORBA::ExceptionList* TAO::DII_Invocation_Adapter::exception_list_ [private]

Definition at line 115 of file DII_Invocation_Adapter.h.

Referenced by invoke().

CORBA::Request* TAO::DII_Invocation_Adapter::request_ [private]

Definition at line 117 of file DII_Invocation_Adapter.h.

Referenced by invoke_twoway().


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