Remote_Object_Proxy_Broker.cpp

Go to the documentation of this file.
00001 #include "tao/Remote_Object_Proxy_Broker.h"
00002 #include "tao/CORBA_String.h"
00003 #include "tao/UB_String_Arguments.h"
00004 #include "tao/Special_Basic_Arguments.h"
00005 #include "tao/Invocation_Adapter.h"
00006 #include "tao/IFR_Client_Adapter.h"
00007 #include "tao/ORB_Core.h"
00008 #include "tao/SystemException.h"
00009 
00010 #include "ace/Dynamic_Service.h"
00011 
00012 ACE_RCSID (tao,
00013            Remote_Object_Proxy_Broker,
00014            "Remote_Object_Proxy_Broker.cpp,v 1.13 2006/03/10 07:19:06 jtc Exp")
00015 
00016 
00017 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00018 
00019 namespace TAO
00020 {
00021   CORBA::Boolean
00022   Remote_Object_Proxy_Broker::_is_a (CORBA::Object_ptr target,
00023                                      const char *type_id
00024                                      ACE_ENV_ARG_DECL)
00025   {
00026     TAO::Arg_Traits<ACE_InputCDR::to_boolean>::ret_val _tao_retval;
00027     TAO::Arg_Traits<char *>::in_arg_val _tao_id (type_id);
00028 
00029     TAO::Argument *_tao_signature [] =
00030       {
00031         &_tao_retval,
00032         &_tao_id
00033       };
00034 
00035     TAO::Invocation_Adapter tao_call (target,
00036                                       _tao_signature,
00037                                       2,
00038                                       "_is_a",
00039                                       5,
00040                                       0);
00041 
00042     tao_call.invoke (0, 0 ACE_ENV_ARG_PARAMETER);
00043     ACE_CHECK_RETURN (_tao_retval.excp ());
00044 
00045     return _tao_retval.retn ();
00046   }
00047 
00048 #if (TAO_HAS_MINIMUM_CORBA == 0)
00049 
00050   CORBA::Boolean
00051   Remote_Object_Proxy_Broker::_non_existent (CORBA::Object_ptr target
00052                                              ACE_ENV_ARG_DECL)
00053   {
00054     TAO::Arg_Traits<ACE_InputCDR::to_boolean>::ret_val _tao_retval;
00055 
00056     TAO::Argument *_tao_signature [] =
00057       {
00058         &_tao_retval
00059       };
00060 
00061     TAO::Invocation_Adapter _tao_call (target,
00062                                        _tao_signature,
00063                                        1,
00064                                        "_non_existent",
00065                                        13,
00066                                        0);
00067 
00068     _tao_call.invoke (0, 0 ACE_ENV_ARG_PARAMETER);
00069     ACE_CHECK_RETURN (_tao_retval.excp ());
00070 
00071     return _tao_retval.retn ();
00072   }
00073 
00074   CORBA::Object_ptr
00075   Remote_Object_Proxy_Broker::_get_component (CORBA::Object_ptr target
00076                                               ACE_ENV_ARG_DECL)
00077   {
00078     TAO::Arg_Traits<CORBA::Object>::ret_val _tao_retval;
00079 
00080     TAO::Argument *_tao_signature [] =
00081       {
00082         &_tao_retval
00083       };
00084 
00085     TAO::Invocation_Adapter _tao_call (target,
00086                                        _tao_signature,
00087                                        1,
00088                                        "_component",
00089                                        10,
00090                                        0);
00091 
00092     _tao_call.invoke (0, 0 ACE_ENV_ARG_PARAMETER);
00093     ACE_CHECK_RETURN (_tao_retval.excp ());
00094 
00095     return _tao_retval.retn ();
00096   }
00097 
00098   CORBA::InterfaceDef_ptr
00099   Remote_Object_Proxy_Broker::_get_interface (CORBA::Object_ptr target
00100                                               ACE_ENV_ARG_DECL)
00101   {
00102     TAO_IFR_Client_Adapter *adapter =
00103       ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
00104         TAO_ORB_Core::ifr_client_adapter_name ()
00105       );
00106 
00107   if (adapter == 0)
00108     {
00109       ACE_THROW_RETURN (CORBA::INTF_REPOS (),
00110                         0);
00111     }
00112 
00113   return adapter->get_interface_remote (target
00114                                         ACE_ENV_ARG_PARAMETER);
00115   }
00116 
00117   char *
00118   Remote_Object_Proxy_Broker::_repository_id (CORBA::Object_ptr target
00119                                               ACE_ENV_ARG_DECL)
00120   {
00121     TAO::Arg_Traits< ::CORBA::Char *>::ret_val _tao_retval;
00122 
00123     TAO::Argument *_tao_signature [] =
00124       {
00125         &_tao_retval
00126       };
00127 
00128     TAO::Invocation_Adapter _tao_call (target,
00129                                        _tao_signature,
00130                                        1,
00131                                        "_repository_id",
00132                                        14,
00133                                        0);
00134 
00135     _tao_call.invoke (0, 0 ACE_ENV_ARG_PARAMETER);
00136     ACE_CHECK_RETURN (_tao_retval.excp ());
00137 
00138     return _tao_retval.retn ();
00139   }
00140 #endif /* TAO_HAS_MINIMUM_CORBA == 0 */
00141 }
00142 
00143 // -----------------------------------------------------
00144 
00145 TAO::Remote_Object_Proxy_Broker *
00146 the_tao_remote_object_proxy_broker (void)
00147 {
00148   static TAO::Remote_Object_Proxy_Broker the_broker;
00149   return &the_broker;
00150 }
00151 
00152 TAO_END_VERSIONED_NAMESPACE_DECL

Generated on Thu Nov 9 11:54:21 2006 for TAO by doxygen 1.3.6