4 //=============================================================================
6 * @file Locate_ResponseHandler.h
8 * @author Phil Mesnier <mesnier_p@ociweb>
10 //=============================================================================
13 #ifndef TAO_LOCATE_RESPONSEHANDLER_H
14 #define TAO_LOCATE_RESPONSEHANDLER_H
16 #include /**/ "ace/pre.h"
18 #include "tao/orbconf.h"
20 #if !defined (ACE_LACKS_PRAGMA_ONCE)
22 #endif /* ACE_LACKS_PRAGMA_ONCE */
24 #include "async_iortable_export.h"
25 #include "tao/Versioned_Namespace.h"
26 #include "tao/Messaging/AMH_Response_Handler.h"
27 #include "tao/Valuetype/ValueBase.h"
30 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
37 class TAO_AMH_Locate_ResponseHandler
;
39 typedef TAO_AMH_Locate_ResponseHandler
*TAO_AMH_Locate_ResponseHandler_ptr
;
42 * @class TAO_AMH_Locate_ResponseHandler_var
44 * @brief The T_var class for response handler
46 * As any other pseudo object, this class has a T_var class too.
48 class TAO_Async_IORTable_Export TAO_AMH_Locate_ResponseHandler_var
51 TAO_AMH_Locate_ResponseHandler_var ();
52 TAO_AMH_Locate_ResponseHandler_var (TAO_AMH_Locate_ResponseHandler_ptr
);
53 TAO_AMH_Locate_ResponseHandler_var (
54 const TAO_AMH_Locate_ResponseHandler_var
&);
55 ~TAO_AMH_Locate_ResponseHandler_var ();
57 TAO_AMH_Locate_ResponseHandler_var
&operator= (
58 TAO_AMH_Locate_ResponseHandler_ptr
);
59 TAO_AMH_Locate_ResponseHandler_var
&operator= (
60 const TAO_AMH_Locate_ResponseHandler_var
&);
61 TAO_AMH_Locate_ResponseHandler_ptr
operator-> () const;
63 operator const TAO_AMH_Locate_ResponseHandler_ptr
&() const;
64 operator TAO_AMH_Locate_ResponseHandler_ptr
&();
66 TAO_AMH_Locate_ResponseHandler_ptr
in () const;
67 TAO_AMH_Locate_ResponseHandler_ptr
&inout ();
68 TAO_AMH_Locate_ResponseHandler_ptr
&out ();
69 TAO_AMH_Locate_ResponseHandler_ptr
_retn ();
70 TAO_AMH_Locate_ResponseHandler_ptr
ptr () const;
73 TAO_AMH_Locate_ResponseHandler_ptr ptr_
;
78 * @class TAO_AMH_Locate_ResponseHandler
80 * @brief This is the main class for DSI using AMH.
82 * With ordinary DSI, the POA calls _dispatch, which in turn calls invoke
83 * on the DSI handler. Invoke completely handles the request, and packages
84 * the result in the request object so that it can be marshalled and sent
87 * With the AMH variation, the DSI handler's invoke method starts the
88 * processing, but delegates the result packaging to a response handler.
89 * This way, if the invocation takes a long time, or involves blocking
90 * calls, then the result handling can be managed by another thread.
91 * This is particularly useful for gateway implementations, where the
92 * middle tier should not have to block waiting for replies.
94 * As this is built on the CORBA object model, there are separate classes
95 * representing the interface and the implementation.
97 class TAO_Async_IORTable_Export TAO_AMH_Locate_ResponseHandler
98 : public virtual TAO_AMH_Response_Handler
101 typedef TAO_AMH_Locate_ResponseHandler_ptr _ptr_type
;
102 typedef TAO_AMH_Locate_ResponseHandler_var _var_type
;
104 TAO_AMH_Locate_ResponseHandler (TAO_ServerRequest
&sr
);
105 ~TAO_AMH_Locate_ResponseHandler ();
107 virtual void raise_excep (const CORBA::Exception
&ex
);
109 virtual void forward_ior (const char *ior
, CORBA::Boolean is_perm
);
111 /// Returns a CORBA::Object_ptr for the target object.
112 CORBA::Object_ptr
_this ();
114 /// CORBA Object related methods
115 static TAO_AMH_Locate_ResponseHandler
* _duplicate (
116 TAO_AMH_Locate_ResponseHandler_ptr
);
117 static TAO_AMH_Locate_ResponseHandler
* _nil ();
118 static TAO_AMH_Locate_ResponseHandler
* _narrow (CORBA::Object_ptr
);
119 static TAO_AMH_Locate_ResponseHandler
* _unchecked_narrow (CORBA::Object_ptr
);
122 /// Return 0. Should never be used.
123 virtual const char *_interface_repository_id () const;
125 /// Simply returns "this"
126 virtual void *_downcast (const char *repository_id
);
135 // satisfy the native type requirement for the asnyc locate interface
136 typedef const TAO_AMH_Locate_ResponseHandler_var
&Locate_ResponseHandler
;
139 TAO_END_VERSIONED_NAMESPACE_DECL
141 #if defined (__ACE_INLINE__)
142 # include "Locate_ResponseHandler.inl"
143 #endif /* __ACE_INLINE__ */
145 #include /**/ "ace/post.h"
147 #endif /* TAO_LOCATE_RESPONSEHANDLER_H */