3 //=============================================================================
5 * @file DII_Invocation_Adapter.h
7 * @author Balachandran Natarajan <bala@dre.vanderbilt.edu>
9 //=============================================================================
10 #ifndef TAO_DII_INVOCATION_ADAPTER_H
11 #define TAO_DII_INVOCATION_ADAPTER_H
12 #include /**/ "ace/pre.h"
14 #include "tao/DynamicInterface/dynamicinterface_export.h"
16 #if !defined (ACE_LACKS_PRAGMA_ONCE)
18 #endif /* ACE_LACKS_PRAGMA_ONCE */
21 #include "tao/Invocation_Adapter.h"
22 #include "tao/Asynch_Reply_Dispatcher_Base.h"
23 #include "tao/DynamicInterface/DII_Reply_Dispatcher.h"
24 #include "ace/Auto_Functor.h"
26 #if defined (TAO_HAS_AMI)
27 #include "tao/Messaging/Messaging.h"
28 #endif /* TAO_HAS_AMI */
30 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
32 ACE_END_VERSIONED_NAMESPACE_DECL
35 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
36 class TAO_Operation_Details
;
49 class Collocation_Proxy_Broker
;
50 struct Exception_Data
;
53 * @class DII_Invocation_Adapter
55 * @brief Generic interface for the DII invocation object visible
57 class TAO_DynamicInterface_Export DII_Invocation_Adapter
:
58 public Invocation_Adapter
61 /// The only constructor used by the IDL compiler and only way to
62 /// create this adapter.
65 * @param target Points to the object on which this invocation is
68 * @param args Array of pointers to the argument list in the
69 * operation declaration. this includes the return, inout and out
72 * @param arg_number Number of arguments in the above array. This
73 * is the number of elements in the above array.
75 * @param operation The name of the operation being invoked.
77 * @param op_len Number of characters in the operation name. This
78 * is an optimization which helps us to avoid calling strlen ()
79 * while creating a message format.
81 * @param mode Invocation mode. This information is also available
82 * in the IDL file and in the generated code.
84 DII_Invocation_Adapter (CORBA::Object
*target
,
87 const char *operation
,
89 CORBA::ExceptionList
*exception
,
91 Invocation_Mode mode
= TAO_DII_INVOCATION
);
93 virtual ~DII_Invocation_Adapter ();
96 virtual void invoke (const TAO::Exception_Data
*ex
, unsigned long ex_count
);
99 virtual Invocation_Status
invoke_twoway (
100 TAO_Operation_Details
&op
,
101 CORBA::Object_var
&effective_target
,
102 Profile_Transport_Resolver
&r
,
103 ACE_Time_Value
*&max_wait_time
,
104 Invocation_Retry_State
*retry_state
= 0);
106 virtual Invocation_Status
invoke_collocated_i (
108 TAO_Operation_Details
&details
,
109 CORBA::Object_var
&effective_target
,
110 Collocation_Strategy strat
);
113 CORBA::ExceptionList
*exception_list_
;
115 CORBA::Request
*request_
;
117 TAO::Exception_Data
*ex_data_
;
119 DII_Invocation_Adapter () = delete;
120 DII_Invocation_Adapter (const DII_Invocation_Adapter
&) = delete;
121 DII_Invocation_Adapter
& operator= (const DII_Invocation_Adapter
&) = delete;
125 * @class DII_Deferred_Invocation_Adapter
127 * @brief This class is for deferred DII invocation.
129 class TAO_DynamicInterface_Export DII_Deferred_Invocation_Adapter
130 : public Invocation_Adapter
133 DII_Deferred_Invocation_Adapter (
134 CORBA::Object
*target
,
137 const char *operation
,
139 int collocation_opportunity
,
142 TAO::Invocation_Mode mode
= TAO_DII_DEFERRED_INVOCATION
);
144 /// Invoke the target
145 virtual void invoke (const TAO::Exception_Data
*ex
, unsigned long ex_count
);
148 virtual Invocation_Status
invoke_twoway (
149 TAO_Operation_Details
&op
,
150 CORBA::Object_var
&effective_target
,
151 Profile_Transport_Resolver
&r
,
152 ACE_Time_Value
*&max_wait_time
,
153 Invocation_Retry_State
*retry_state
= 0);
155 virtual Invocation_Status
invoke_collocated_i (
157 TAO_Operation_Details
&details
,
158 CORBA::Object_var
&effective_target
,
159 Collocation_Strategy strat
);
162 CORBA::Request
*request_
;
164 /// Reply dispatcher for the current Invocation.
165 /// Use special autopointer like holder to prevent leaking memory from
166 /// the reply dispatcher that we create.
167 ACE_Utils::Auto_Functor
<TAO_DII_Deferred_Reply_Dispatcher
,
168 ARDB_Refcount_Functor
> rd_
;
170 /// Cache the orb_core
171 TAO_ORB_Core
* const orb_core_
;
175 * @class DII_Oneway_Invocation_Adapter
177 * @brief This class is for oneway DII invocation.
179 class TAO_DynamicInterface_Export DII_Oneway_Invocation_Adapter
180 : public Invocation_Adapter
183 DII_Oneway_Invocation_Adapter (
184 CORBA::Object
*target
,
187 const char *operation
,
189 TAO::Invocation_Mode mode
= TAO_SYNCHRONOUS_INVOCATION
);
192 virtual Invocation_Status
invoke_collocated_i (
194 TAO_Operation_Details
&details
,
195 CORBA::Object_var
&effective_target
,
196 Collocation_Strategy strat
);
198 } // End namespace TAO
200 TAO_END_VERSIONED_NAMESPACE_DECL
202 #include /**/ "ace/post.h"
203 #endif /*TAO_INVOCATION_ADAPTER_H*/