Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

TAO_Remote_Object_Proxy_Impl Class Reference

TAO_Remote_Object_Proxy_Impl. More...

#include <Remote_Object_Proxy_Impl.h>

Inheritance diagram for TAO_Remote_Object_Proxy_Impl:

Inheritance graph
[legend]
Collaboration diagram for TAO_Remote_Object_Proxy_Impl:

Collaboration graph
[legend]
List of all members.

Public Methods

 TAO_Remote_Object_Proxy_Impl (void)
virtual ~TAO_Remote_Object_Proxy_Impl (void)
virtual CORBA::Boolean _is_a (const CORBA::Object_ptr target, const CORBA::Char *logical_type_id ACE_ENV_ARG_DECL)
virtual CORBA::Boolean _non_existent (const CORBA::Object_ptr target ACE_ENV_ARG_DECL)
virtual CORBA_InterfaceDef_ptr _get_interface (const CORBA::Object_ptr target ACE_ENV_ARG_DECL)
virtual CORBA::Object_ptr _get_component (const CORBA::Object_ptr target ACE_ENV_ARG_DECL)

Detailed Description

TAO_Remote_Object_Proxy_Impl.

This class implements the remote proxy for the CORBA::Object class.

Definition at line 32 of file Remote_Object_Proxy_Impl.h.


Constructor & Destructor Documentation

TAO_Remote_Object_Proxy_Impl::TAO_Remote_Object_Proxy_Impl void   
 

Definition at line 15 of file Remote_Object_Proxy_Impl.cpp.

00016 {
00017   // No-Op
00018 }

TAO_Remote_Object_Proxy_Impl::~TAO_Remote_Object_Proxy_Impl void    [virtual]
 

Definition at line 21 of file Remote_Object_Proxy_Impl.cpp.

00022 {
00023   // No-Op
00024 }


Member Function Documentation

CORBA::Object_ptr TAO_Remote_Object_Proxy_Impl::_get_component const CORBA::Object_ptr target    ACE_ENV_ARG_DECL [virtual]
 

Implements TAO_Object_Proxy_Impl.

Definition at line 169 of file Remote_Object_Proxy_Impl.cpp.

References CORBA_SystemException::_tao_minor_code, ACE_ASSERT, ACE_CATCHANY, ACE_ENDTRY, ACE_ENV_ARG_DECL, ACE_ENV_ARG_PARAMETER, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_RE_THROW, ACE_THROW_RETURN, ACE_TRY, ACE_TRY_CHECK, TAO_GIOP_Synch_Invocation::inp_stream, TAO_GIOP_Twoway_Invocation::invoke, TAO_Stub::orb_core, TAO_GIOP_Invocation::prepare_header, TAO_GIOP_Twoway_Invocation::start, TAO_DEFAULT_MINOR_CODE, TAO_INVOKE_EXCEPTION, TAO_INVOKE_OK, TAO_INVOKE_RESTART, and TAO_TWOWAY_RESPONSE_FLAG.

00171 {
00172   CORBA::Object_var _tao_retval (CORBA::Object::_nil ());
00173 
00174   ACE_TRY
00175     {
00176       // Must catch exceptions, if the server raises a
00177       // CORBA::OBJECT_NOT_EXIST then we must return 1, instead of
00178       // propagating the exception.
00179       TAO_Stub *istub = target->_stubobj ();
00180       if (istub == 0)
00181         ACE_THROW_RETURN (CORBA::INTERNAL (
00182                             CORBA_SystemException::_tao_minor_code (
00183                               TAO_DEFAULT_MINOR_CODE,
00184                               EINVAL),
00185                             CORBA::COMPLETED_NO),
00186                           _tao_retval._retn());
00187 
00188       TAO_GIOP_Twoway_Invocation _tao_call (istub,
00189                                             "_component",
00190                                             10,
00191                                             1,
00192                                             istub->orb_core ());
00193 
00194       // ACE_TRY_ENV.clear ();
00195       for (;;)
00196         {
00197           _tao_call.start (ACE_ENV_SINGLE_ARG_PARAMETER);
00198           ACE_TRY_CHECK;
00199 
00200           CORBA::Short flag = TAO_TWOWAY_RESPONSE_FLAG;
00201 
00202           _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag)
00203                                      ACE_ENV_ARG_PARAMETER);
00204           ACE_TRY_CHECK;
00205 
00206           int _invoke_status =
00207             _tao_call.invoke (0, 0 ACE_ENV_ARG_PARAMETER);
00208           ACE_TRY_CHECK;
00209 
00210           if (_invoke_status == TAO_INVOKE_RESTART)
00211             continue;
00212           ACE_ASSERT (_invoke_status != TAO_INVOKE_EXCEPTION);
00213           if (_invoke_status != TAO_INVOKE_OK)
00214             {
00215               ACE_THROW_RETURN (CORBA::UNKNOWN (TAO_DEFAULT_MINOR_CODE,
00216                                                 CORBA::COMPLETED_YES),
00217                                 _tao_retval._retn ());
00218             }
00219           break;
00220         }
00221       TAO_InputCDR &_tao_in = _tao_call.inp_stream ();
00222       if (!(
00223             (_tao_in >> _tao_retval.inout ())
00224             ))
00225         ACE_THROW_RETURN (CORBA::MARSHAL (), _tao_retval._retn ());
00226     }
00227   ACE_CATCHANY
00228     {
00229       ACE_RE_THROW;
00230     }
00231   ACE_ENDTRY;
00232   return _tao_retval._retn ();
00233 }

CORBA_InterfaceDef_ptr TAO_Remote_Object_Proxy_Impl::_get_interface const CORBA::Object_ptr target    ACE_ENV_ARG_DECL [virtual]
 

Implements TAO_Object_Proxy_Impl.

Definition at line 236 of file Remote_Object_Proxy_Impl.cpp.

References ACE_ENV_ARG_DECL, ACE_ENV_ARG_PARAMETER, ACE_THROW_RETURN, TAO_IFR_Client_Adapter::get_interface_remote, TAO_ORB_Core::ifr_client_adapter_name, and ACE_Dynamic_Service::instance.

00238 {
00239   TAO_IFR_Client_Adapter *adapter =
00240     ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
00241         TAO_ORB_Core::ifr_client_adapter_name ()
00242       );
00243 
00244   if (adapter == 0)
00245     {
00246       ACE_THROW_RETURN (CORBA::INTF_REPOS (),
00247                         0);
00248     }
00249 
00250   return adapter->get_interface_remote (target
00251                                          ACE_ENV_ARG_PARAMETER);
00252 }

CORBA::Boolean TAO_Remote_Object_Proxy_Impl::_is_a const CORBA::Object_ptr    target,
const CORBA::Char *logical_type_id    ACE_ENV_ARG_DECL
[virtual]
 

Implements TAO_Object_Proxy_Impl.

Definition at line 27 of file Remote_Object_Proxy_Impl.cpp.

References CORBA_SystemException::_tao_minor_code, ACE_CHECK_RETURN, ACE_ENV_ARG_DECL, ACE_ENV_ARG_PARAMETER, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_THROW_RETURN, TAO_GIOP_Synch_Invocation::inp_stream, TAO_GIOP_Twoway_Invocation::invoke, TAO_Stub::orb_core, TAO_GIOP_Invocation::out_stream, TAO_GIOP_Invocation::prepare_header, TAO_GIOP_Twoway_Invocation::start, TAO_DEFAULT_MINOR_CODE, TAO_INVOKE_OK, TAO_INVOKE_RESTART, and TAO_TWOWAY_RESPONSE_FLAG.

00030 {
00031   // Here we go remote to answer the question.
00032   CORBA::Boolean _tao_retval = 0;
00033 
00034   TAO_Stub *istub = target->_stubobj ();
00035   if (istub == 0)
00036     ACE_THROW_RETURN (CORBA::INTERNAL (
00037                         CORBA_SystemException::_tao_minor_code (
00038                           TAO_DEFAULT_MINOR_CODE,
00039                           EINVAL),
00040                         CORBA::COMPLETED_NO),
00041                       _tao_retval);
00042 
00043   TAO_GIOP_Twoway_Invocation _tao_call (istub,
00044                                         "_is_a",
00045                                         5,
00046                                         1,
00047                                         istub->orb_core ());
00048 
00049   // Loop until we succeed or we raise an exception.
00050   // @@ Nanbor: Do we still need to clear the environment variable?
00051   //  ACE_TRY_ENV.clear ();
00052   for (;;)
00053     {
00054       _tao_call.start (ACE_ENV_SINGLE_ARG_PARAMETER);
00055       ACE_CHECK_RETURN (_tao_retval);
00056 
00057       CORBA::Short flag = TAO_TWOWAY_RESPONSE_FLAG;
00058 
00059       _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag)
00060                                  ACE_ENV_ARG_PARAMETER);
00061       ACE_CHECK_RETURN (_tao_retval);
00062 
00063       TAO_OutputCDR &_tao_out = _tao_call.out_stream ();
00064       if (!(
00065             (_tao_out << logical_type_id)
00066             ))
00067         ACE_THROW_RETURN (CORBA::MARSHAL (), _tao_retval);
00068 
00069       int _invoke_status =
00070         _tao_call.invoke (0, 0 ACE_ENV_ARG_PARAMETER);
00071       ACE_CHECK_RETURN (_tao_retval);
00072 
00073       if (_invoke_status == TAO_INVOKE_RESTART)
00074         continue;
00075       // if (_invoke_status == TAO_INVOKE_EXCEPTION)
00076       // cannot happen
00077       if (_invoke_status != TAO_INVOKE_OK)
00078         {
00079           ACE_THROW_RETURN (CORBA::UNKNOWN (TAO_DEFAULT_MINOR_CODE,
00080                                             CORBA::COMPLETED_YES),
00081                             _tao_retval);
00082 
00083         }
00084       break;
00085     }
00086   TAO_InputCDR &_tao_in = _tao_call.inp_stream ();
00087   if (!(_tao_in >> CORBA::Any::to_boolean (_tao_retval)))
00088     ACE_THROW_RETURN (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE,
00089                                       CORBA::COMPLETED_YES),
00090                       _tao_retval);
00091   return _tao_retval;
00092 
00093 }

CORBA::Boolean TAO_Remote_Object_Proxy_Impl::_non_existent const CORBA::Object_ptr target    ACE_ENV_ARG_DECL [virtual]
 

Implements TAO_Object_Proxy_Impl.

Definition at line 98 of file Remote_Object_Proxy_Impl.cpp.

References CORBA_SystemException::_tao_minor_code, ACE_ASSERT, ACE_CATCH, ACE_CATCHANY, ACE_ENDTRY, ACE_ENV_ARG_DECL, ACE_ENV_ARG_PARAMETER, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_RE_THROW, ACE_THROW_RETURN, ACE_TRY, ACE_TRY_CHECK, TAO_GIOP_Synch_Invocation::inp_stream, TAO_GIOP_Twoway_Invocation::invoke, TAO_Stub::orb_core, TAO_GIOP_Invocation::prepare_header, TAO_GIOP_Twoway_Invocation::start, TAO_DEFAULT_MINOR_CODE, TAO_INVOKE_EXCEPTION, TAO_INVOKE_OK, TAO_INVOKE_RESTART, and TAO_TWOWAY_RESPONSE_FLAG.

00100 {
00101   CORBA::Boolean _tao_retval = 0;
00102 
00103   ACE_TRY
00104     {
00105       // Must catch exceptions, if the server raises a
00106       // CORBA::OBJECT_NOT_EXIST then we must return 1, instead of
00107       // propagating the exception.
00108       TAO_Stub *istub = target->_stubobj ();
00109       if (istub == 0)
00110         ACE_THROW_RETURN (CORBA::INTERNAL (
00111                             CORBA_SystemException::_tao_minor_code (
00112                               TAO_DEFAULT_MINOR_CODE,
00113                               EINVAL),
00114                             CORBA::COMPLETED_NO),
00115                           _tao_retval);
00116 
00117       TAO_GIOP_Twoway_Invocation _tao_call (istub,
00118                                             "_non_existent",
00119                                             13,
00120                                             1,
00121                                             istub->orb_core ());
00122 
00123       // ACE_TRY_ENV.clear ();
00124       for (;;)
00125         {
00126           _tao_call.start (ACE_ENV_SINGLE_ARG_PARAMETER);
00127           ACE_TRY_CHECK;
00128 
00129           CORBA::Short flag = TAO_TWOWAY_RESPONSE_FLAG;
00130 
00131           _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag)
00132                                      ACE_ENV_ARG_PARAMETER);
00133           ACE_TRY_CHECK;
00134 
00135           int _invoke_status =
00136             _tao_call.invoke (0, 0 ACE_ENV_ARG_PARAMETER);
00137           ACE_TRY_CHECK;
00138 
00139           if (_invoke_status == TAO_INVOKE_RESTART)
00140             continue;
00141           ACE_ASSERT (_invoke_status != TAO_INVOKE_EXCEPTION);
00142           if (_invoke_status != TAO_INVOKE_OK)
00143             {
00144               ACE_THROW_RETURN (CORBA::UNKNOWN (TAO_DEFAULT_MINOR_CODE,
00145                                                 CORBA::COMPLETED_YES),
00146                                 _tao_retval);
00147             }
00148           break;
00149         }
00150       TAO_InputCDR &_tao_in = _tao_call.inp_stream ();
00151       if (!(
00152             (_tao_in >> CORBA::Any::to_boolean (_tao_retval))
00153             ))
00154         ACE_THROW_RETURN (CORBA::MARSHAL (), _tao_retval);
00155     }
00156   ACE_CATCH (CORBA::OBJECT_NOT_EXIST, ex)
00157     {
00158       _tao_retval = 1;
00159     }
00160   ACE_CATCHANY
00161     {
00162       ACE_RE_THROW;
00163     }
00164   ACE_ENDTRY;
00165   return _tao_retval;
00166 }


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 15:38:32 2003 for TAO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002