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 78128 2007-04-20 08:07:58Z johnnyw $
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   protected:
00097 
00098     virtual Invocation_Status invoke_twoway (
00099         TAO_Operation_Details &op,
00100         CORBA::Object_var &effective_target,
00101         Profile_Transport_Resolver &r,
00102         ACE_Time_Value *&max_wait_time);
00103 
00104     virtual Invocation_Status invoke_collocated_i (
00105         TAO_Stub *stub,
00106         TAO_Operation_Details &details,
00107         CORBA::Object_var &effective_target,
00108         Collocation_Strategy strat);
00109 
00110   private:
00111 
00112     CORBA::ExceptionList *exception_list_;
00113 
00114     CORBA::Request *request_;
00115   private:
00116 
00117     /// Dont allow default initializations
00118     DII_Invocation_Adapter (void);
00119 
00120     DII_Invocation_Adapter (const DII_Invocation_Adapter &);
00121     DII_Invocation_Adapter & operator= (const DII_Invocation_Adapter &);
00122   };
00123 
00124   /**
00125    * @class  DII_Deferred_Invocation_Adapter
00126    *
00127    * @brief This class is for deferred DII invocation.
00128    */
00129   class TAO_DynamicInterface_Export DII_Deferred_Invocation_Adapter
00130     : protected Invocation_Adapter
00131   {
00132   public:
00133     DII_Deferred_Invocation_Adapter (
00134         CORBA::Object *target,
00135         Argument **args,
00136         int arg_number,
00137         const char *operation,
00138         size_t op_len,
00139         Collocation_Proxy_Broker *b,
00140         TAO_ORB_Core *oc,
00141         CORBA::Request *req,
00142         TAO::Invocation_Mode mode = TAO_DII_DEFERRED_INVOCATION);
00143 
00144     /// Invoke the target
00145     virtual void invoke (TAO::Exception_Data *ex, unsigned long ex_count);
00146 
00147   protected:
00148     virtual Invocation_Status invoke_twoway (
00149         TAO_Operation_Details &op,
00150         CORBA::Object_var &effective_target,
00151         Profile_Transport_Resolver &r,
00152         ACE_Time_Value *&max_wait_time);
00153 
00154     virtual Invocation_Status invoke_collocated_i (
00155         TAO_Stub *stub,
00156         TAO_Operation_Details &details,
00157         CORBA::Object_var &effective_target,
00158         Collocation_Strategy strat);
00159 
00160   private:
00161     CORBA::Request *request_;
00162 
00163     /// Reply dispatcher for the current Invocation.
00164     TAO_DII_Deferred_Reply_Dispatcher *rd_;
00165 
00166     /// Cache the orb_core
00167     TAO_ORB_Core * const orb_core_;
00168   };
00169 
00170 #if defined (TAO_HAS_AMI)
00171   /**
00172    * @class  DII_Asynch_Invocation_Adapter
00173    *
00174    * @brief This class is for asynchronous DII invocation.
00175    */
00176   class TAO_DynamicInterface_Export DII_Asynch_Invocation_Adapter
00177     : protected DII_Invocation_Adapter
00178   {
00179   public:
00180     DII_Asynch_Invocation_Adapter (
00181        CORBA::Object *target,
00182        Argument **args,
00183        int arg_number,
00184        const char *operation,
00185        int op_len,
00186        CORBA::Request *req,
00187        TAO::Invocation_Mode mode = TAO_DII_ASYNCH_INVOCATION);
00188 
00189     /// Invoke the target
00190     void invoke_reply_handler (Messaging::ReplyHandler_ptr reply_handler_ptr);
00191 
00192   protected:
00193     virtual Invocation_Status invoke_twoway (
00194                 TAO_Operation_Details &op,
00195                 CORBA::Object_var &effective_target,
00196                 Profile_Transport_Resolver &r,
00197                 ACE_Time_Value *&max_wait_time);
00198   };
00199 #endif /* TAO_HAS_AMI */
00200 
00201   /**
00202    * @class  DII_Oneway_Invocation_Adapter
00203    *
00204    * @brief This class is for oneway DII invocation.
00205    */
00206   class TAO_DynamicInterface_Export DII_Oneway_Invocation_Adapter
00207     : public Invocation_Adapter
00208   {
00209   public:
00210     DII_Oneway_Invocation_Adapter (
00211        CORBA::Object *target,
00212        Argument **args,
00213        int arg_number,
00214        const char *operation,
00215        int op_len,
00216        TAO::Invocation_Mode mode = TAO_SYNCHRONOUS_INVOCATION);
00217 
00218   protected:
00219     virtual Invocation_Status invoke_collocated_i (
00220         TAO_Stub *stub,
00221         TAO_Operation_Details &details,
00222         CORBA::Object_var &effective_target,
00223         Collocation_Strategy strat);
00224   };
00225 } // End namespace TAO
00226 
00227 TAO_END_VERSIONED_NAMESPACE_DECL
00228 
00229 #include /**/ "ace/post.h"
00230 #endif /*TAO_INVOCATION_ADAPTER_H*/

Generated on Sun Jan 27 13:37:31 2008 for TAO_DynamicInterface by doxygen 1.3.6