1 #include "tao/ObjRefTemplate/ObjectReferenceTemplate_i.h"
2 #include "tao/PortableServer/Root_POA.h"
4 #include "tao/CORBA_String.h"
5 #include "tao/ORB_Constants.h"
7 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
11 ObjectReferenceTemplate::ObjectReferenceTemplate (
12 const char *server_id
,
14 PortableInterceptor::AdapterName
*adapter_name
,
15 PortableServer::POA_ptr poa
)
16 : server_id_ (server_id
),
18 adapter_name_ (adapter_name
),
19 poa_ (PortableServer::POA::_duplicate (poa
))
23 ObjectReferenceTemplate::~ObjectReferenceTemplate (void)
28 ObjectReferenceTemplate::_copy_value (void)
30 ::CORBA::ValueBase
*ret_val
= 0;
33 ObjectReferenceTemplate (
45 ObjectReferenceTemplate::server_id (void)
47 return CORBA::string_dup (this->server_id_
);
51 ObjectReferenceTemplate::orb_id (void)
53 return CORBA::string_dup (this->orb_id_
);
56 PortableInterceptor::AdapterName
*
57 ObjectReferenceTemplate::adapter_name (void)
59 PortableInterceptor::AdapterName
*adapter_name
= 0;
61 ACE_NEW_THROW_EX (adapter_name
,
62 PortableInterceptor::AdapterName (
63 *(this->adapter_name_
)),
65 CORBA::SystemException::_tao_minor_code (
68 CORBA::COMPLETED_NO
));
74 ObjectReferenceTemplate::make_object (
76 const PortableInterceptor::ObjectId
&)
78 if (CORBA::is_nil (this->poa_
.in ()))
79 throw ::CORBA::BAD_INV_ORDER ();
81 TAO_Root_POA
* const tao_poa
=
82 dynamic_cast<TAO_Root_POA
*> (this->poa_
.in());
85 throw ::CORBA::INTERNAL ();
87 return tao_poa
->invoke_key_to_object ();
91 TAO_END_VERSIONED_NAMESPACE_DECL