DII_Invocation_Adapter.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    DII_Invocation_Adapter.h
00006  *
00007  *  $Id: DII_Invocation_Adapter.h 80380 2008-01-07 13:11:49Z mcorino $
00008  *
00009  *  @author Balachandran Natarajan <bala@dre.vanderbilt.edu>
00010  */
00011 //=============================================================================
00012 #ifndef TAO_DII_INVOCATION_ADAPTER_H
00013 #define TAO_DII_INVOCATION_ADAPTER_H
00014 #include /**/ "ace/pre.h"
00015 
00016 #include "tao/DynamicInterface/dynamicinterface_export.h"
00017 
00018 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00019 # pragma once
00020 #endif /* ACE_LACKS_PRAGMA_ONCE */
00021 
00022 
00023 #include "tao/Invocation_Adapter.h"
00024 
00025 #if defined (TAO_HAS_AMI)
00026 #include "tao/Messaging/Messaging.h"
00027 #endif /* TAO_HAS_AMI */
00028 
00029 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00030 class ACE_Time_Value;
00031 ACE_END_VERSIONED_NAMESPACE_DECL
00032 
00033 
00034 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00035 class TAO_Operation_Details;
00036 class TAO_Stub;
00037 class TAO_ORB_Core;
00038 class TAO_DII_Deferred_Reply_Dispatcher;
00039 class TAO_DII_Asynch_Reply_Dispatcher;
00040 namespace  CORBA
00041 {
00042   class Object;
00043   class ExceptionList;
00044   class Request;
00045 }
00046 
00047 namespace TAO
00048 {
00049   class Argument;
00050   class Collocation_Proxy_Broker;
00051   struct Exception_Data;
00052 
00053   /**
00054    * @class DII_Invocation_Adapter
00055    *
00056    * @brief Generic interface for the DII invocation object visible
00057    */
00058   class TAO_DynamicInterface_Export DII_Invocation_Adapter :
00059     public Invocation_Adapter
00060   {
00061   public:
00062     /// The only constructor used by the IDL compiler and only way to
00063     /// create this adapter.
00064     /**
00065      *
00066      * @param target Points to the object on which this invocation is
00067      * being invoked.
00068      *
00069      * @param args Array of pointers to the argument list in the
00070      * operation declaration. this includes the return, inout and out
00071      * arguments.
00072      *
00073      * @param arg_number Number of arguments in the above array. This
00074      * is the number of elements in the above array.
00075      *
00076      * @param operation The name of the operation being invoked.
00077      *
00078      * @param op_len Number of characters in the operation name. This
00079      * is an optimization which helps us to avoid calling strlen ()
00080      * while creating a message format.
00081      *
00082      * @param mode Invocation mode. This information is also available
00083      * in the IDL file and in the generated code.
00084      */
00085     DII_Invocation_Adapter (CORBA::Object *target,
00086                             Argument **args,
00087                             int arg_number,
00088                             const char *operation,
00089                             size_t op_len,
00090                             CORBA::ExceptionList *exception,
00091                             CORBA::Request *r,
00092                             Invocation_Mode mode = TAO_DII_INVOCATION);
00093 
00094     virtual ~DII_Invocation_Adapter (void);
00095 
00096     /// Invoke the target
00097     virtual void invoke (TAO::Exception_Data *ex, unsigned long ex_count);
00098 
00099   protected:
00100 
00101     virtual Invocation_Status invoke_twoway (
00102         TAO_Operation_Details &op,
00103         CORBA::Object_var &effective_target,
00104         Profile_Transport_Resolver &r,
00105         ACE_Time_Value *&max_wait_time);
00106 
00107     virtual Invocation_Status invoke_collocated_i (
00108         TAO_Stub *stub,
00109         TAO_Operation_Details &details,
00110         CORBA::Object_var &effective_target,
00111         Collocation_Strategy strat);
00112 
00113   private:
00114 
00115     CORBA::ExceptionList *exception_list_;
00116 
00117     CORBA::Request *request_;
00118 
00119     TAO::Exception_Data *ex_data_;
00120   private:
00121 
00122     /// Dont allow default initializations
00123     DII_Invocation_Adapter (void);
00124 
00125     DII_Invocation_Adapter (const DII_Invocation_Adapter &);
00126     DII_Invocation_Adapter & operator= (const DII_Invocation_Adapter &);
00127   };
00128 
00129   /**
00130    * @class  DII_Deferred_Invocation_Adapter
00131    *
00132    * @brief This class is for deferred DII invocation.
00133    */
00134   class TAO_DynamicInterface_Export DII_Deferred_Invocation_Adapter
00135     : protected Invocation_Adapter
00136   {
00137   public:
00138     DII_Deferred_Invocation_Adapter (
00139         CORBA::Object *target,
00140         Argument **args,
00141         int arg_number,
00142         const char *operation,
00143         size_t op_len,
00144         Collocation_Proxy_Broker *b,
00145         TAO_ORB_Core *oc,
00146         CORBA::Request *req,
00147         TAO::Invocation_Mode mode = TAO_DII_DEFERRED_INVOCATION);
00148 
00149     /// Invoke the target
00150     virtual void invoke (TAO::Exception_Data *ex, unsigned long ex_count);
00151 
00152   protected:
00153     virtual Invocation_Status invoke_twoway (
00154         TAO_Operation_Details &op,
00155         CORBA::Object_var &effective_target,
00156         Profile_Transport_Resolver &r,
00157         ACE_Time_Value *&max_wait_time);
00158 
00159     virtual Invocation_Status invoke_collocated_i (
00160         TAO_Stub *stub,
00161         TAO_Operation_Details &details,
00162         CORBA::Object_var &effective_target,
00163         Collocation_Strategy strat);
00164 
00165   private:
00166     CORBA::Request *request_;
00167 
00168     /// Reply dispatcher for the current Invocation.
00169     TAO_DII_Deferred_Reply_Dispatcher *rd_;
00170 
00171     /// Cache the orb_core
00172     TAO_ORB_Core * const orb_core_;
00173   };
00174 
00175 #if defined (TAO_HAS_AMI)
00176   /**
00177    * @class  DII_Asynch_Invocation_Adapter
00178    *
00179    * @brief This class is for asynchronous DII invocation.
00180    */
00181   class TAO_DynamicInterface_Export DII_Asynch_Invocation_Adapter
00182     : protected DII_Invocation_Adapter
00183   {
00184   public:
00185     DII_Asynch_Invocation_Adapter (
00186        CORBA::Object *target,
00187        Argument **args,
00188        int arg_number,
00189        const char *operation,
00190        int op_len,
00191        CORBA::Request *req,
00192        TAO::Invocation_Mode mode = TAO_DII_ASYNCH_INVOCATION);
00193 
00194     /// Invoke the target
00195     void invoke_reply_handler (Messaging::ReplyHandler_ptr reply_handler_ptr);
00196 
00197   protected:
00198     virtual Invocation_Status invoke_twoway (
00199                 TAO_Operation_Details &op,
00200                 CORBA::Object_var &effective_target,
00201                 Profile_Transport_Resolver &r,
00202                 ACE_Time_Value *&max_wait_time);
00203   };
00204 #endif /* TAO_HAS_AMI */
00205 
00206   /**
00207    * @class  DII_Oneway_Invocation_Adapter
00208    *
00209    * @brief This class is for oneway DII invocation.
00210    */
00211   class TAO_DynamicInterface_Export DII_Oneway_Invocation_Adapter
00212     : public Invocation_Adapter
00213   {
00214   public:
00215     DII_Oneway_Invocation_Adapter (
00216        CORBA::Object *target,
00217        Argument **args,
00218        int arg_number,
00219        const char *operation,
00220        int op_len,
00221        TAO::Invocation_Mode mode = TAO_SYNCHRONOUS_INVOCATION);
00222 
00223   protected:
00224     virtual Invocation_Status invoke_collocated_i (
00225         TAO_Stub *stub,
00226         TAO_Operation_Details &details,
00227         CORBA::Object_var &effective_target,
00228         Collocation_Strategy strat);
00229   };
00230 } // End namespace TAO
00231 
00232 TAO_END_VERSIONED_NAMESPACE_DECL
00233 
00234 #include /**/ "ace/post.h"
00235 #endif /*TAO_INVOCATION_ADAPTER_H*/

Generated on Tue Feb 2 17:43:23 2010 for TAO_DynamicInterface by  doxygen 1.4.7