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 "$Id: Remote_Object_Proxy_Broker.cpp 76874 2007-02-02 14:12:41Z johnnyw $")
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 {
00025 TAO::Arg_Traits<ACE_InputCDR::to_boolean>::ret_val _tao_retval;
00026 TAO::Arg_Traits<char *>::in_arg_val _tao_id (type_id);
00027
00028 TAO::Argument *_tao_signature [] =
00029 {
00030 &_tao_retval,
00031 &_tao_id
00032 };
00033
00034 TAO::Invocation_Adapter tao_call (target,
00035 _tao_signature,
00036 2,
00037 "_is_a",
00038 5,
00039 0);
00040
00041 tao_call.invoke (0, 0);
00042
00043 return _tao_retval.retn ();
00044 }
00045
00046 #if (TAO_HAS_MINIMUM_CORBA == 0)
00047
00048 CORBA::Boolean
00049 Remote_Object_Proxy_Broker::_non_existent (CORBA::Object_ptr target)
00050 {
00051 TAO::Arg_Traits<ACE_InputCDR::to_boolean>::ret_val _tao_retval;
00052
00053 TAO::Argument *_tao_signature [] =
00054 {
00055 &_tao_retval
00056 };
00057
00058 TAO::Invocation_Adapter _tao_call (target,
00059 _tao_signature,
00060 1,
00061 "_non_existent",
00062 13,
00063 0);
00064
00065 _tao_call.invoke (0, 0);
00066
00067 return _tao_retval.retn ();
00068 }
00069
00070 CORBA::Object_ptr
00071 Remote_Object_Proxy_Broker::_get_component (CORBA::Object_ptr target)
00072 {
00073 TAO::Arg_Traits<CORBA::Object>::ret_val _tao_retval;
00074
00075 TAO::Argument *_tao_signature [] =
00076 {
00077 &_tao_retval
00078 };
00079
00080 TAO::Invocation_Adapter _tao_call (target,
00081 _tao_signature,
00082 1,
00083 "_component",
00084 10,
00085 0);
00086
00087 _tao_call.invoke (0, 0);
00088
00089 return _tao_retval.retn ();
00090 }
00091
00092 CORBA::InterfaceDef_ptr
00093 Remote_Object_Proxy_Broker::_get_interface (CORBA::Object_ptr target)
00094 {
00095 TAO_IFR_Client_Adapter *adapter =
00096 ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
00097 TAO_ORB_Core::ifr_client_adapter_name ()
00098 );
00099
00100 if (adapter == 0)
00101 {
00102 throw ::CORBA::INTF_REPOS ();
00103 }
00104
00105 return adapter->get_interface_remote (target);
00106 }
00107
00108 char *
00109 Remote_Object_Proxy_Broker::_repository_id (CORBA::Object_ptr target)
00110 {
00111 TAO::Arg_Traits< ::CORBA::Char *>::ret_val _tao_retval;
00112
00113 TAO::Argument *_tao_signature [] =
00114 {
00115 &_tao_retval
00116 };
00117
00118 TAO::Invocation_Adapter _tao_call (target,
00119 _tao_signature,
00120 1,
00121 "_repository_id",
00122 14,
00123 0);
00124
00125 _tao_call.invoke (0, 0);
00126
00127 return _tao_retval.retn ();
00128 }
00129 #endif
00130 }
00131
00132
00133
00134 TAO::Remote_Object_Proxy_Broker *
00135 the_tao_remote_object_proxy_broker (void)
00136 {
00137 static TAO::Remote_Object_Proxy_Broker the_broker;
00138 return &the_broker;
00139 }
00140
00141 TAO_END_VERSIONED_NAMESPACE_DECL